-Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
-
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
-
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
-
-
-0.
- This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-
-
-1.
- You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-
-2.
- You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-
-
-
-
a)
- You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
-
-
b)
- You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
-
-
c)
- If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-
-
-3.
- You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-
-
-
-
-
-
a)
- Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
-
-
b)
- Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
-
-
c)
- Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-
-4.
- You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-
-
-5.
- You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-
-
-6.
- Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-
-
-7.
- If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-
-
-8.
- If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-
-
-9.
- The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-
-
-
-10.
- If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-
-
-
NO WARRANTY
-
-
-
-11.
- BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-
-
-12.
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
-
-
-one line to give the program's name and an idea of what it does.
-Copyright (C) yyyyname of author
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-
-
-
-Gnomovision version 69, Copyright (C) yyyyname of author
-Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
-type `show w'. This is free software, and you are welcome
-to redistribute it under certain conditions; type `show c'
-for details.
-
-
-
-The hypothetical commands `show w' and `show c' should show
-the appropriate parts of the General Public License. Of course, the
-commands you use may be called something other than `show w' and
-`show c'; they could even be mouse-clicks or menu items--whatever
-suits your program.
-
-
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
-
-
-
-Yoyodyne, Inc., hereby disclaims all copyright
-interest in the program `Gnomovision'
-(which makes passes at compilers) written
-by James Hacker.
-
-signature of Ty Coon, 1 April 1989
-Ty Coon, President of Vice
-
-
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
-
-
-Copyright notice above.
-Free Software Foundation, Inc.,
-59 Temple Place - Suite 330, Boston, MA 02111, USA
-
-Updated:
-
-16 Feb 1998 tower
-
-
-
-
diff --git a/Images/class.gif b/Images/class.gif
new file mode 100644
index 0000000..5b9ab9e
Binary files /dev/null and b/Images/class.gif differ
diff --git a/Images/copy.gif b/Images/copy.gif
new file mode 100644
index 0000000..849f210
Binary files /dev/null and b/Images/copy.gif differ
diff --git a/Images/dispatch.gif b/Images/dispatch.gif
new file mode 100644
index 0000000..3f6fe40
Binary files /dev/null and b/Images/dispatch.gif differ
diff --git a/Images/down.xbm b/Images/down.xbm
new file mode 100644
index 0000000..c867fce
--- /dev/null
+++ b/Images/down.xbm
@@ -0,0 +1,6 @@
+/* Created with The GIMP */
+#define C__Program_Files_Tcl_lib_width 12
+#define C__Program_Files_Tcl_lib_height 12
+static unsigned char C__Program_Files_Tcl_lib_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xc0, 0x00, 0xe0, 0x00, 0xf0, 0x00,
+ 0xe0, 0x00, 0xc0, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
diff --git a/Images/enum.gif b/Images/enum.gif
new file mode 100644
index 0000000..7e48ce0
Binary files /dev/null and b/Images/enum.gif differ
diff --git a/Images/find.gif b/Images/find.gif
new file mode 100644
index 0000000..4802a6c
Binary files /dev/null and b/Images/find.gif differ
diff --git a/Images/find.xbm b/Images/find.xbm
new file mode 100644
index 0000000..03267a1
--- /dev/null
+++ b/Images/find.xbm
@@ -0,0 +1,9 @@
+/* Created with The GIMP */
+#define C__Program_Files_Tcl_lib_width 17
+#define C__Program_Files_Tcl_lib_height 18
+static unsigned char C__Program_Files_Tcl_lib_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x1c, 0x00, 0x50, 0x1c, 0x00,
+ 0x50, 0x1c, 0x00, 0x70, 0x1c, 0x00, 0xf8, 0x3e, 0x00, 0xe8, 0x3a, 0x00,
+ 0xfc, 0x7f, 0x00, 0x7e, 0xfb, 0x00, 0x7e, 0xfb, 0x00, 0xfe, 0xfb, 0x00,
+ 0xfe, 0xfe, 0x00, 0x3a, 0xe8, 0x00, 0x3a, 0xe8, 0x00, 0x3e, 0xf8, 0x00,
+ 0x3e, 0xf8, 0x00, 0x00, 0x00, 0x00 };
diff --git a/Images/hide.xbm b/Images/hide.xbm
new file mode 100644
index 0000000..11e2008
--- /dev/null
+++ b/Images/hide.xbm
@@ -0,0 +1,9 @@
+/* Created with The GIMP */
+#define C__Program_Files_Tcl_lib_width 17
+#define C__Program_Files_Tcl_lib_height 17
+static unsigned char C__Program_Files_Tcl_lib_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x01, 0x00, 0x40, 0x02, 0x00, 0x20, 0x04, 0x00, 0x10, 0x08, 0x00,
+ 0x80, 0x01, 0x00, 0x40, 0x02, 0x00, 0x20, 0x04, 0x00, 0x10, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00 };
diff --git a/Images/interface.gif b/Images/interface.gif
new file mode 100644
index 0000000..40548e6
Binary files /dev/null and b/Images/interface.gif differ
diff --git a/Images/libselect.gif b/Images/libselect.gif
new file mode 100644
index 0000000..ded2e77
Binary files /dev/null and b/Images/libselect.gif differ
diff --git a/Images/libselect.xbm b/Images/libselect.xbm
new file mode 100644
index 0000000..4602777
--- /dev/null
+++ b/Images/libselect.xbm
@@ -0,0 +1,9 @@
+/* Created with The GIMP */
+#define c__program_files_tcl_lib_width 17
+#define c__program_files_tcl_lib_height 17
+static unsigned char c__program_files_tcl_lib_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x3f, 0x00,
+ 0x00, 0x00, 0x00, 0xf4, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x3f, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00 };
diff --git a/Images/method.gif b/Images/method.gif
new file mode 100644
index 0000000..4835497
Binary files /dev/null and b/Images/method.gif differ
diff --git a/Images/module.gif b/Images/module.gif
new file mode 100644
index 0000000..09b5e0b
Binary files /dev/null and b/Images/module.gif differ
diff --git a/Images/noselect.gif b/Images/noselect.gif
new file mode 100644
index 0000000..9623a07
Binary files /dev/null and b/Images/noselect.gif differ
diff --git a/Images/property.gif b/Images/property.gif
new file mode 100644
index 0000000..1e0af13
Binary files /dev/null and b/Images/property.gif differ
diff --git a/Images/right.xbm b/Images/right.xbm
new file mode 100644
index 0000000..9a8a5f0
--- /dev/null
+++ b/Images/right.xbm
@@ -0,0 +1,6 @@
+/* Created with The GIMP */
+#define c__program_files_tcl_lib_width 12
+#define c__program_files_tcl_lib_height 12
+static unsigned char c__program_files_tcl_lib_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x30, 0x00, 0x70, 0x00, 0xf0, 0x00,
+ 0x70, 0x00, 0x30, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
diff --git a/Images/select.gif b/Images/select.gif
new file mode 100644
index 0000000..9b6a0bf
Binary files /dev/null and b/Images/select.gif differ
diff --git a/Images/show.xbm b/Images/show.xbm
new file mode 100644
index 0000000..e9d8548
--- /dev/null
+++ b/Images/show.xbm
@@ -0,0 +1,9 @@
+/* Created with The GIMP */
+#define C__Program_Files_Tcl_lib_width 17
+#define C__Program_Files_Tcl_lib_height 17
+static unsigned char C__Program_Files_Tcl_lib_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10, 0x08, 0x00, 0x20, 0x04, 0x00, 0x40, 0x02, 0x00,
+ 0x80, 0x01, 0x00, 0x10, 0x08, 0x00, 0x20, 0x04, 0x00, 0x40, 0x02, 0x00,
+ 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00 };
diff --git a/Images/struct.gif b/Images/struct.gif
new file mode 100644
index 0000000..2b8c789
Binary files /dev/null and b/Images/struct.gif differ
diff --git a/Images/typedef.gif b/Images/typedef.gif
new file mode 100644
index 0000000..1faec02
Binary files /dev/null and b/Images/typedef.gif differ
diff --git a/Images/union.gif b/Images/union.gif
new file mode 100644
index 0000000..06e042f
Binary files /dev/null and b/Images/union.gif differ
diff --git a/ReadMe.txt b/ReadMe.txt
index 310352f..b2ead57 100644
--- a/ReadMe.txt
+++ b/ReadMe.txt
@@ -1,19 +1,27 @@
-OpTcl v3.0 build 04
+
+OpTcl v3.0 build 10
-------------------
+PRE PRE ALPHA RELEASE (Friends and Family only)
+
+What's New
+----------
+Areas with Bug Fixes: Reference counting, Query Interfacing, (in/)out parameters; -with optimisation.
+
+New Features: Can now call custom interfaces. Handles COM's record structures. Library browser has search and history facilities. OpTcl works with COM better than ever before! :-)
Licencing
---------
-Use of this software indicates an agreement to the GNU Public Licence under which,
-this software is provided.
+Ignore any references to LGPL. I hereby renounce this license for one which is in-line with the BSD license. Please read the enclosed license.txt for details.
Documentation
-------------
-Please open the default.html file in the 'docs' directory for installation instructions
-and documentation.
+This is a beta release so the docs aren't there yet ... I've included the old ones just for comparison. A lot of the previous functionality and syntax is identical. A few things however have changed dramatically.
+To start things off try the following
+package require optcl
+tlview::viewlib .l
+I welcome any comments, suggestions and bug reports. Enjoy!
-I welcome any comments, suggestions and bug reports:
+Farzad.
fuzz@sys.uea.ac.uk
-
-
diff --git a/docs/optcl.html b/docs/optcl.html
index 206a2d5..a1b76dc 100644
--- a/docs/optcl.html
+++ b/docs/optcl.html
@@ -3,7 +3,7 @@
-
+
OpTcl Documentation
@@ -18,12 +18,8 @@ Pezeshkpour
August 1999
-
This software is freely distributed under the GNU Public
-Licence. I've include this in this distribution as an HTML file.
-
-
Gosh! So much to document here, and so little time. This is a
-preliminary, and rather informal document - a better version is
-on its way!
+
This software is freely distributed under the GNU Lesser General Public License. I've include this in this distribution as an
+ HTML file.
The Distribution
@@ -33,9 +29,11 @@ the distribution:
install
-
Holds the installer script and two versions of the
- DLL - one for Tcl 8.0.5 (no stubs), and one with stubs
- enabled, built for Tcl 8.2 libraries.
+
Holds the installer script and the debug and release versions of the
+ stubbed DLLs for Tcl8.2 and above. I also wanted to build a
+ distribution for Tcl8.0.5+ without stubs, but no matter were I
+ downloaded the Tcl installer from, it failed half way through the
+ installation.
docs
@@ -49,7 +47,8 @@ the distribution:
tests
A couple of test scripts using MS Word, and the
- Calendar Control.
+ Calendar Control. Need to put an example of scripting DirectX - should
+ nicely show off what OpTcl can really do! :-)
@@ -69,15 +68,14 @@ is applied to that directory.
Distribute example files.
Implement array parameters.
Implement default parameter values.
-
Test out-flagged parameters (I haven't found a
- server to do this, yet).
Implement in/out-flagged parameters for events.
Use Type Libraries on the type conversion of an event-handlers
result.
Test with DCOM. (does anyone have a setup that can do
this?)
Write an ActiveScripting engine interface.
-
In some cases perhaps, reconsider syntax.
+
Remove explicit reference counting - I can't do this until Scriptics
+ patch the Tcl core to enable 'precious' objects.
Known Bugs/Limitations
@@ -87,6 +85,8 @@ is applied to that directory.
Can't set parameters by their name, à la Visual Basic.
Microsoft Forms ActiveX objects can't be fully in-place
activated.
+
Lack of reference counting means that objects within records need to be
+ explicitly unlocked.
diff --git a/docs/optcltypes.html b/docs/optcltypes.html
index 55bcdb6..54dd225 100644
--- a/docs/optcltypes.html
+++ b/docs/optcltypes.html
@@ -27,10 +27,11 @@ accurrately described.
allow for the accurate type conversion between Tcl objects and
COM types, and b) speed up an invocation on an object.
-
+sensitive in its invocations. I have a test version that can write out new
+libraries, and wrap Tcl scripts as fully-fledged ActiveX objects - more about
+this later...
In OpTcl, types are represented as a strings comprising of the
programmatic name for a type library and its contained typename,
diff --git a/install/optcl80.dll b/install/optcl80.dll
deleted file mode 100644
index a45c51a..0000000
Binary files a/install/optcl80.dll and /dev/null differ
diff --git a/install/optcl_Install.tcl b/install/optcl_Install.tcl
deleted file mode 100644
index 0b04ace..0000000
--- a/install/optcl_Install.tcl
+++ /dev/null
@@ -1,88 +0,0 @@
-
-# OpTcl Installer
-# Author: Fuzz
-# fuzz@sys.uea.ac.uk
-
-package require registry
-
-set piccy ../docs/optcl_medium.gif
-
-set installfolder [file join [info library] .. optcl]
-set installname optcl.dll
-
-puts "Install dir: $installfolder"
-set version [info tclversion]
-
-if {$version < 8.0} {
- tk_messageBox -message "Sorry, but OpTcl needs Tcl version 8.0.5" -type ok
- exit
-} elseif {$version < 8.1} {
- set dll optcl80.dll
-} elseif {$version < 9.0} {
- set dll optclstubs.dll
-} else {
- tk_messageBox -message "Sorry, but OpTcl was compiled for Tcl major-version 8" -type ok
-}
-
-image create photo optclim -file $piccy
-
-proc updategui {} {
- global installfolder installname
- if [file exists [file join $installfolder $installname]] {
- .uninstall config -state normal
- .install config -text "Re-install for Tcl[info tclversion]"
- } else {
- .uninstall config -state disabled
- .install config -text "Install for Tcl[info tclversion]"
- }
-}
-
-proc install {} {
- global installfolder installname dll
- set answer [tk_messageBox -title {} -message "Okay to install $dll in $installfolder\nand register as OpTcl package?" -icon question -type yesno]
-
- switch $answer {
- no {}
- yes {
- set bad [catch {
- file mkdir $installfolder
- file copy -force $dll [file join $installfolder $installname]
- pkg_mkIndex -direct $installfolder
- } err]
- if {$bad} {
- tk_messageBox -type ok -message "Error: $err" -icon error
- } else {
- tk_messageBox -type ok -message "OpTcl successfully installed." -icon info
- }
- exit
- }
- }
-}
-
-proc uninstall {} {
- global installfolder installname
- set reply [tk_messageBox -type yesno -message "Delete package OpTcl located at $installfolder?" -icon question]
- if {[string compare $reply yes] != 0} return
- file delete [file join $installfolder $installname] [file join $installfolder pkgIndex.tcl] $installfolder
- updategui
-}
-
-wm title . "OpTcl Installer - F2 for console"
-bind . {console show}
-bind . {exit}
-
-label .im -image optclim -relief flat -bd 0
-button .install -text Install... -command install -width 16 -height 1 -bd 2 -font {arial 8 bold}
-button .uninstall -text Uninstall -command uninstall -width 16 -height 1 -bd 2 -font {arial 8 bold}
-button .quit -text Quit -command exit -bd 2 -font {arial 8 bold} -width 5 -height 1
-
-grid .im -column 0 -row 0 -rowspan 2 -padx 2 -pady 2
-grid .install -column 1 -row 0 -padx 2 -pady 2 -sticky nsew
-grid .uninstall -column 2 -row 0 -padx 2 -pady 2 -sticky nsew
-grid .quit -column 1 -row 1 -columnspan 2 -padx 2 -pady 2 -sticky nsew
-
-
-wm resizable . 0 0
-updategui
-raise .
-focus -force .
diff --git a/install/optclstubs.dll b/install/optclstubs.dll
deleted file mode 100644
index 516434b..0000000
Binary files a/install/optclstubs.dll and /dev/null differ
diff --git a/license.txt b/license.txt
new file mode 100644
index 0000000..363ea12
--- /dev/null
+++ b/license.txt
@@ -0,0 +1,38 @@
+This software is copyrighted by Farzad Pezeshkpour.
+The following terms apply to all files associated with the software
+unless explicitly disclaimed in individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute,
+and license this software and its documentation for any purpose, provided
+that existing copyright notices are retained in all copies and that this
+notice is included verbatim in any distributions. No written agreement,
+license, or royalty fee is required for any of the authorized uses.
+Modifications to this software may be copyrighted by their authors
+and need not follow the licensing terms described here, provided that
+the new terms are clearly indicated on the first page of each file where
+they apply.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+MODIFICATIONS.
+
+GOVERNMENT USE: If you are acquiring this software on behalf of the
+U.S. government, the Government shall have only "Restricted Rights"
+in the software and related documentation as defined in the Federal
+Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
+are acquiring the software on behalf of the Department of Defense, the
+software shall be classified as "Commercial Computer Software" and the
+Government shall have only "Restricted Rights" as defined in Clause
+252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
+authors grant the U.S. Government and others acting in its behalf
+permission to use and distribute the software in accordance with the
+terms specified in this license.
diff --git a/src/ComRecordInfoImpl.cpp b/src/ComRecordInfoImpl.cpp
new file mode 100644
index 0000000..d393911
--- /dev/null
+++ b/src/ComRecordInfoImpl.cpp
@@ -0,0 +1,1162 @@
+
+
+/*
+ *-------------------------------------------------------------------------
+ * ComRecordInfoImpl.cpp
+ * Implements an IRecordInfo, that unlike the one shipped by MS, isn't
+ * reliant on the presence of a GUID for any structure.
+ * Copyright (C) 2000 Farzad Pezeshkpour
+ *
+ * Email: fuzz@sys.uea.ac.uk
+ * Date: 6th April 2000
+ *
+ * Licence:
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *-------------------------------------------------------------------------
+ */
+
+
+
+#include "stdafx.h"
+#include
+#include
+#include "ComRecordInfoImpl.h"
+
+/*
+ *-------------------------------------------------------------------------
+ * Class CComRecordInfoImpl --
+ * Declaration of the class that implements the new IRecord Info.
+ *-------------------------------------------------------------------------
+ */
+class CComRecordInfoImpl :
+public CComObjectRoot, public IRecordInfo
+{
+public:
+ BEGIN_COM_MAP(CComRecordInfoImpl)
+ COM_INTERFACE_ENTRY(IRecordInfo)
+ END_COM_MAP()
+
+
+ CComRecordInfoImpl();
+ virtual ~CComRecordInfoImpl();
+
+ HRESULT SetTypeInfo (ITypeInfo *pti);
+ void FinalRelease ();
+
+ STDMETHOD(RecordInit)(PVOID pvNew);
+ STDMETHOD(RecordClear)(PVOID pvExisting);
+ STDMETHOD(RecordCopy)(PVOID pvExisting, PVOID pvNew);
+ STDMETHOD(GetGuid)(GUID *pguid);
+ STDMETHOD(GetName)(BSTR *pbstrName);
+ STDMETHOD(GetSize)(ULONG *pcbSize);
+ STDMETHOD(GetTypeInfo)(ITypeInfo * *ppTypeInfo);
+ STDMETHOD(GetField)(PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField);
+ STDMETHOD(GetFieldNoCopy)(PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField, PVOID *ppvDataCArray);
+ STDMETHOD(PutField)(ULONG wFlags, PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField);
+ STDMETHOD(PutFieldNoCopy)(ULONG wFlags, PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField);
+ STDMETHOD(GetFieldNames)(ULONG *pcNames, BSTR *rgBstrNames);
+ BOOL STDMETHODCALLTYPE IsMatchingType(IRecordInfo *pRecordInfo);
+ PVOID STDMETHODCALLTYPE RecordCreate(void);
+ STDMETHOD(RecordCreateCopy)(PVOID pvSource, PVOID *ppvDest);
+ STDMETHOD(RecordDestroy)(PVOID pvRecord);
+
+protected:
+ STDMETHODIMP GetFieldNoCopy(PVOID pvData, VARDESC *pvd, VARIANT *pvarField, PVOID *ppvDataCArray);
+ STDMETHODIMP PutFieldNoCopy(ULONG wFlags, PVOID pvData, VARDESC *pvd, VARIANT *pvarField);
+protected:
+ void ReleaseTypeAttr ();
+
+protected:
+ CComPtr m_pti; // type info we're implementing
+ TYPEATTR * m_pta; // type attribute for the type
+ CComBSTR m_name; // name of the this record type
+};
+
+
+
+/*
+ *-------------------------------------------------------------------------
+ * Class: CVarDesc
+ * Implements a wrapper for the VARDESC data type, and its retrieval from
+ * an ITypeInfo interface pointer.
+ *-------------------------------------------------------------------------
+ */
+class CVarDesc {
+protected:
+ CComPtr m_pti; // reference to the ITypeInfo parent of the VARDESC
+public:
+ VARDESC * m_pvd; // the vardesc itself
+public:
+ // constructor / destructor
+ CVarDesc () : m_pvd(NULL) {}
+
+ virtual ~CVarDesc () {
+ Release();
+ }
+
+
+ // operator overloads to make this object look more like a VARDESC...
+
+ // pointer de-reference
+ VARDESC * operator-> () {
+ ATLASSERT (m_pvd != NULL);
+ return m_pvd;
+ }
+
+ // castin operator
+ operator VARDESC* () {
+ ATLASSERT (m_pvd != NULL);
+ return m_pvd;
+ }
+
+ /*
+ *-------------------------------------------------------------------------
+ * Release --
+ * Releases the VARDESC if it has been allocated.
+ * Releases reference to the ITypeInfo.
+ *
+ * Result:
+ * None.
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+ void Release () {
+ if (m_pvd != NULL) {
+ ATLASSERT(m_pti != NULL);
+ m_pti->ReleaseVarDesc(m_pvd);
+ m_pti.Release();
+ m_pvd = NULL;
+ }
+ }
+
+
+ /*
+ *-------------------------------------------------------------------------
+ * Set --
+ * Sets the VARDESC based on an index into the ITypeInfo parameter.
+ *
+ * Result:
+ * S_OK iff succeeded.
+ *
+ * Side Effects:
+ * Any previous VARDESC is released.
+ *-------------------------------------------------------------------------
+ */
+ HRESULT Set (ITypeInfo *pti, ULONG index) {
+ Release();
+ m_pti = pti;
+ HRESULT hr;
+ hr = m_pti->GetVarDesc (index, &m_pvd);
+ return hr;
+ }
+
+
+ /*
+ *-------------------------------------------------------------------------
+ * Set --
+ * Sets the VARDESC based on the variable name within the ITypeInfo parameter.
+ *
+ * Result:
+ * S_OK iff succeeded.
+ *
+ * Side Effects:
+ * Any previous VARDESC is released.
+ *-------------------------------------------------------------------------
+ */
+ HRESULT Set (ITypeInfo *pti, LPCOLESTR name) {
+ CComPtr ptc;
+ HRESULT hr;
+ hr = pti->GetTypeComp (&ptc);
+ if (FAILED(hr))
+ return hr;
+ CComPtr pti2;
+ DESCKIND dk;
+ BINDPTR bp;
+ hr = ptc->Bind ((LPOLESTR)name, 0, INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF, &pti2, &dk, &bp);
+ if (FAILED(hr))
+ return hr;
+ if (dk != DESCKIND_VARDESC) {
+ ReleaseBindPtr(dk, bp);
+ return E_FAIL;
+ } else {
+ Release();
+ m_pvd = bp.lpvardesc;
+ m_pti = pti;
+ return S_OK;
+ }
+ }
+
+
+private:
+ /*
+ *-------------------------------------------------------------------------
+ * ReleaseBindPtr --
+ * Releases the bind ptr according to its type.
+ *
+ * Result:
+ * None.
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+ void ReleaseBindPtr (DESCKIND dk, BINDPTR bp) {
+ if (bp.lptcomp == NULL)
+ return;
+
+ switch (dk) {
+ case DESCKIND_FUNCDESC:
+ m_pti->ReleaseFuncDesc(bp.lpfuncdesc);
+ break;
+ case DESCKIND_TYPECOMP:
+ bp.lptcomp->Release();
+ break;
+ default:
+ ATLASSERT(FALSE);
+ break;
+ }
+ }
+};
+
+
+//------------------ IRecordInfo Implementation ---------------------------
+
+
+/*
+ *-------------------------------------------------------------------------
+ * GetRecordInfoFromTypeInfo2 --
+ * Creates a valid IRecordInfo interface for the give ITypeInfo interface.
+ * The only criteria is that the type info must be of the type TKIND_RECORD
+ * The type info does not have to provide a GUID.
+ *
+ * Result:
+ * S_OK iff successful.
+ *
+ * Side Effects:
+ * A CComRecordInfo object is created on the heap.
+ *
+ *-------------------------------------------------------------------------
+ */
+HRESULT GetRecordInfoFromTypeInfo2 (ITypeInfo *pti, IRecordInfo **ppri)
+{
+ ATLASSERT (pti != NULL && ppri != NULL);
+ CComObject *pri = NULL;
+ CComPtr ptmpri;
+ HRESULT hr = CComObject::CreateInstance (&pri);
+ if (FAILED (hr))
+ return hr;
+ hr = pri->QueryInterface (&ptmpri);
+ if (FAILED(hr))
+ return hr;
+ hr = pri->SetTypeInfo (pti);
+ if (FAILED (hr))
+ return hr;
+ return ptmpri.CopyTo(ppri);
+}
+
+
+
+
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CComRecordInfoImpl::CComRecordInfoImpl() : m_pta(NULL)
+{
+
+}
+
+CComRecordInfoImpl::~CComRecordInfoImpl()
+{
+
+}
+
+/*
+ *-------------------------------------------------------------------------
+ * FinalRelease --
+ * Called by the ATL framework when the object is about to be destroyed.
+ *
+ * Result:
+ * None.
+ *
+ * Side Effects:
+ * Releases the TYPEATTR for this Record Info.
+ *-------------------------------------------------------------------------
+ */
+void CComRecordInfoImpl::FinalRelease () {
+ ReleaseTypeAttr();
+}
+
+
+/*
+ *-------------------------------------------------------------------------
+ * SetTypeInfo --
+ * Sets the current TypeInfo that this RecordInfo is implementing.
+ *
+ * Result:
+ * S_OK iff successful.
+ *
+ * Side Effects:
+ * Releases any previous type info reference and attributes.
+ *
+ *-------------------------------------------------------------------------
+ */
+HRESULT CComRecordInfoImpl::SetTypeInfo (ITypeInfo *pti)
+{
+ TYPEATTR *pta = NULL;
+ // retrieve the type attribute for the
+ try {
+ if (FAILED(pti->GetTypeAttr(&pta)))
+ throw false;
+ if (pta->typekind != TKIND_RECORD)
+ throw false;
+ ReleaseTypeAttr();
+ m_pti = pti;
+ m_pta = pta;
+ pti->GetDocumentation(-1, &m_name, NULL, NULL, NULL);
+ return S_OK;
+ } catch (...) {
+ if (pta != NULL)
+ pti->ReleaseTypeAttr(pta);
+ return E_INVALIDARG;
+ }
+}
+
+/*
+ *-------------------------------------------------------------------------
+ * ReleaseTypeAttr --
+ * Releases the TYPEATTR if any.
+ *
+ * Result:
+ * None.
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+void CComRecordInfoImpl::ReleaseTypeAttr ()
+{
+ ATLASSERT (m_pta == NULL || m_pti != NULL);
+
+ if (m_pta != NULL && m_pti != NULL) {
+ m_pti->ReleaseTypeAttr(m_pta);
+ m_pta = NULL;
+ }
+}
+
+
+
+
+
+
+/*
+ *-------------------------------------------------------------------------
+ * RecordInit --
+ * Initiliases the contents of a created record structure. All existing
+ * values are ignored.
+ *
+ * Result:
+ * S_OK iff successfull.
+ *
+ * Side Effects:
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+STDMETHODIMP CComRecordInfoImpl::RecordInit(PVOID pvNew)
+{
+ HRESULT hr;
+ for (WORD iVar = 0; iVar < m_pta->cVars; iVar++) {
+
+ CVarDesc vd;
+ PVOID pvField;
+ CComPtr pRefInfo;
+ CComPtr pRefRecInfo;
+
+
+ hr = vd.Set(m_pti, iVar);
+ if (FAILED(hr))
+ return hr;
+ ATLASSERT ( (vd->elemdescVar.tdesc.vt & VT_BYREF) == NULL);
+
+
+ pvField = (BYTE*)pvNew + vd->oInst;
+
+
+ switch (vd->elemdescVar.tdesc.vt) {
+ case VT_USERDEFINED:
+ hr = m_pti->GetRefTypeInfo(vd->elemdescVar.tdesc.hreftype, &pRefInfo);
+ if (FAILED(hr)) return hr;
+
+ hr = GetRecordInfoFromTypeInfo2 (pRefInfo, &pRefRecInfo);
+ if (FAILED(hr)) return hr;
+
+ hr = pRefRecInfo->RecordInit(pvField);
+ if (FAILED(hr))
+ return hr;
+ break;
+
+ case VT_BSTR:
+ // is this correct?
+ *((BSTR*)pvField) = SysAllocString (L"");
+ break;
+
+ case VT_DATE:
+ *((DATE*)pvField) = 0;
+ break;
+
+ case VT_CY:
+ ((CY*)pvField)->int64 = 0;
+ break;
+
+ // generic 8bit data types
+ case VT_I1:
+ case VT_UI1:
+ *((BYTE*)pvField) = 0;
+ break;
+
+ // generic 16bit data types
+ case VT_I2:
+ case VT_UI2:
+ *((SHORT*)pvField) = 0;
+ break;
+
+ // generic 32 bit data types
+ case VT_I4:
+ case VT_UI4:
+ case VT_R4:
+ case VT_UNKNOWN:
+ case VT_DISPATCH:
+ case VT_ERROR:
+ *((ULONG*)pvField) = 0;
+ break;
+
+ // platform specific: INT
+ case VT_INT:
+ case VT_UINT:
+ *((INT*)pvField) = 0;
+ break;
+
+ // boolean
+ case VT_BOOL:
+ *((VARIANT_BOOL*)pvField) = VARIANT_FALSE;
+ break;
+
+ // double
+ case VT_R8:
+ *((DOUBLE*)pvField) = double(0);
+ break;
+
+ default:
+ // is it an array?
+ if (vd->elemdescVar.tdesc.vt & VT_ARRAY) {
+ *((SAFEARRAY**)pvField) = NULL;
+ }
+ }
+
+ }
+ return S_OK;
+}
+
+
+
+
+/*
+ *-------------------------------------------------------------------------
+ * CComRecordInfoImpl::RecordClear --
+ * Iterates through the existing record, clearing all referenced resources,
+ * and setting to zero.
+ *
+ * Result:
+ * Standard COM result.
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+STDMETHODIMP CComRecordInfoImpl::RecordClear(PVOID pvExisting)
+{
+ HRESULT hr;
+ for (WORD iVar = 0; iVar < m_pta->cVars; iVar++) {
+
+ CVarDesc vd;
+ PVOID pvField;
+ CComPtr pRefInfo;
+ CComPtr pRefRecInfo;
+
+
+ hr = vd.Set(m_pti, iVar);
+ if (FAILED(hr))
+ return hr;
+ ATLASSERT ( (vd->elemdescVar.tdesc.vt & VT_BYREF) == NULL);
+
+ pvField = (BYTE*)pvExisting + vd->oInst;
+
+ if (vd->elemdescVar.tdesc.vt & VT_ARRAY) {
+ SafeArrayDestroy (*((SAFEARRAY**)pvField));
+ *((SAFEARRAY**)pvField) = NULL;
+ } else {
+ switch (vd->elemdescVar.tdesc.vt) {
+ case VT_USERDEFINED:
+ hr = m_pti->GetRefTypeInfo(vd->elemdescVar.tdesc.hreftype, &pRefInfo);
+ if (FAILED(hr)) return hr;
+
+ hr = GetRecordInfoFromTypeInfo2 (pRefInfo, &pRefRecInfo);
+ if (FAILED(hr)) return hr;
+
+ hr = pRefRecInfo->RecordClear(pvField);
+ if (FAILED(hr))
+ return hr;
+ break;
+ /* strings */
+ case VT_BSTR:
+ SysFreeString(*( (BSTR*)pvField ));
+ *( (BSTR*)pvField ) = NULL;
+ break;
+ /* interface types */
+ case VT_DISPATCH:
+ case VT_UNKNOWN:
+ (*((IUnknown**)pvField))->Release();
+ (*((IUnknown**)pvField)) = NULL;
+ break;
+ }
+ }
+ }
+ return S_OK;
+}
+
+
+/*
+ *-------------------------------------------------------------------------
+ * CComRecordInfoImpl::RecordCopy --
+ * Makes a copy of the existing record to the new record.
+ *
+ * Result:
+ * Standard COM result.
+ *
+ * Side Effects:
+ * Performs a deep copy on all references.
+ *-------------------------------------------------------------------------
+ */
+STDMETHODIMP CComRecordInfoImpl::RecordCopy(PVOID pvExisting, PVOID pvNew)
+{
+ HRESULT hr;
+ for (WORD iVar = 0; iVar < m_pta->cVars; iVar++) {
+ PVOID pvSrc, pvDst;
+ CVarDesc vd;
+ CComPtr refInfo;
+ CComPtr refrecInfo;
+
+ hr = vd.Set (m_pti, iVar);
+ if (FAILED(hr)) return hr;
+
+ pvSrc = (BYTE*)pvExisting + vd->oInst;
+ pvDst = (BYTE*)pvNew + vd->oInst;
+
+ ATLASSERT ( (vd->elemdescVar.tdesc.vt & VT_BYREF) == 0);
+ if (vd->elemdescVar.tdesc.vt & VT_ARRAY != 0) {
+ hr = SafeArrayCopyData (*((SAFEARRAY**)pvSrc), *((SAFEARRAY**)pvDst));
+ if (FAILED(hr)) return hr;
+ } else {
+ switch (vd->elemdescVar.tdesc.vt) {
+ // interfaces ...
+ case VT_UNKNOWN:
+ case VT_DISPATCH:
+ *((IUnknown**)pvDst) = *((IUnknown**)pvSrc);
+ (*((IUnknown**)pvDst))->AddRef();
+ break;
+ // string
+ case VT_BSTR:
+ *((BSTR*)pvDst) = SysAllocString (*((BSTR*)pvSrc));
+ break;
+ // 8 bit copy
+ case VT_I1:
+ case VT_UI1:
+ *((BYTE*)pvDst) = *((BYTE*)pvSrc);
+ break;
+ // 16 bit copy
+ case VT_I2:
+ case VT_UI2:
+ *((SHORT*)pvDst) = *((SHORT*)pvSrc);
+ break;
+ // 32 bit copy
+ case VT_I4:
+ case VT_UI4:
+ case VT_R4:
+ case VT_ERROR:
+ *((ULONG*)pvDst) = *((ULONG*)pvSrc);
+ break;
+ // doubles (64 bit)
+ case VT_R8:
+ *((DOUBLE*)pvDst) = *((DOUBLE*)pvSrc);
+ break;
+ // currency
+ case VT_CY:
+ *((CY*)pvDst) = *((CY*)pvSrc);
+ break;
+ // date
+ case VT_DATE:
+ *((DATE*)pvDst) = *((DATE*)pvSrc);
+ break;
+ // boolean
+ case VT_BOOL:
+ *((VARIANT_BOOL*)pvDst) = *((VARIANT_BOOL*)pvSrc);
+ break;
+ // decimal
+ case VT_DECIMAL:
+ *((DECIMAL*)pvDst) = *((DECIMAL*)pvSrc);
+ break;
+ // TypeLib defined
+ case VT_USERDEFINED:
+ hr = m_pti->GetRefTypeInfo(vd->elemdescVar.tdesc.hreftype, &refInfo);
+ if (FAILED(hr)) return hr;
+ hr = GetRecordInfoFromTypeInfo2 (m_pti, &refrecInfo);
+ if (FAILED(hr)) return hr;
+ hr = refrecInfo->RecordCopy (pvSrc, pvDst);
+ if (FAILED(hr)) return hr;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ return S_OK;
+}
+
+
+/*
+ *-------------------------------------------------------------------------
+ * CComRecordInfoImpl::GetGuid --
+ * Retrieve GUID of struct. Can possibly be IID_NULL.
+ *
+ * Result:
+ * S_OK
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+STDMETHODIMP CComRecordInfoImpl::GetGuid(GUID *pguid)
+{
+ *pguid = m_pta->guid;
+ return S_OK;
+}
+
+
+/*
+ *-------------------------------------------------------------------------
+ * CComRecordInfoImpl::GetName --
+ * Retrieve the name of the structure.
+ *
+ * Result:
+ * S_OK;
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+STDMETHODIMP CComRecordInfoImpl::GetName(BSTR *pbstrName)
+{
+ *pbstrName = m_name.Copy();
+ return (pbstrName!=NULL?S_OK:E_FAIL);
+}
+
+
+/*
+ *-------------------------------------------------------------------------
+ * CComRecordInfoImpl::GetSize --
+ * Retrieve the size, in bytes of the structure.
+ *
+ * Result:
+ * None.
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+STDMETHODIMP CComRecordInfoImpl::GetSize(ULONG *pcbSize)
+{
+ ATLASSERT (m_pta != NULL);
+ *pcbSize = m_pta->cbSizeInstance;
+ return S_OK;
+}
+
+
+/*
+ *-------------------------------------------------------------------------
+ * CComRecordInfoImpl::GetTypeInfo --
+ * Retrieve ITypeInfo for this structure.
+ *
+ * Result:
+ * S_OK iff all ok.
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+STDMETHODIMP CComRecordInfoImpl::GetTypeInfo(ITypeInfo **ppTypeInfo)
+{
+ ATLASSERT(m_pti != NULL);
+ return m_pti.CopyTo(ppTypeInfo);
+}
+
+
+/*
+ *-------------------------------------------------------------------------
+ * CComRecordInfoImpl::GetField --
+ * Retrieve the value of a given field within a structure of this type
+ * The value of the field is returned as a copy of the original.
+ * Result:
+ *
+ * Side Effects:
+ *
+ *-------------------------------------------------------------------------
+ */
+STDMETHODIMP CComRecordInfoImpl::GetField(PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField)
+{
+ VARIANT refVar;
+ PVOID pvFieldData;
+ HRESULT hr;
+
+ VariantInit (&refVar);
+ VariantClear(pvarField);
+
+ hr = GetFieldNoCopy (pvData, szFieldName, &refVar, &pvFieldData);
+ if (FAILED(hr))
+ return hr;
+ hr = VariantCopyInd(pvarField, &refVar);
+ return hr;
+}
+
+
+/*
+ *-------------------------------------------------------------------------
+ * CComRecordInfoImpl::GetFieldNoCopy --
+ * Retrieve a direct reference to the field's value using a VARDESC to identify the
+ * field. The caller must not free the returned variant.
+ *
+ * Result:
+ * S_OK iff ok.
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+STDMETHODIMP CComRecordInfoImpl::GetFieldNoCopy(PVOID pvData, VARDESC *pvd, VARIANT *pvarField, PVOID *ppvDataCArray) {
+ HRESULT hr;
+ hr = VariantClear (pvarField);
+ if (FAILED(hr)) return hr;
+
+ // retrieve a pointer to the field data
+ PVOID pfield;
+ pfield = ( ((BYTE*)pvData) + pvd->oInst);
+ *ppvDataCArray = pfield;
+
+ // now crack the field type ...
+
+ // first some assertions ...
+ // not by-reference (COM Automation / Variant Declaration rules)
+ ATLASSERT ( (pvd->elemdescVar.tdesc.vt & VT_BYREF) == 0);
+
+ if (pvd->elemdescVar.tdesc.vt == VT_USERDEFINED) {
+ // resolve the referenced type
+ CComPtr pRefInfo;
+ CComPtr pRefRecInfo;
+ hr = m_pti->GetRefTypeInfo (pvd->elemdescVar.tdesc.hreftype, &pRefInfo);
+ if (FAILED(hr))
+ return hr;
+ hr = GetRecordInfoFromTypeInfo2 (pRefInfo, &pRefRecInfo);
+ if (FAILED(hr))
+ return hr;
+
+ // set the field reference and its record info
+ pvarField->pvRecord = pfield;
+ hr = pRefRecInfo.CopyTo(&(pvarField->pRecInfo));
+ if (FAILED(hr))
+ return hr;
+ pvarField->vt = VT_RECORD;
+ } else {
+ // in all other cases, we just set the pointer to the field member
+ pvarField->byref = pfield;
+ // the vartype of the resulting parameter will be a reference to the type of the field
+ pvarField->vt = (pvd->elemdescVar.tdesc.vt | VT_BYREF);
+ }
+ return S_OK;
+
+}
+
+
+/*
+ *-------------------------------------------------------------------------
+ * CComRecordInfoImpl::GetFieldNoCopy --
+ * Retrieve the value of a field as a reference, given the name of the field.
+ *
+ * Result:
+ * S_OK iff ok.
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+STDMETHODIMP CComRecordInfoImpl::GetFieldNoCopy(PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField, PVOID *ppvDataCArray)
+{
+ HRESULT hr;
+ CVarDesc vd;
+
+ hr = vd.Set(m_pti, szFieldName);
+ if (FAILED(hr)) return hr;
+
+ hr = VariantClear (pvarField);
+ if (FAILED(hr)) return hr;
+ return GetFieldNoCopy (pvData, vd, pvarField, ppvDataCArray);
+}
+
+
+/*
+ *-------------------------------------------------------------------------
+ * CComRecordInfoImpl::PutField --
+ * Places a copy of the variant to the field, applying any type coercion
+ * as required. Rules for INVOKE_PROPERTYPUT are handled at a deeper
+ * level of call.
+ *
+ * Result:
+ * S_OK iff all ok.
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+STDMETHODIMP CComRecordInfoImpl::PutField(ULONG wFlags, PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField)
+{
+ CVarDesc vd;
+ HRESULT hr;
+ hr = vd.Set(m_pti, szFieldName);
+ if (FAILED(hr)) return hr;
+
+ VARIANT varCopy;
+ VariantInit (&varCopy);
+ hr = VariantCopy (&varCopy, pvarField);
+ if (FAILED(hr)) return hr;
+ return PutFieldNoCopy (wFlags, pvData, vd, &varCopy);
+}
+
+/*
+ *-------------------------------------------------------------------------
+ * CComRecordInfoImpl::PutFieldNoCopy --
+ * Given the VARDESC for a field, this function places the value in
+ * pvarField to the field, without allocating any new resources.
+ * I'm not too sure about the INVOKE_PROPERTYPUT implementation
+ * which I've tried to follow from the MSDN documentation. As
+ * far as I can make out, the field must be of type VT_DISPATCH
+ * (or do I have to explicitly check for derivation from IDispatch?)
+ * The value is either of type VT_DISPATCH (in which case it's default
+ * property is used as the actual value), or any other valid variant
+ * sub-type. The actual value will be set to the default property of
+ * the field.
+ *
+ * Result:
+ * Standard COM result - S_OK iff all OK.
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+STDMETHODIMP CComRecordInfoImpl::PutFieldNoCopy(ULONG wFlags, PVOID pvData, VARDESC *pvd, VARIANT *pvarField)
+{
+ PVOID field = (BYTE*)pvData + pvd->oInst;
+ HRESULT hr;
+
+ // perform the conversion ...
+
+ if (wFlags == INVOKE_PROPERTYPUT) {
+
+ // if the field isn't a dispatch object or is null then we fail
+ if (pvd->elemdescVar.tdesc.vt != VT_DISPATCH)
+ return E_FAIL;
+
+ IDispatch * pdisp = *((IDispatch**)field);
+ if (pdisp == NULL)
+ return E_FAIL;
+
+ CComVariant varResult;
+ DISPPARAMS dp;
+ DISPID dispidNamed = DISPID_PROPERTYPUT;
+ dp.cArgs = 1;
+ dp.cNamedArgs = 1;
+ dp.rgdispidNamedArgs = &dispidNamed;
+ dp.rgvarg = pvarField;
+ hr = pdisp->Invoke (DISPID_VALUE, IID_NULL, 0, DISPID_PROPERTYPUT, &dp, &varResult, NULL, NULL);
+ return hr;
+ } else {
+ // do a straight conversion
+ hr = VariantChangeType (pvarField, pvarField, NULL, pvd->elemdescVar.tdesc.vt);
+ if (FAILED(hr))
+ return hr;
+
+ // now perform a shallow copy
+ if (pvd->elemdescVar.tdesc.vt & VT_ARRAY != 0) {
+ *((SAFEARRAY**)field) = pvarField->parray;
+ } else {
+ switch (pvd->elemdescVar.tdesc.vt) {
+ // interfaces ...
+ case VT_UNKNOWN:
+ case VT_DISPATCH:
+ *((IUnknown**)field) = pvarField->punkVal;
+ break;
+ // string
+ case VT_BSTR:
+ *((BSTR*)field) = pvarField->bstrVal;
+ break;
+ // 8 bit copy
+ case VT_I1:
+ case VT_UI1:
+ *((BYTE*)field) = pvarField->bVal;
+ break;
+ // 16 bit copy
+ case VT_I2:
+ case VT_UI2:
+ *((SHORT*)field) = pvarField->iVal;
+ break;
+ // 32 bit copy
+ case VT_I4:
+ case VT_UI4:
+ case VT_R4:
+ case VT_ERROR:
+ *((ULONG*)field) = pvarField->ulVal;
+ break;
+ // doubles (64 bit)
+ case VT_R8:
+ *((DOUBLE*)field) = pvarField->dblVal;
+ break;
+ // currency
+ case VT_CY:
+ *((CY*)field) = pvarField->cyVal;
+ break;
+ // date
+ case VT_DATE:
+ *((DATE*)field) = pvarField->date;
+ break;
+ // boolean
+ case VT_BOOL:
+ *((VARIANT_BOOL*)field) = pvarField->boolVal;
+ break;
+ // decimal
+ case VT_DECIMAL:
+ *((DECIMAL*)field) = pvarField->decVal;
+ break;
+ // TypeLib defined
+ case VT_USERDEFINED:
+ *((PVOID*)field) = pvarField->pvRecord;
+ break;
+ default:
+ break;
+ }
+ }
+ return S_OK;
+ }
+
+}
+
+
+/*
+ *-------------------------------------------------------------------------
+ * CComRecordInfoImpl::PutFieldNoCopy --
+ * As the VARDESC variation above, but using the field name instead.
+ *
+ * Result:
+ * S_O iff all ok.
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+STDMETHODIMP CComRecordInfoImpl::PutFieldNoCopy(ULONG wFlags, PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField)
+{
+ CVarDesc vd;
+ HRESULT hr;
+ hr = vd.Set(m_pti, szFieldName);
+ if (FAILED(hr)) return hr;
+ return PutFieldNoCopy (wFlags, pvData, vd, pvarField);
+}
+
+
+/*
+ *-------------------------------------------------------------------------
+ * CComRecordInfoImpl::GetFieldNames --
+ * Retrieves an array of fields names.
+ *
+ * Result:
+ * S_OK iff all ok.
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+STDMETHODIMP CComRecordInfoImpl::GetFieldNames(ULONG *pcNames, BSTR *rgBstrNames)
+{
+ ULONG index = 0;
+ if (pcNames == NULL)
+ return E_INVALIDARG;
+ if (rgBstrNames == NULL) {
+ *pcNames = m_pta->cVars;
+ return S_OK;
+ }
+
+ if (*pcNames > m_pta->cVars)
+ *pcNames = m_pta->cVars;
+
+ try {
+ for (index = 0; index < *pcNames; index++) {
+ CVarDesc vd;
+ HRESULT hr;
+ hr = vd.Set (m_pti, index);
+ if (FAILED(hr))
+ throw (hr);
+
+ UINT dummy = 1;
+ hr = m_pti->GetNames (vd->memid, rgBstrNames+index, 1, &dummy);
+ if (FAILED(hr))
+ throw(hr);
+ }
+ } catch (HRESULT hr) {
+ while (index > 0)
+ SysFreeString (rgBstrNames[--index]);
+ return hr;
+ }
+ return S_OK;
+}
+
+
+/*
+ *-------------------------------------------------------------------------
+ * CComRecordInfoImpl::IsMatchingType --
+ * Checks for equivalence of this record type and the one referenced by
+ * the only parameter. Because we can't guarantee the use of GUIDs
+ * I've settled for matching on the type and library name.
+ *
+ * Result:
+ * TRUE iff the record structures match.
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+BOOL STDMETHODCALLTYPE CComRecordInfoImpl::IsMatchingType(IRecordInfo *pRecordInfo)
+{
+ BOOL result = FALSE;
+ CComBSTR bstrOtherName;
+ HRESULT hr;
+
+ hr = pRecordInfo->GetName(&bstrOtherName);
+ if (FAILED(hr)) return FALSE;
+
+ if (wcscmp(bstrOtherName, m_name) == 0) {
+ CComPtr pOtherInfo;
+ CComPtr pOurLib, pOtherLib;
+ UINT dummy;
+ TLIBATTR * pOurAttr = NULL, *pOtherAttr = NULL;
+
+ hr = pRecordInfo->GetTypeInfo(&pOtherInfo);
+ if (FAILED (hr)) return FALSE;
+
+ hr = pOtherInfo->GetContainingTypeLib(&pOtherLib, &dummy);
+ if (FAILED(hr)) return FALSE;
+
+ hr = m_pti->GetContainingTypeLib(&pOurLib, &dummy);
+ if (FAILED(hr)) return FALSE;
+
+ hr = pOurLib->GetLibAttr (&pOurAttr);
+ hr = pOtherLib->GetLibAttr (&pOtherAttr);
+ if (pOurAttr != NULL && pOtherAttr != NULL)
+ result = (pOurAttr->guid == pOtherAttr->guid);
+ if (pOurAttr != NULL)
+ pOtherLib->ReleaseTLibAttr (pOurAttr);
+ if (pOtherAttr != NULL)
+ pOtherLib->ReleaseTLibAttr (pOtherAttr);
+ }
+ return result;
+}
+
+
+/*
+ *-------------------------------------------------------------------------
+ * STDMETHODCALLTYPE CComRecordInfoImpl::RecordCreate --
+ * Allocates (using the task memory allocator) a new record, and
+ * initialises it.
+ *
+ * Result:
+ * Pointer to the record structure iff successfull; else NULL.
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+PVOID STDMETHODCALLTYPE CComRecordInfoImpl::RecordCreate( void)
+{
+ PVOID prec = CoTaskMemAlloc(m_pta->cbSizeInstance);
+ if (FAILED(RecordInit(prec))) {
+ CoTaskMemFree(prec);
+ prec = NULL;
+ }
+ return prec;
+}
+
+
+/*
+ *-------------------------------------------------------------------------
+ * CComRecordInfoImpl::RecordCreateCopy --
+ * Creates a copy of the passed record structure.
+ *
+ * Result:
+ * S_OK iff successfull.
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+STDMETHODIMP CComRecordInfoImpl::RecordCreateCopy(PVOID pvSource, PVOID *ppvDest)
+{
+ *ppvDest = RecordCreate();
+ if (*ppvDest == NULL)
+ return E_FAIL;
+ return RecordCopy (pvSource, *ppvDest);
+}
+
+
+/*
+ *-------------------------------------------------------------------------
+ * CComRecordInfoImpl::RecordDestroy --
+ * Clears the given record and releases the memory associated with it.
+ *
+ * Result:
+ * S_OK iff all OK.
+ *
+ * Side Effects:
+ * None.
+ *-------------------------------------------------------------------------
+ */
+STDMETHODIMP CComRecordInfoImpl::RecordDestroy(PVOID pvRecord)
+{
+ HRESULT hr;
+ if (pvRecord) {
+ hr = RecordClear(pvRecord);
+ CoTaskMemFree(pvRecord);
+ }
+ return hr;
+}
+
diff --git a/src/ComRecordInfoImpl.h b/src/ComRecordInfoImpl.h
new file mode 100644
index 0000000..78a3798
--- /dev/null
+++ b/src/ComRecordInfoImpl.h
@@ -0,0 +1,61 @@
+
+
+/*
+ *-------------------------------------------------------------------------
+ * ComRecordInfoImpl.h
+ * Declares a IRecordInfo, that unlike the one shipped by MS, isn't
+ * reliant on the presence of a GUID for any structure.
+ *
+ * Copyright (C) 2000 Farzad Pezeshkpour
+ * Email: fuzz@sys.uea.ac.uk
+ * Date: 6th April 2000
+ *
+ * How-To: 1) Add both this file and ComRecordInfoImpl.cpp to your project
+ * 2) Include this file where-ever you wish to access a structure
+ * using IRecordInfo.
+ * 3) Call GetRecordInfoFromTypeInfo2 instead of
+ * GetRecordInfoFromTypeInfo to retrieve an IRecordInfo.
+ * Licence:
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *-------------------------------------------------------------------------
+ */
+
+
+
+
+#if !defined(AFX_COMRECORDINFOIMPL_H__B3BDEDA0_FB84_11D3_9D8A_DFFCB467E034__INCLUDED_)
+#define AFX_COMRECORDINFOIMPL_H__B3BDEDA0_FB84_11D3_9D8A_DFFCB467E034__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+/*
+ *-------------------------------------------------------------------------
+ * GetRecordInfoFromTypeInfo2 --
+ * This is a replacement for GetRecordInfoFromTypeInfo. It returns an
+ * instance of the new IRecordInfo.
+ *
+ * Result:
+ * Standard COM result. S_OK iff all ok.
+ *
+ * Side Effects:
+ * Memory allocated for the new object implementing IRecordInfo.
+ *-------------------------------------------------------------------------
+ */
+HRESULT GetRecordInfoFromTypeInfo2 (ITypeInfo *pti, IRecordInfo **ppri);
+
+#endif // !defined(AFX_COMRECORDINFOIMPL_H__B3BDEDA0_FB84_11D3_9D8A_DFFCB467E034__INCLUDED_)
diff --git a/src/EventBinding.cpp b/src/EventBinding.cpp
index d8a12bd..af64f1a 100644
--- a/src/EventBinding.cpp
+++ b/src/EventBinding.cpp
@@ -537,7 +537,7 @@ int BindingProps::Eval (OptclObj *pObj, DISPPARAMS *pDispParams, LPVARIANT pVarR
for (count = 0; count < pDispParams->cArgs; count++)
{
TObjPtr param;
- if (!var2obj(m_pInterp, pDispParams->rgvarg[pDispParams->cArgs - count - 1], param, ppObjs+count))
+ if (!var2obj(m_pInterp, pDispParams->rgvarg[pDispParams->cArgs - count - 1], NULL, param, ppObjs+count))
break;
cmd.lappend(param, m_pInterp);
}
@@ -567,7 +567,7 @@ int BindingProps::Eval (OptclObj *pObj, DISPPARAMS *pDispParams, LPVARIANT pVarR
if (result == TCL_ERROR)
{
- // do we have a exception storage
+ // do we have an exception storage
if (pExcepInfo != NULL)
{
// fill it in
diff --git a/src/FixedSplitter.tcl b/src/FixedSplitter.tcl
new file mode 100644
index 0000000..6bed3ae
--- /dev/null
+++ b/src/FixedSplitter.tcl
@@ -0,0 +1,24 @@
+
+namespace eval FixedSplitter {
+ variable properties
+ proc _getState {w} {
+ uplevel {
+ variable properties
+ }
+ }
+ proc create {w args} {
+ _getState $w
+
+ frame $w -width 200 -height 200 -relief sunken -bd 1
+
+ set properties($w-orient) horizontal
+ set properties($w-fixed) A
+ set properties($w-windowA) {}
+ set properties($w-windowB) {}
+ set properties($w-barwidth) 8
+ set properties($w-fixedsize) 100
+
+ return $w
+ }
+
+}
\ No newline at end of file
diff --git a/src/ImageListBox.tcl b/src/ImageListBox.tcl
new file mode 100644
index 0000000..3f3921f
--- /dev/null
+++ b/src/ImageListBox.tcl
@@ -0,0 +1,335 @@
+proc ImageListBox {args} {
+ return [eval ImageListBox::create $args]
+}
+
+namespace eval ImageListBox {
+ variable properties
+ array set properties {}
+
+ proc _getState {w} {
+ uplevel {variable properties}
+ }
+
+ proc create {w args} {
+ _getState $w
+ text $w -bd 0 -relief flat -width 30 -height 15 -state disabled -cursor arrow -wrap none
+ set properties($w-item) {}
+ set properties($w-nextId) 0
+ set properties($w-active) 0
+ set properties($w-anchor) 0
+ set properties($w-selectmode) browse
+ set properties($w-uiselection) 0
+
+ $w tag configure ILB_Selection -background SystemHighlight -foreground SystemHighlightText
+ set font [$w cget -font]
+ $w tag configure ILB_Active -foreground red
+
+ setBindings $w
+ rename ::$w [namespace current]::$w
+ proc ::$w {cmd args} "return \[eval [namespace current]::_dispatch $w \$cmd \$args\]"
+
+ eval $w configure $args
+ return $w
+ }
+
+ proc setBindings {w} {
+ foreach binding [bind Text] {
+ bind $w $binding "break;"
+ }
+
+ foreach binding [bind Listbox] {
+ bind $w $binding "[bind Listbox $binding];break;"
+ }
+
+ # special bindings
+ bind $w "[namespace current]::OnBeginUISelection $w; [bind Listbox ]; break;"
+ bind $w "[namespace current]::OnEndUISelection $w; [bind Listbox ]; break;"
+ return
+ }
+
+ proc _dispatch {w cmd args} {
+ _getState $w
+ set cmds [info commands [namespace current]::$cmd*]
+ if {$cmds == {}} {
+ return [eval $w $cmd $args]
+ } else {
+ return [eval [lindex $cmds 0] $w $args]
+ }
+ }
+
+
+
+ proc insert {w index args} {
+ _getState $w
+
+ set bEnd [string match $index end]
+ if {!$bEnd} {
+ incr index
+ } else {
+ set index [expr int([$w index end])]
+ }
+
+ $w config -state normal
+ foreach item $args {
+ $w image create $index.0 -align center -name _ILB_IMAGE_$properties($w-nextId)
+ $w insert $index.1 $item\n
+ $w tag add _ILB_TAG_$properties($w-nextId) $index.0 $index.end
+
+ incr properties($w-nextId)
+ incr index
+ }
+ $w config -state disabled
+ }
+
+ proc setimage {w index image} {
+ _getState $w
+ set index [index $w $index]
+ if {$index >= [index $w end]} {
+ set index [expr [index $w end] - 1]
+ }
+ set pos [expr $index + 1].0
+ $w image configure $pos -image $image
+ }
+
+ proc getimage {w index} {
+ _getState $w
+ set index [index $w $index]
+ set pos [expr $index + 1].0
+ $w image cget $pos -image
+ }
+
+ proc delete {w first {last {}} } {
+ _getState $w
+
+ if {$last == {}} {
+ set last $first
+ }
+ set first [index $w $first]
+ set last [index $w $last]
+
+ incr first
+ incr last 2
+ $w config -state normal
+ $w delete $first.0 $last.0
+ $w config -state disabled
+ }
+
+ proc size {w} {
+ _getState $w
+ return [expr int([$w index end]) - 2]
+ }
+
+ proc get {w first {last {}} } {
+ _getState $w
+ if {$last == {}} {
+ set last $first
+ }
+ set first [index $w $first]
+ set last [index $w $last]
+ if { [catch {
+ incr first
+ incr last
+ } ]} {
+ return {}
+ }
+ set result {}
+ while {$first <= $last} {
+ lappend result [$w get $first.0 $first.end]
+ incr first
+ }
+ return $result
+ }
+
+ proc selection {w cmd args} {
+ _getState $w
+ switch -- $cmd {
+ clear {
+ eval _selectClear $w $args
+ }
+ includes {
+ eval _selectIncludes $w $args
+ }
+ set {
+ eval _selectSet $w $args
+ }
+ anchor {
+ eval _selectAnchor $w $args
+ }
+ default {error "unknown selection command: $cmd"}
+ }
+ }
+
+
+ proc _selectAnchor {w index} {
+ _getState $w
+ set properties($w-anchor) [index $w $index]
+ }
+
+ proc _selectClear {w first {last {}} } {
+
+ if {$last == {}} {
+ set last $first
+ }
+ set first [index $w $first]
+ set last [index $w $last]
+
+ incr first;
+ incr last
+
+ while {$first <= $last} {
+ $w tag remove ILB_Selection $first.0 [incr first].0
+ }
+ }
+
+ proc _selectSet {w args} {
+ _getState $w
+ $w tag remove ILB_Selection 1.0 end
+
+ foreach index $args {
+ set index [index $w $index]
+ if {$index < [size $w]} {
+ $w tag add ILB_Selection [incr index].0 [incr index].0
+ }
+ }
+
+ if {!$properties($w-uiselection)} {
+ event generate $w <