Prepare source files for merge

This commit is contained in:
2014-12-07 09:44:25 +00:00
parent f0204690cc
commit e2eae0eac4
174 changed files with 0 additions and 22635 deletions

View File

@@ -1,17 +0,0 @@
jacob.dll
jacob.jar
jacobdll.jar
*.zip
RELEASE.txt
.project
.cproject
.classpath
compilation_tools.properties
version.properties
release
.externalToolBuilders
.cdtproject
foo.foo
foo.ser
JacobVersion.properties
.settings

View File

@@ -1,504 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
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 and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, 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 library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete 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 distribute a copy of this License along with the
Library.
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 Library or any portion
of it, thus forming a work based on the Library, 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) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
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 Library, 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 Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you 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.
If distribution of 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 satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be 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.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library 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.
9. 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 Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
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 with
this License.
11. 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 Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library 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 Library.
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.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library 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.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser 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 Library
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 Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
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
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "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
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. 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 LIBRARY 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
LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. 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 library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@@ -1,897 +0,0 @@
Manifest-Version: 1.0
Name: ./com/jacob/activeX/ActiveXComponent.class
Digest-Algorithms: SHA MD5
SHA-Digest: qqewKW8c2W7aSvB4Ob/bMbCPeFI=
MD5-Digest: EZs0WpbDBV5Id5XRw2tbtg==
Name: ./com/jacob/activeX/ActiveXComponent.java
Digest-Algorithms: SHA MD5
SHA-Digest: IeJoOZ9U4LtHuqyqJGKG24nDTYw=
MD5-Digest: Qqf2RAOc0xBTG8dGIyA2+w==
Name: ./com/jacob/com/ComException.class
Digest-Algorithms: SHA MD5
SHA-Digest: fuWzbhsBKLBjPtk5pvgVzskMFz4=
MD5-Digest: vwLlwRM/J9NYONB/UVw1AA==
Name: ./com/jacob/com/ComException.java
Digest-Algorithms: SHA MD5
SHA-Digest: 9HsO+/DGzYdZtFDK+Yi6SyEo29I=
MD5-Digest: tHiTxIfngQHjEXPzVC31pA==
Name: ./com/jacob/com/ComFailException.class
Digest-Algorithms: SHA MD5
SHA-Digest: dghV0kFmeXaebK73wRAyBNZsfeM=
MD5-Digest: EmfTcOZd7lFdNX+ZZIGufA==
Name: ./com/jacob/com/ComFailException.java
Digest-Algorithms: SHA MD5
SHA-Digest: yIS8kOUyyl2ymTHxb/8Za4ktjsw=
MD5-Digest: sdqsHsk9p4XXX5kfvQOQNg==
Name: ./com/jacob/com/ComThread.class
Digest-Algorithms: SHA MD5
SHA-Digest: J+KEmDJYSMA2VXg8smZpLFQYAuc=
MD5-Digest: wnPiLbEgp7GC4sMVsQ1eWg==
Name: ./com/jacob/com/ComThread.java
Digest-Algorithms: SHA MD5
SHA-Digest: q0K2wuQ+be8Qrrai/Ui1BTMeFeo=
MD5-Digest: eH6GkFkD3A3PrX1cZJWr6w==
Name: ./com/jacob/com/Dispatch.class
Digest-Algorithms: SHA MD5
SHA-Digest: tYSc84+VUMMWYt7hrLDtcnINNUI=
MD5-Digest: etVQxCE1JEN1rYCc5ZA79A==
Name: ./com/jacob/com/Dispatch.java
Digest-Algorithms: SHA MD5
SHA-Digest: Q95eP1KW/Z/ICzzeaNDCFUIG408=
MD5-Digest: IovIOD5G/XY7qFAHViNeng==
Name: ./com/jacob/com/DispatchEvents.class
Digest-Algorithms: SHA MD5
SHA-Digest: 7cgrmVJc18T/hRvT3931tQzVa5s=
MD5-Digest: CtihQf0ka9OChKX+OnKucQ==
Name: ./com/jacob/com/DispatchEvents.java
Digest-Algorithms: SHA MD5
SHA-Digest: 5MwAZmktJFp7rq23Lz/VG1/ULk4=
MD5-Digest: 2haKHCBa7UXfl8HCSPEyQQ==
Name: ./com/jacob/com/DispatchProxy.class
Digest-Algorithms: SHA MD5
SHA-Digest: xDGCGyw+8G/kxFFOQtQo3rbhDN8=
MD5-Digest: +5n2WPrM0Jj0FauyuctPMQ==
Name: ./com/jacob/com/DispatchProxy.java
Digest-Algorithms: SHA MD5
SHA-Digest: 4NGdFabt0CZL8y56A1x/AEat6/o=
MD5-Digest: Wd9zhjmACcUxZ3gqdWtB2w==
Name: ./com/jacob/com/EnumVariant.class
Digest-Algorithms: SHA MD5
SHA-Digest: ft/EfZ1xwI/J07yz6oxla2jKZFM=
MD5-Digest: zRYy+0tuDsAQ7SCOJxgx5A==
Name: ./com/jacob/com/EnumVariant.java
Digest-Algorithms: SHA MD5
SHA-Digest: 3biekksAd50gb6GRfpefO2PpS6c=
MD5-Digest: zlu6oH2HFI//sGTexAv9GQ==
Name: ./com/jacob/com/JacobObject.class
Digest-Algorithms: SHA MD5
SHA-Digest: 9uw+e0Wxha1A6tp6PFQE1JMJkvQ=
MD5-Digest: D37EFI7kTv9NEnsyQcsXsA==
Name: ./com/jacob/com/JacobObject.java
Digest-Algorithms: SHA MD5
SHA-Digest: TqJDUM7Ujxt5/zAGSG9uCoKcJ4U=
MD5-Digest: oD0tL8WPPCN3jF59jfd/yA==
Name: ./com/jacob/com/MainSTA.class
Digest-Algorithms: SHA MD5
SHA-Digest: 3WKAHdSq2yTa/lqHgyOTo6vqvnk=
MD5-Digest: h0kY/3xCUs0uCyhWUL+DWQ==
Name: ./com/jacob/com/MainSTA.java
Digest-Algorithms: SHA MD5
SHA-Digest: pDIgNuK9H9KhKQEZIMIgM44nDo8=
MD5-Digest: p/CDI6V3KgdOViQQ6/oR0g==
Name: ./com/jacob/com/ROT.class
Digest-Algorithms: SHA MD5
SHA-Digest: bEQuGPBbOn8HlXMmcLQCRh0BlYs=
MD5-Digest: rCXiBlficXaJbCoFMCeoJg==
Name: ./com/jacob/com/ROT.java
Digest-Algorithms: SHA MD5
SHA-Digest: K6WVkJuFZNjgow/o4/1pTyKu2Tk=
MD5-Digest: eOCwqvCPVk+haZ7WFzEJOg==
Name: ./com/jacob/com/SafeArray.class
Digest-Algorithms: SHA MD5
SHA-Digest: AIqtFq0miAVrMUY0HZUnXuhl284=
MD5-Digest: TiPLaOJAMTzTVP2a2AsX0A==
Name: ./com/jacob/com/SafeArray.java
Digest-Algorithms: SHA MD5
SHA-Digest: CGBlCL952tC//MTG+XxqSOQh/hI=
MD5-Digest: pf25bH4uo0LZOzz7utDa8Q==
Name: ./com/jacob/com/STA.class
Digest-Algorithms: SHA MD5
SHA-Digest: 6cqSEZm+8kVkAO4Vnc5G04qCrCE=
MD5-Digest: 7O16Je2NaryCebJZ28U20A==
Name: ./com/jacob/com/STA.java
Digest-Algorithms: SHA MD5
SHA-Digest: S0EbhtSPEAv9fGOaTNBymxmZthM=
MD5-Digest: 9fcj8YmMFCCfB8M5eF7lPA==
Name: ./com/jacob/com/Variant.class
Digest-Algorithms: SHA MD5
SHA-Digest: ea5nat308Pg7cxcJdywpqL++HiM=
MD5-Digest: 6/TukZAwtC9UOUArjcpTXg==
Name: ./com/jacob/com/Variant.java
Digest-Algorithms: SHA MD5
SHA-Digest: psnbnw0M+2egeuqpbf2u1C7I/EY=
MD5-Digest: iuuq5W1sFXeT269RJC7U6w==
Name: ./com/jacob/com/WrongThreadException.class
Digest-Algorithms: SHA MD5
SHA-Digest: 55DxaZjMfzYE9MTCKZ8VPgpjVLc=
MD5-Digest: 9uygPT4WdJg8N6Yo/t0tkA==
Name: ./com/jacob/com/WrongThreadException.java
Digest-Algorithms: SHA MD5
SHA-Digest: PPQzELKIkTeQJfGTBUfUonPdSnc=
MD5-Digest: bNwuGE+cW1Z9+pWnI3r/Bg==
Name: ./jacob.dll
Digest-Algorithms: SHA MD5
SHA-Digest: 3LlRg0frUqmTW8HjSXm2tGZi9og=
MD5-Digest: MgUWKEmjKUX4hFTLoSyeCA==
Name: ./jacob.jar
Digest-Algorithms: SHA MD5
SHA-Digest: xLY8bhITrVUd+Ft+++piDVNh+lc=
MD5-Digest: 5MOSXL4nEeEAdO40bNd3oA==
Name: ./JacobComLifetime.html
Digest-Algorithms: SHA MD5
SHA-Digest: uGRYLP2xhOaPGbunFQ7cxZcUvaw=
MD5-Digest: 3RU8RW+2/liuGpkyYbTPHg==
Name: ./jacobSrc_18.zip
Digest-Algorithms: SHA MD5
SHA-Digest: 2jmj7l5rSw0yVb/vlWAYkK/YBwk=
MD5-Digest: 1B2M2Y8AsgTpgAmY7PhCfg==
Name: ./JacobThreading.html
Digest-Algorithms: SHA MD5
SHA-Digest: IQs2MYpplp8guNE7nFWcnsEJLt8=
MD5-Digest: MuRQ3uXcEMeB5msQ/oYyTQ==
Name: ./jni/ComThread.cpp
Digest-Algorithms: SHA MD5
SHA-Digest: pfEIKsR11Doq3+Dmwpyf6tscRCY=
MD5-Digest: RDG15eEa+FxZtSmn1sadSg==
Name: ./jni/ComThread.h
Digest-Algorithms: SHA MD5
SHA-Digest: JtBBBpPcOqjBm4o10ui48TOgkps=
MD5-Digest: z3ocf5BOusRSSdB8madNlA==
Name: ./jni/ComThread.obj
Digest-Algorithms: SHA MD5
SHA-Digest: Z05DKyL+S6GI3w0GhhkoeWRS+Ss=
MD5-Digest: wUSJQhroulYl2cZ+eLnu7Q==
Name: ./jni/Dispatch.cpp
Digest-Algorithms: SHA MD5
SHA-Digest: FH0YWD3RyD9CR1fHkGiIzJLh0tk=
MD5-Digest: VAjOj5ZPrBCbqvd15um09w==
Name: ./jni/Dispatch.h
Digest-Algorithms: SHA MD5
SHA-Digest: N74Cx8buqtuTUkLbg604pgcRGmE=
MD5-Digest: bX1snnEyrNBwexgVNtasCg==
Name: ./jni/Dispatch.obj
Digest-Algorithms: SHA MD5
SHA-Digest: saxklkHmLIdMVLdKj4vmYRtBHVo=
MD5-Digest: 0Y6c1VfYLJuQWlm6MI9UuA==
Name: ./jni/DispatchEvents.cpp
Digest-Algorithms: SHA MD5
SHA-Digest: UHLjKXAwbPlVN8hQoexl38jv1lM=
MD5-Digest: lL07d5A5AIxqphOxetIiLg==
Name: ./jni/DispatchEvents.h
Digest-Algorithms: SHA MD5
SHA-Digest: VKWhIhXOim7LLhyLGJclVlkilfI=
MD5-Digest: s4huR7K3gZu5qfQQTTRcGg==
Name: ./jni/DispatchEvents.obj
Digest-Algorithms: SHA MD5
SHA-Digest: 0I3opm1/14UCERfLZqUkoAnqObI=
MD5-Digest: Kd6mTsrifhRCmOT2rUkLHw==
Name: ./jni/DispatchProxy.cpp
Digest-Algorithms: SHA MD5
SHA-Digest: sEo5fo91hMQ0k+XVaZk5TCkC0NM=
MD5-Digest: tsX0rWU+eL5pKaBRhANZIw==
Name: ./jni/DispatchProxy.h
Digest-Algorithms: SHA MD5
SHA-Digest: FCqZSwrPy5rOPWeiioNcxz9ooj8=
MD5-Digest: IfhrIzu/elu0CFTU/+FH0A==
Name: ./jni/DispatchProxy.obj
Digest-Algorithms: SHA MD5
SHA-Digest: yN/dtGG4um+SuuQrTo5+1uLSiiY=
MD5-Digest: FTdU29Tt31Zr+v/uF+Exlg==
Name: ./jni/EnumVariant.cpp
Digest-Algorithms: SHA MD5
SHA-Digest: UqE3XEqyuSOqCey9y6NtgO56vlk=
MD5-Digest: MjoER1irRaeyqAouQJLnaw==
Name: ./jni/EnumVariant.h
Digest-Algorithms: SHA MD5
SHA-Digest: rHJQr1J+8v4371BuFvhLifmyXRg=
MD5-Digest: 0ShO6APjAlzrxpL1VHtp4Q==
Name: ./jni/EnumVariant.obj
Digest-Algorithms: SHA MD5
SHA-Digest: SBD1O7LN4s4xoYdYX8HMutBkIno=
MD5-Digest: q05v4Kbf3xXr6TTKFSJh+g==
Name: ./jni/EventProxy.cpp
Digest-Algorithms: SHA MD5
SHA-Digest: tQM4T5PxwKGiWIe7WAr7OUCZn88=
MD5-Digest: xH3pvJqZW5utS9K2jPDkog==
Name: ./jni/EventProxy.h
Digest-Algorithms: SHA MD5
SHA-Digest: 25r17CcIBLdEIoHXKp65NyTmVQk=
MD5-Digest: 2CpIIkRfJSfZQpkvpbBenQ==
Name: ./jni/EventProxy.obj
Digest-Algorithms: SHA MD5
SHA-Digest: gShJkleKBewW8MrzUC0/XvRQWNw=
MD5-Digest: zpim8NXVV7RfD/xk2mJW6w==
Name: ./jni/jacob.dll
Digest-Algorithms: SHA MD5
SHA-Digest: 3LlRg0frUqmTW8HjSXm2tGZi9og=
MD5-Digest: MgUWKEmjKUX4hFTLoSyeCA==
Name: ./jni/jacob.exp
Digest-Algorithms: SHA MD5
SHA-Digest: 72e/gQTKiE1r9Uslz4vYRQ0PHmQ=
MD5-Digest: 5mklGz6sCKSgVrjey6YL5g==
Name: ./jni/jacob.lib
Digest-Algorithms: SHA MD5
SHA-Digest: m8ZbuTExo3Un0O7MWBc5o9WJ6g8=
MD5-Digest: ybxMyVrwSNUnuhbGLQnYkw==
Name: ./jni/makefile
Digest-Algorithms: SHA MD5
SHA-Digest: n/Ol9YQ2klBEFhF8C7gM37Q85go=
MD5-Digest: 5gkJFwMCbAAZAEyb/OWKPw==
Name: ./jni/README.txt
Digest-Algorithms: SHA MD5
SHA-Digest: lHYa7laejzkdRZkjyk5hh01Nh70=
MD5-Digest: 6YannUlp3XpNr7bZP6i5Bg==
Name: ./jni/SafeArray.cpp
Digest-Algorithms: SHA MD5
SHA-Digest: +u64HvTcLPDEuGHsH7ydYMNmROI=
MD5-Digest: 1C3cuqY05UZF4Kh28Vc3Bw==
Name: ./jni/SafeArray.h
Digest-Algorithms: SHA MD5
SHA-Digest: g5KEynNNTCV/0+TtLSrgtBGIVB8=
MD5-Digest: W6TK/CsQYfRRrCsn1vlf8A==
Name: ./jni/SafeArray.obj
Digest-Algorithms: SHA MD5
SHA-Digest: HcWyMrmnhyYxKsIO8GfrtEFgHC0=
MD5-Digest: saSZ5dtWYxMPDzN6svD+lg==
Name: ./jni/STA.cpp
Digest-Algorithms: SHA MD5
SHA-Digest: nEJ3iujtVaHY41S00J/KQSp6MTc=
MD5-Digest: N3O7B829ib75rCZgY1lifw==
Name: ./jni/STA.h
Digest-Algorithms: SHA MD5
SHA-Digest: +VwuhNMGYzZ9aGjZX/YPppDdO1A=
MD5-Digest: G+RltDyKn4lfuOR9XSQxUA==
Name: ./jni/STA.obj
Digest-Algorithms: SHA MD5
SHA-Digest: KUDmvPyX3TI/FlQlk/7NLmZVHZs=
MD5-Digest: kBJEBoZm/30B9aHP7jAxhg==
Name: ./jni/StdAfx.cpp
Digest-Algorithms: SHA MD5
SHA-Digest: QXk1fqHJAYChd8X7CH73V6EJqgU=
MD5-Digest: rkapC0u6Da9N3BzEShh5uA==
Name: ./jni/StdAfx.h
Digest-Algorithms: SHA MD5
SHA-Digest: i9b1viSLE73TdBRHyEYqCQnHdok=
MD5-Digest: O9mOBXwgjNSj0cF5bibF3g==
Name: ./jni/stdafx.obj
Digest-Algorithms: SHA MD5
SHA-Digest: WY6n8VAjHD+D+8yfca65Lv2Yanc=
MD5-Digest: 1ZNNwyP06I7kkDqF1oWmYA==
Name: ./jni/util.cpp
Digest-Algorithms: SHA MD5
SHA-Digest: svps5GbrBIhBersEfXdVDaRxwdM=
MD5-Digest: V3cYxfy/UdMYgPE4LU2jQw==
Name: ./jni/util.h
Digest-Algorithms: SHA MD5
SHA-Digest: If9oIOxyhA0rL44GJlLkrc1IDPg=
MD5-Digest: A7UlJkDnsxJEKCtn6G1UOw==
Name: ./jni/util.obj
Digest-Algorithms: SHA MD5
SHA-Digest: Eycr3pdkbM6wpCusv6ppEtXavQQ=
MD5-Digest: HiuPDNWBFDdn7X4DutL/mw==
Name: ./jni/Variant.cpp
Digest-Algorithms: SHA MD5
SHA-Digest: ZVW7VPsmlHWKjuTpZKs08XlS320=
MD5-Digest: faCR0N6dP5W+bxzgvblpsA==
Name: ./jni/Variant.h
Digest-Algorithms: SHA MD5
SHA-Digest: xEKVgKNM1RnfDIKpP01mHj+3SqU=
MD5-Digest: jeRydyEBbi2E+WLhuKANIg==
Name: ./jni/Variant.obj
Digest-Algorithms: SHA MD5
SHA-Digest: VkpRSFzVd3DOh5l14/Ohhf3+FBM=
MD5-Digest: 0A4By2V6SdUdFYoNaELkSA==
Name: ./LICENSE.TXT
Digest-Algorithms: SHA MD5
SHA-Digest: f6pMV3+4WoA2adisGIy1Rax2W8o=
MD5-Digest: fCYjCTNV8MYNNuW3i2aTFw==
Name: ./makefile
Digest-Algorithms: SHA MD5
SHA-Digest: 8fbp+qFE+YwIwHcapQbHKyq6QE8=
MD5-Digest: /37LTLMPhiaLolS1X1k1HQ==
Name: ./README.TXT
Digest-Algorithms: SHA MD5
SHA-Digest: NCWTHs86RAcfK917rbotr81sExc=
MD5-Digest: +KTt8W0TCJsei2AxVFpQFQ==
Name: ./samples/ado/ADO_README.txt
Digest-Algorithms: SHA MD5
SHA-Digest: vyqm9URm65OyGqdOiWCuk67W94I=
MD5-Digest: gP7U0PwFXCXojgEkzzXYIg==
Name: ./samples/ado/Command.class
Digest-Algorithms: SHA MD5
SHA-Digest: VYX5u7DXdbMzqsFPgv5yox5adKs=
MD5-Digest: ZISCJalFcRGqxRX+172meg==
Name: ./samples/ado/Command.java
Digest-Algorithms: SHA MD5
SHA-Digest: u/GPTs8U4XUh8qsXCYrkGpmAq58=
MD5-Digest: hru+Ns3kuh7ukNMEo7UYlw==
Name: ./samples/ado/CommandTypeEnum.class
Digest-Algorithms: SHA MD5
SHA-Digest: hegtG5C8KdUCTpjqfsU30otxd3Y=
MD5-Digest: aBVcQnMQtpARZsSJcrxoPg==
Name: ./samples/ado/CommandTypeEnum.java
Digest-Algorithms: SHA MD5
SHA-Digest: 7fa7uxQ9WMUFB6ms7rEi3nKyM/s=
MD5-Digest: Ey7VKrr+74MTFlyJRdK1WQ==
Name: ./samples/ado/Connection.class
Digest-Algorithms: SHA MD5
SHA-Digest: jmve106WOcmbLHhPKwQolgOEl0c=
MD5-Digest: TGjR6vuVVJkepeC8Bkx0Mw==
Name: ./samples/ado/Connection.java
Digest-Algorithms: SHA MD5
SHA-Digest: aIz0OGEkKM5qhfqGPDaizgSQH6o=
MD5-Digest: uKdIqNEb0fQW6/F54+ULyg==
Name: ./samples/ado/Field.class
Digest-Algorithms: SHA MD5
SHA-Digest: jxR9z2XYejS/LMekS66Slmc7/Wc=
MD5-Digest: sGuUfiZ0YbwCsSmI6mrHCQ==
Name: ./samples/ado/Field.java
Digest-Algorithms: SHA MD5
SHA-Digest: yXzIXtij0oGqhOpZViy+2GzMqgA=
MD5-Digest: gjaIquVdHvBcVczuTZjqMQ==
Name: ./samples/ado/Fields.class
Digest-Algorithms: SHA MD5
SHA-Digest: 1qWM9CqE5xj2nH7qFOJ6MGY8CjI=
MD5-Digest: 9rkQ0Cdn32mX+NkIr6JiQg==
Name: ./samples/ado/Fields.java
Digest-Algorithms: SHA MD5
SHA-Digest: blVsEdbjJxuW4X4jO9CWgQirOm4=
MD5-Digest: As+B/G3vm+k5pzQWXTAsdw==
Name: ./samples/ado/ms/README
Digest-Algorithms: SHA MD5
SHA-Digest: WYL+bmWW1nkqEGoOHgf4E5+80Lw=
MD5-Digest: VPd6NUQNQ5kJOgMbpyCd4A==
Name: ./samples/ado/ms/testms.class
Digest-Algorithms: SHA MD5
SHA-Digest: RoKESkqQJiR1k9PRG0VbhdjRChE=
MD5-Digest: GHy6MwcQVWfuBMTWFX3tdg==
Name: ./samples/ado/ms/testms.java
Digest-Algorithms: SHA MD5
SHA-Digest: GW9uXFNDW4pTPSjZHo2D5lFc/zU=
MD5-Digest: +6iJfY4I6HB/eA8LcgKB6A==
Name: ./samples/ado/Recordset.class
Digest-Algorithms: SHA MD5
SHA-Digest: 7DOBgOnKy6VMFm7V59fULgPEfio=
MD5-Digest: M5HhfmAKFb/b/C6csy69wA==
Name: ./samples/ado/Recordset.java
Digest-Algorithms: SHA MD5
SHA-Digest: WSFzf787gED6BkN3vSVGhXxb/XU=
MD5-Digest: aOk5BtJdTTJuJpGyWUpRIg==
Name: ./samples/ado/test.class
Digest-Algorithms: SHA MD5
SHA-Digest: AEXzmSw0nhniEgEgcHEqSAIY6cs=
MD5-Digest: nQp4MdGvsHDnkVG1CzDRrA==
Name: ./samples/ado/test.java
Digest-Algorithms: SHA MD5
SHA-Digest: u59LMxRc+XIhuM/vHtznkCLC0IE=
MD5-Digest: b4q8u/F+GYhyWIr1cM8EdA==
Name: ./samples/applet/AppTest.class
Digest-Algorithms: SHA MD5
SHA-Digest: n56Is99dBgC8tQ6K9IqwYnALkmI=
MD5-Digest: FdQ7a7vx1CXpNinMKQEveQ==
Name: ./samples/applet/AppTest.html
Digest-Algorithms: SHA MD5
SHA-Digest: 2pGYv1dUavvaMY+1b0hBhS9mv3Y=
MD5-Digest: rZWQxtKOziVCquj5M6GFFw==
Name: ./samples/applet/AppTest.java
Digest-Algorithms: SHA MD5
SHA-Digest: pC2PW5TpOHZuAYJGm9B1Od/BRw4=
MD5-Digest: qMKmotn7i7fzaPgoBD6gdQ==
Name: ./samples/README.txt
Digest-Algorithms: SHA MD5
SHA-Digest: 9kyVx/ey8MxEfF1HATrDZlg9Rxk=
MD5-Digest: gRXrNz3NEKFy7fasoujArg==
Name: ./samples/servlet/JacobScript.class
Digest-Algorithms: SHA MD5
SHA-Digest: NY4hemo3uGEIBCWTyyyzm7a0CzQ=
MD5-Digest: MUuHIxHh6F98jE0YH7P+bg==
Name: ./samples/servlet/JacobScript.java
Digest-Algorithms: SHA MD5
SHA-Digest: dvp/KSXGqV6gC2s9NPzTvAbm0uc=
MD5-Digest: JUP2vLcS7M4pe9uWJsIOWw==
Name: ./samples/servlet/readme.txt
Digest-Algorithms: SHA MD5
SHA-Digest: GE4VxwDk3uAEQDBvvWBoOe4KKXw=
MD5-Digest: 1MSy/NVW2EyTybpjuagEIQ==
Name: ./samples/test/Access.class
Digest-Algorithms: SHA MD5
SHA-Digest: YJ8ho+ID8ugfEDWCPxYbNoiNpsE=
MD5-Digest: QInWVJKkR9hjDynEpHjVOQ==
Name: ./samples/test/Access.java
Digest-Algorithms: SHA MD5
SHA-Digest: uqv9slXCqv98mTceAxd95Y7Vrh0=
MD5-Digest: fpK035MccuE2h/Z01omyOA==
Name: ./samples/test/atl/MultiFace/dlldata.c
Digest-Algorithms: SHA MD5
SHA-Digest: HWTbDhfSULe5RQibEUEI830BLuE=
MD5-Digest: 0+48R+h0ivE4WGRJFfPJDA==
Name: ./samples/test/atl/MultiFace/Face.cpp
Digest-Algorithms: SHA MD5
SHA-Digest: OhddW2y86e39z4U0TPDtqmB+MmA=
MD5-Digest: 4dTrCiRHhORZk4BnDf7z3w==
Name: ./samples/test/atl/MultiFace/Face.h
Digest-Algorithms: SHA MD5
SHA-Digest: y0gekndtQPP58IyEFliYdG37qns=
MD5-Digest: GTxFB6uT1X5vEGI0WcrL/Q==
Name: ./samples/test/atl/MultiFace/Face.rgs
Digest-Algorithms: SHA MD5
SHA-Digest: F8u+qbVSCFIKnUMKvvy5UYQ+HLs=
MD5-Digest: S4ANAdXVLXbCPN2x7uD5pQ==
Name: ./samples/test/atl/MultiFace/MultiFace.aps
Digest-Algorithms: SHA MD5
SHA-Digest: lQbTvrX5Vvm9994+oYa+l9zCrMI=
MD5-Digest: u2p9rqJFCAD8E0y/GBYa9w==
Name: ./samples/test/atl/MultiFace/MultiFace.cpp
Digest-Algorithms: SHA MD5
SHA-Digest: k3Fh0X2Zf2P5HFYX0XBC3cr8F8U=
MD5-Digest: dgadf5J+z2FmRkZrARoVhw==
Name: ./samples/test/atl/MultiFace/MultiFace.def
Digest-Algorithms: SHA MD5
SHA-Digest: 2LcCcz80Nw99Cplvy56LVfKj4AQ=
MD5-Digest: u/wev8ycCsOtBXjq4koWsA==
Name: ./samples/test/atl/MultiFace/MultiFace.dsp
Digest-Algorithms: SHA MD5
SHA-Digest: EP934454nHfECg4uMbMpi2qSiBg=
MD5-Digest: BpITlBALRWf1UnbtvqJ1tw==
Name: ./samples/test/atl/MultiFace/MultiFace.dsw
Digest-Algorithms: SHA MD5
SHA-Digest: HPkFe3R5aG/7zdtwSpPIvCoJrX8=
MD5-Digest: JwOWHmGnfAJWodLnqiA4ig==
Name: ./samples/test/atl/MultiFace/MultiFace.h
Digest-Algorithms: SHA MD5
SHA-Digest: NzYDi990PqhD0pyW/XswKUHiQGI=
MD5-Digest: I4SDltcfIyyBFfg71dSKoA==
Name: ./samples/test/atl/MultiFace/MultiFace.idl
Digest-Algorithms: SHA MD5
SHA-Digest: rE8NyFJgJFgoxHYEFJRFTwIGTjA=
MD5-Digest: Yf3mnqG5Jx/iSE5S/1N3QA==
Name: ./samples/test/atl/MultiFace/MultiFace.ncb
Digest-Algorithms: SHA MD5
SHA-Digest: 7GDt/Nx4jef09B5ACmv+1xqcQt4=
MD5-Digest: zyxbqfMC8PmDrMRA4VvVcA==
Name: ./samples/test/atl/MultiFace/MultiFace.opt
Digest-Algorithms: SHA MD5
SHA-Digest: 9KOiwG4QxIFaNgVtYosl9rn4F5Q=
MD5-Digest: Ai1X3ztSmyZneaivsOIhgA==
Name: ./samples/test/atl/MultiFace/MultiFace.plg
Digest-Algorithms: SHA MD5
SHA-Digest: GgHEYrPCgoTvQJbLVkGSucuJI84=
MD5-Digest: fzXVPatmqIW5BKWNn20x1w==
Name: ./samples/test/atl/MultiFace/MultiFace.rc
Digest-Algorithms: SHA MD5
SHA-Digest: cKcPvkLwFvr2SpNabMVU4LRCHQQ=
MD5-Digest: B81k6bAmMI8mY9pywHyQ9Q==
Name: ./samples/test/atl/MultiFace/MultiFace.tlb
Digest-Algorithms: SHA MD5
SHA-Digest: 45izBsDG1ouPhqTvH8IDPK9oNlY=
MD5-Digest: 5smfNJ6a5a/r3EBBmZN/Yw==
Name: ./samples/test/atl/MultiFace/MultiFaceps.def
Digest-Algorithms: SHA MD5
SHA-Digest: BZnsV6gPHLCjBY1gkyjg/SCOw+4=
MD5-Digest: nAyFg5jxyfxmfe2MD3C1vA==
Name: ./samples/test/atl/MultiFace/MultiFaceps.mk
Digest-Algorithms: SHA MD5
SHA-Digest: bJNeboLTRvXTAOuiiEboGEW6s/8=
MD5-Digest: L+Fei2KII1dnTm5Goszing==
Name: ./samples/test/atl/MultiFace/MultiFace_i.c
Digest-Algorithms: SHA MD5
SHA-Digest: L+orpCaMGOQ+onrBja2eUcqCkZg=
MD5-Digest: EMEes+f0GfZuWG1TY8iItg==
Name: ./samples/test/atl/MultiFace/MultiFace_p.c
Digest-Algorithms: SHA MD5
SHA-Digest: qhXfLrVwc3+a2zQh3nqfuMMXJj4=
MD5-Digest: PddZdwiG4GABL2pFOgRWjg==
Name: ./samples/test/atl/MultiFace/resource.h
Digest-Algorithms: SHA MD5
SHA-Digest: ltVpL0yIoPqNP533PfXz0Mz3or0=
MD5-Digest: 67snAuAXM2aTH3ZXCjkOsg==
Name: ./samples/test/atl/MultiFace/StdAfx.cpp
Digest-Algorithms: SHA MD5
SHA-Digest: rRcr4BUiUcSuC9HT6rQc5MToiHk=
MD5-Digest: I/3OLbvTOW7wzD1mshUuuQ==
Name: ./samples/test/atl/MultiFace/StdAfx.h
Digest-Algorithms: SHA MD5
SHA-Digest: q4qcVRmFU7LYISdjJeW4CgEE9Xg=
MD5-Digest: jPsHuOvPDPZYxq1xxcvLsg==
Name: ./samples/test/atl/MultiFace.class
Digest-Algorithms: SHA MD5
SHA-Digest: 68ZRr3nlrxp7xvgB8QtPLvBXkB0=
MD5-Digest: +E/sNJRVhdK9DvCHDKyeKA==
Name: ./samples/test/atl/MultiFace.java
Digest-Algorithms: SHA MD5
SHA-Digest: RD5SVQAbELsukdxLSrAlVraY5Rw=
MD5-Digest: O0/kAOqvz9Y1Gow65MmdJQ==
Name: ./samples/test/atl/readme.txt
Digest-Algorithms: SHA MD5
SHA-Digest: EHBHwONmkXMZLgpTRc6m8pORye0=
MD5-Digest: D+oj7h9BOskXCcBQuBSFdw==
Name: ./samples/test/DispatchTest.class
Digest-Algorithms: SHA MD5
SHA-Digest: b+R4oUyy/tugq7jgd+ZKEzqd5pI=
MD5-Digest: Uf5nmYcYZrCNk/YSYyUpcA==
Name: ./samples/test/DispatchTest.java
Digest-Algorithms: SHA MD5
SHA-Digest: W0BY50++uyVxEmDh8soynVg6lwI=
MD5-Digest: A6oIyzfJUCR1M6k3fQQz8Q==
Name: ./samples/test/errEvents.class
Digest-Algorithms: SHA MD5
SHA-Digest: EzYY0sXl18eP1HDctmCpgEWXxxI=
MD5-Digest: 2ZH6Pcx49W7FYL9aF1qiPQ==
Name: ./samples/test/foo.foo
Digest-Algorithms: SHA MD5
SHA-Digest: hKLRQFDind7Bt/el/UA0bOILVEc=
MD5-Digest: LfWLkubtUd37afJ4Ctu48A==
Name: ./samples/test/foo.ser
Digest-Algorithms: SHA MD5
SHA-Digest: lmeuI3I317iY2RKqZL40s3zMkZA=
MD5-Digest: D73llNfjRNWi6/yEfqjcZg==
Name: ./samples/test/IEEvents.class
Digest-Algorithms: SHA MD5
SHA-Digest: MzKjQ9LnBvcLGqb4eIoYX3pbWro=
MD5-Digest: rLvMvumb3zT+lmpnH12/0g==
Name: ./samples/test/IETest.class
Digest-Algorithms: SHA MD5
SHA-Digest: 7wOaFqd2TvqatunZ8cgjkuwvAmc=
MD5-Digest: +Jlit06yZxTmsaTAGLjR8A==
Name: ./samples/test/IETest.java
Digest-Algorithms: SHA MD5
SHA-Digest: t3BKHw/pqw5198/fE3ttMMBijbE=
MD5-Digest: oBRVGqLdSZSxD6Acpne9mA==
Name: ./samples/test/jacobtest.xls
Digest-Algorithms: SHA MD5
SHA-Digest: iPakwQbwO78iKOXAnKi7J1vzvEs=
MD5-Digest: n07pNBLHIG662l3KfsZWdg==
Name: ./samples/test/math.class
Digest-Algorithms: SHA MD5
SHA-Digest: Z4QCBzw8I8743G2bsANsMvYvQjU=
MD5-Digest: oAuf3ElYdBR3Lmrq0+d9Og==
Name: ./samples/test/math.java
Digest-Algorithms: SHA MD5
SHA-Digest: n8YiT1GFbeaWXLMy+INu2Wfl7/k=
MD5-Digest: h1G6CVTiAFjm7Re1f64NEA==
Name: ./samples/test/MathProj/Math.cls
Digest-Algorithms: SHA MD5
SHA-Digest: CZJcmhZCs1+1p4NO71dggowWNc8=
MD5-Digest: +gkN44UHyxn83JeQVf+E6Q==
Name: ./samples/test/MathProj/MathTest.dll
Digest-Algorithms: SHA MD5
SHA-Digest: hoUwAKBHCK55cn7JdsA3wBf/Bn0=
MD5-Digest: 3BcNgFO5perWuHx79V0mXg==
Name: ./samples/test/MathProj/MathTest.exp
Digest-Algorithms: SHA MD5
SHA-Digest: ff9RS0k+cu2JO360qYqMoA1oJuA=
MD5-Digest: FNmayjvq8mTjLcIUbX5Zkw==
Name: ./samples/test/MathProj/MathTest.lib
Digest-Algorithms: SHA MD5
SHA-Digest: 62KdZxK15c8CLHZXYnJxbrjuBIc=
MD5-Digest: Is8yCaURP4hrKCZbNWmW7Q==
Name: ./samples/test/MathProj/MathTest.vbp
Digest-Algorithms: SHA MD5
SHA-Digest: I/k59CxSo5KBb/Mj0zLXnB/gpDU=
MD5-Digest: Iil+Tidd/5EWFe5TnPwhiA==
Name: ./samples/test/MathProj/MathTest.vbw
Digest-Algorithms: SHA MD5
SHA-Digest: h3dc5rr6p7aV45U26F4DyFTJM7I=
MD5-Digest: LudpvbnfPRzD0GwfkSjRdg==
Name: ./samples/test/MathProj/README
Digest-Algorithms: SHA MD5
SHA-Digest: nPVI0dpp+w5yLvy/p9le2e4BwiY=
MD5-Digest: S8VlUENr3X79v9OFAUljyQ==
Name: ./samples/test/Outlook.class
Digest-Algorithms: SHA MD5
SHA-Digest: DbN+VE/zRE6P+R2qIph048KmCl8=
MD5-Digest: Sxs8kOpskGsoOpwnSJxX2g==
Name: ./samples/test/Outlook.java
Digest-Algorithms: SHA MD5
SHA-Digest: OBV8N5rPxKJliq2DSDxLlJe8+2c=
MD5-Digest: 1ZgPwE5lkgetta1TElh2Iw==
Name: ./samples/test/safearray.class
Digest-Algorithms: SHA MD5
SHA-Digest: C9m0td07CI3WCNqMvDgCReVBk4U=
MD5-Digest: 3sWM1BZ/M6XrqeIJCSnIfw==
Name: ./samples/test/safearray.java
Digest-Algorithms: SHA MD5
SHA-Digest: /F4AvsA0zZN/I7cJAr1sHRsw+Fc=
MD5-Digest: oKA2jfEuphjZf30RyxJsvQ==
Name: ./samples/test/sample2.mdb
Digest-Algorithms: SHA MD5
SHA-Digest: Wp2D73waAFiEmDPw8ji7q+jZgFQ=
MD5-Digest: ZKs2YBS5XVEK9iDtHnGUpw==
Name: ./samples/test/sa_dispatch.class
Digest-Algorithms: SHA MD5
SHA-Digest: nCuBxiPc21pt7CnmxD+TIV4x1FI=
MD5-Digest: IhuUwtw0m6RfONvXtqvSAw==
Name: ./samples/test/sa_dispatch.java
Digest-Algorithms: SHA MD5
SHA-Digest: tIIx4FMZGe7k6+GH4ajRoWPJvyY=
MD5-Digest: DWknkLquVVJKRyKYSfXSOA==
Name: ./samples/test/sa_test.class
Digest-Algorithms: SHA MD5
SHA-Digest: NhQ8ICD0BX3upJ3yhPox7D4OrYw=
MD5-Digest: 2J2GkyWd+qfgf7Fjs8JnwA==
Name: ./samples/test/sa_test.java
Digest-Algorithms: SHA MD5
SHA-Digest: R682jIXe76aB9kJyNM0wtbZqtxU=
MD5-Digest: qLpQzDlRNgHUMSNvW9F9Vw==
Name: ./samples/test/ScriptTest.bat
Digest-Algorithms: SHA MD5
SHA-Digest: bxoaT2EWQv5FYtCWB0e9T89wJ2c=
MD5-Digest: iQQJtrBB1MZ6ljtIXoqIxQ==
Name: ./samples/test/ScriptTest.class
Digest-Algorithms: SHA MD5
SHA-Digest: 9McitGPdEWuF+klNFu9Op2dcOuk=
MD5-Digest: SzDmf+iH5s/E1EmYPh208w==
Name: ./samples/test/ScriptTest.java
Digest-Algorithms: SHA MD5
SHA-Digest: yo2azi6j2xgIDKymZGO5l4FEdjE=
MD5-Digest: P/DSKEt74WRFIgJqRVHVtw==
Name: ./samples/test/ScriptTest2.class
Digest-Algorithms: SHA MD5
SHA-Digest: LktPbcouI60ec7wmvfmurGSFaT4=
MD5-Digest: OygfOlXJlkqn1x4TM8eI7g==
Name: ./samples/test/ScriptTest2.java
Digest-Algorithms: SHA MD5
SHA-Digest: HTrcf7IR3Og5i0xIw1mB7F4i0AY=
MD5-Digest: cyeOvZyeb0ZMjYFwAuCvRw==
Name: ./samples/test/ScriptTest3.class
Digest-Algorithms: SHA MD5
SHA-Digest: ZdD9Uar1kiYkiiOrOG5/Zs/gKHQ=
MD5-Digest: JP8N1C1bKhlZUzjNWjtfMw==
Name: ./samples/test/ScriptTest3.java
Digest-Algorithms: SHA MD5
SHA-Digest: Q0QxUzUMaIEUiuSiCYFDh8tPWzk=
MD5-Digest: 2JjocMlhddWcUXsKb3Arlw==
Name: ./samples/test/speed.class
Digest-Algorithms: SHA MD5
SHA-Digest: DdOhaT+V3Gz8lUFpTjkNHU8yUHI=
MD5-Digest: 10C0cOv36ugsmjtRdWiYeQ==
Name: ./samples/test/speed.java
Digest-Algorithms: SHA MD5
SHA-Digest: VRRtx5ebOKZ9w9i7zr5tjiGHtSA=
MD5-Digest: fW3+AiO4odk/dPP8QRwP7g==
Name: ./samples/test/test.class
Digest-Algorithms: SHA MD5
SHA-Digest: 0F3HoVHLRbxeIftBk5xSiayuruw=
MD5-Digest: xmgAS3ZMreVcVetw+Emz6w==
Name: ./samples/test/test.java
Digest-Algorithms: SHA MD5
SHA-Digest: fDgQ7roF5yECQWDgqE/H7hMS9lY=
MD5-Digest: C+R1qFuy0KYA6+NpE6lcMw==
Name: ./samples/test/testEvents.class
Digest-Algorithms: SHA MD5
SHA-Digest: VgQZMlTDKdXwHwnO+pg34FVxe+s=
MD5-Digest: pxOGqcHhcNCgpLrq961CYA==
Name: ./samples/test/variant_test.class
Digest-Algorithms: SHA MD5
SHA-Digest: rhCKxgFsnz4DCR3V6ZCnGZMKHNc=
MD5-Digest: U6IqRLGkVKIi6GYMVfQaJQ==
Name: ./samples/test/variant_test.java
Digest-Algorithms: SHA MD5
SHA-Digest: 7NFXoGskiCa/ZL7U8Acx/uZkdTE=
MD5-Digest: xPiJ1/PwMsYlUPlAiR+wkg==
Name: ./samples/test/varSerTest.class
Digest-Algorithms: SHA MD5
SHA-Digest: EyK1bvd0fQXevbJJfukQqFSTq+0=
MD5-Digest: ceVxF+Oz7CJF5whitqs7IA==
Name: ./samples/test/varSerTest.java
Digest-Algorithms: SHA MD5
SHA-Digest: 1kR1a6FqMGKYgazH8ZllBmTxWN4=
MD5-Digest: E+9UQHIkQN/XII2libkWXw==
Name: ./todo.txt
Digest-Algorithms: SHA MD5
SHA-Digest: GuE6XLByuSmPs4Q3TX8Qs2JRSro=
MD5-Digest: KtiB8O69ft5CCxNs+T9zZQ==
Name: ./vstudio/jacob/jacob.dsp
Digest-Algorithms: SHA MD5
SHA-Digest: nreCezgQ/DKa7TQ4Cj28cRzKQzM=
MD5-Digest: GOjDddOu1ZU5r0iGcEZzaw==
Name: ./vstudio/jacob/jacob.dsw
Digest-Algorithms: SHA MD5
SHA-Digest: yB8Hhn1M6jX7cOBloxUL2pAFf7Y=
MD5-Digest: hGWX78QoGIXxJed6eeTbAQ==
Name: ./vstudio/jacob/jacob.ncb
Digest-Algorithms: SHA MD5
SHA-Digest: xSDLS4QUbjm8RHNL/Qzq70zkYlk=
MD5-Digest: PK8cmkqwvTT9ECgqFhpdVQ==
Name: ./vstudio/jacob/jacob.opt
Digest-Algorithms: SHA MD5
SHA-Digest: ZI/dl8LS/Sp5vpLdODDNox8LfMc=
MD5-Digest: 90HtjVn8YtapmRMC9MAp0g==
Name: ./vstudio/jacob/jacob.plg
Digest-Algorithms: SHA MD5
SHA-Digest: 6D62etCgUdwooRVezsQCR5GG79M=
MD5-Digest: FEkATqvQLJeVQzpfboND4A==
Name: ./WhatsNew.html
Digest-Algorithms: SHA MD5
SHA-Digest: WZmYYAE5PedacDkqwqNPFlp4vSE=
MD5-Digest: WVceOUyV6DUWlncvAuqzpw==

View File

@@ -1,11 +0,0 @@
JACOB (Java-COM bridge) is hosted on Sourceforge http://sourceforge.net/project/jacob-project
Information about what's new in this release can be found in docs/ReleaseNotes.html
Instructions on building this project can be found in docs/HowToBuild.html
Detailed instructions on creating a build configuration file are in build.xml
Put the appropriate DLL for your platform into your runtime library path.
jacob for 32 bit windows is located in /x86.
There is no good usage guide at this time.

481
build.xml
View File

@@ -1,481 +0,0 @@
<?xml version="1.0"?>
<!-- ======================================================================
Ant build file for JACOB.
Created Feb 4, 2005 1:23:05 PM as part of migration from ANT
Last Modified March 24, 2007
Tested on Eclipse 3.3 with the Europa C++ plugins, Ant 1.7 and MS Visual C++ 8 (2005)
Eclipse users are pretty lucky because the whole project
can be built inside eclipse due to their built in ANT support.
The COM portion of this build requires MS Visual C++ 8.0. (2005)
The build proces defined in this build.xml file does not support
YOU MUST define a file named compilation_tools.properties!
The file for MS Visual C++ 8.0 building 32 and 64 bit
(releases up to 1.11 only supported 32 builds) looks something like:
JDK=c:\\dev\\jdk1.5.0_18
MSDEV_DIR=c:\\Program Files\\Microsoft Visual Studio 8\\VC
MSDEV_IDE_DIR=c:\\Program Files\\Microsoft Visual Studio 8\\Common7\\IDE
version=1.15-M1
DO NOT check compilation_tools.properties into source control as the
values are specific to YOUR environment.
The JacobVersion.properties file is now completely autogenerated
====================================================================== -->
<project name="jacob" default="default" basedir=".">
<!-- ======================================================================
First handle the properties that come from property files
Sets a default for properties that were not in the file.
Relies on the fact that properties cannot be reset once set.
================================================================== -->
<property file="compilation_tools.properties" />
<property environment="env"/>
<echo message="Number of Processors = ${env.NUMBER_OF_PROCESSORS}"/>
<property name="JDK" value="JDK not set in compilation_tools properties file"/>
<!-- MSDEV_DIR is a required parameter so set to a message if its not set -->
<property name="MSDEV_DIR" value="MSDEV_DIR not set in compilation_tools properties file"/>
<echo message="executing with MSDEV_DIR=${MSDEV_DIR}" />
<!-- ======================================================================
Now build up all the derived properties
================================================================== -->
<property name="application.title" value="JACOB : Java COM Bridge" />
<property name="application.vendor" value="http://jacob-project.sourceforge.net" />
<property name="src.java.mainpackage" value="com.jacob" />
<property name="java.class.main" value="com.jacob.com.Jacob" />
<property name="generated.filename.dll.x86" value="jacob-${version}-x86.dll" />
<property name="generated.filename.dll.x64" value="jacob-${version}-x64.dll" />
<property name="generated.filename.jar" value="jacob.jar" />
<property name="generated.filename.zip" value="jacob-${version}" />
<property name="generated.filename.version" value="JacobVersion.properties" />
<property name="junit.jar" value="${basedir}\lib\junit3.8.1\junit.jar" />
<property name="src.java.mainroot" value="${basedir}/src" />
<property name="src.java.samples" value="${basedir}/samples" />
<property name="src.java.unittest" value="${basedir}/unittest" />
<property name="src.cpp" value="${basedir}/jni" />
<property name="release.dir" value="${basedir}\release" />
<property name="release.dir.x86" value="${release.dir}\x86" />
<property name="release.dir.x86.cpp" value="${release.dir.x86}\jni" />
<property name="release.file.x86.dll" value="${release.dir.x86}\${generated.filename.dll.x86}" />
<property name="release.dir.x64" value="${release.dir}\x64" />
<property name="release.dir.x64.cpp" value="${release.dir.x64}\jni" />
<property name="release.file.x64.dll" value="${release.dir.x64}\${generated.filename.dll.x64}" />
<property name="release.dir.java" value="${release.dir}\java" />
<property name="release.dir.java.meta.inf" value="${release.dir.java}\META-INF" />
<property name="release.file.jar" value="${release.dir.java}\${generated.filename.jar}" />
<property name="compiler.x86" value="${MSDEV_DIR}\bin\cl.exe" />
<property name="linker.x86" value="${MSDEV_DIR}\bin\link.exe" />
<property name="manifestool.x86" value="${MSDEV_DIR}\bin\mt.exe" />
<property name="include.x86" value="${MSDEV_DIR}\include" />
<property name="include.x86.platformSDK" value="${MSDEV_DIR}\PlatformSDK\Include" />
<property name="include.x86.atl" value="${MSDEV_DIR}\atlmfc\include" />
<property name="library.x86" value="${MSDEV_DIR}\lib" />
<property name="library.x86.platformSDK" value="${MSDEV_DIR}\PlatformSDK\lib" />
<property name="library.x86.atl" value="${MSDEV_DIR}\atlmfc\lib" />
<!-- You have to love the beautiful asymetry of the MS world -->
<!-- The platform SDK comes with 64 bit tools but not 32 bit tools -->
<property name="compiler.x64" value="${MSDEV_DIR}\bin\x86_amd64\cl.exe" />
<property name="linker.x64" value="${MSDEV_DIR}\bin\x86_amd64\link.exe" />
<property name="manifesttool.x64" value="${MSDEV_DIR}\bin\x86_amd64\mt.exe" />
<property name="include.x64" value="${MSDEV_DIR}\include" />
<property name="library.x64" value="${MSDEV_DIR}\lib\amd64" />
<property name="library.x64.platformSDK" value="${MSDEV_DIR}\PlatformSDK\lib\amd64" />
<property name="library.x64.atl" value="${MSDEV_DIR}\atlmfc\lib\amd64" />
<!-- ======================================================================
Create the necessary directory structure (does nothing if it
already there)
================================================================== -->
<mkdir dir="${release.dir.java}"/>
<mkdir dir="${release.dir.java.meta.inf}"/>
<mkdir dir="${release.dir.x86.cpp}"/>
<mkdir dir="${release.dir.x64.cpp}"/>
<mkdir dir="${release.dir}"/>
<!-- ======================================================================
Writes out a version file to be included in the jar
================================================================== -->
<property name="version" value="version not set in compilation_tools properties file"/>
<propertyfile file="${generated.filename.version}">
<entry key="version" type="string" value="${version}" />
<entry key="build.iteration" type="int" operation="+" value="1" pattern="00" />
<entry key="build.date" type="date" value="now" operation="=" pattern="dd-MMMM-yyyy HH:mm:ss" />
</propertyfile>
<property file="${generated.filename.version}" />
<!-- ======================================================================
32 bit X86 can only be built on 32 bit because of a JDK library issue.
arch=X86 true if on 32 bit, unset in all other cases.
This module used to rely on that. Now it just checks to see if we have
the right compilers.
================================================================== -->
<available file="${compiler.x86}" property="compilerAvailable.x86"/>
<echo message="compilerAvailable.x86=${compilerAvailable.x86}" />
<available file="${compiler.x64}" property="compilerAvailable.x64"/>
<echo message="compilerAvailable.x64=${compilerAvailable.x64}" />
<!-- ======================================================================
Compare the date/time of the DLL against that of the cpp source.
Up to date is only true if dll exists and is later than source
We should build if we can build and the dll is not up to date
================================================================== -->
<condition property="shouldBuild.x86">
<and>
<istrue value="${compilerAvailable.x86}"/>
<not>
<uptodate targetfile="${release.file.x86.dll}">
<srcfiles dir="${src.cpp}" includes="*.cpp" />
<srcfiles dir="${src.cpp}" includes="*.h" />
<!-- Check the build file itself as well -->
<srcfiles dir="${basedir}" includes="build.xml" />
</uptodate>
</not>
</and>
</condition>
<echo message="shouldBuild.x86= ${shouldBuild.x86}" />
<condition property="shouldBuild.x64">
<and>
<istrue value="${compilerAvailable.x64}"/>
<not>
<uptodate targetfile="${release.file.x64.dll}">
<srcfiles dir="${src.cpp}" includes="*.cpp" />
<srcfiles dir="${src.cpp}" includes="*.h" />
<!-- Check the build file itself as well -->
<srcfiles dir="${basedir}" includes="build.xml" />
</uptodate>
</not>
</and>
</condition>
<echo message="shouldBuild.x64= ${shouldBuild.x64}" />
<!--=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v
START of TASKS
=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^ -->
<!-- =================================
target: default
================================= -->
<target name="default"
depends="javaJarBin,makeDll.x86,makeDll.x64">
<echo message="${application.title} ${version} build ${build.iteration} : finished on ${build.date}" />
</target>
<!-- ======================================================================
Target (still in development) that removes all bin directories
================================================================== -->
<target name="clean">
<delete>
<fileset dir="${release.dir.java}"/>
<fileset dir="${release.dir.x86.cpp}"/>
<fileset dir="${release.dir.x64.cpp}"/>
<fileset dir="${release.dir}"/>
</delete>
</target>
<!-- ======================================================================
Compare the date/time of the JAR against that
of the java source
================================================================== -->
<target name="javaJarCheck">
<uptodate property="jarUpToDate" targetfile="${release.file.jar}">
<srcfiles dir="${src.java.mainroot}" includes="com/**/*.java" />
<!-- Check the build file itself as well -->
<srcfiles dir="${basedir}" includes="build.xml" />
</uptodate>
<echo message="javaJarCheck says jarUpToDate= ${jarUpToDate}" />
</target>
<!-- ======================================================================
Compile the java files and copy JacobVersion.properties to be jar'd up
Relies on ant recognizing when a file needs to be compiled
Unit tests compiled seperately because of junit dependency
================================================================== -->
<target name="javaCompile" >
<echo>Building Jacob classes in ${release.dir.java}</echo>
<javac srcdir="${src.java.mainroot}"
destdir="${release.dir.java}"
listfiles="true" debug="on" source="1.5" />
<echo>Building sample classes in ${release.dir.java}</echo>
<javac srcdir="${src.java.samples}"
destdir="${release.dir.java}"
classpath="${release.dir.java}"
listfiles="true" debug="on" source="1.5" />
<echo>Building Jacob test classes in ${release.dir.java} using junit jar ${junit.jar}</echo>
<javac srcdir="${src.java.unittest}"
destdir="${release.dir.java}"
classpath="${release.dir.java}:${junit.jar}"
listfiles="true" debug="on" source="1.5" />
<copy file="${generated.filename.version}" todir="${release.dir.java.meta.inf}"/>
</target>
<!-- ======================================================================
Package the classes into a JAR.
Put JacobVersion.properties into the jar file so version retrieval method can find it
================================================================== -->
<target name="javaJarBin"
depends="javaCompile,javaJarCheck"
unless="jarUpToDate">
<echo>Removing old jars</echo>
<delete file="${release.file.jar}" />
<echo>Packaging java classes...</echo>
<echo>Version File is ${release.dir.java.meta.inf}/${generated.filename.version}</echo>
<jar destfile="${release.file.jar}" basedir="${release.dir.java}" update="false">
<exclude name="**/CVS" />
<!-- exclude all unit tests (ending in Test)
and everything in the samples and test packages -->
<exclude name="com/**/*Test*.class"/>
<exclude name="com/jacob/samples/**"/>
<exclude name="com/jacob/test/**"/>
<include name="com/**/*.class" />
<include name="META-INF/${generated.filename.version}" />
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="${java.class.main}"/>
<section name="${src.java.mainpackage}">
<attribute name="Specification-Title" value="${application.title}" />
<attribute name="Specification-Vendor" value="${application.vendor}" />
<attribute name="Implementation-Title" value="${application.title} Java libraries" />
<attribute name="Implementation-Version" value="${version} build ${build.iteration} on ${build.date}" />
</section>
</manifest>
</jar>
</target>
<!-- ======================================================================
Compile the c source files.
================================================================== -->
<target name="compile.x86" if="shouldBuild.x86">
<echo>Clean up the (X86) target folders and file, for safety</echo>
<delete file="${release.dir.x86.cpp}/**/*.*" />
<echo>Compiling (X86) C++ classes with JDK JNI library ${JDK}</echo>
<exec executable="${compiler.x86}" dir="${release.dir.x86.cpp}" failonerror="true">
<env key="Path" value="${MSDEV_IDE_DIR}"/>
<env key="include" value="${JDK}\include;${JDK}\include\win32;${include.x86.platformSDK};${include.x86};${include.x86.atl}"/>
<arg value="/nologo"/>
<arg value="/c"/>
<arg value="/D WIN32"/>
<arg value="/D NDEBUG"/>
<arg value="/D _WINDOWS"/>
<arg value="/D _USRDLL"/>
<arg value="/D _WINDLL" />
<!-- create a multi threaded dll -->
<arg value="/MT"/>
<!-- raise the warning level from the default -->
<!-- <arg value="/Wp64"/> -->
<arg value="/W3" />
<!-- sets the exception model -->
<arg value="/EHsc" />
<!-- /O2 and /RCT1 are incompatible -->
<!-- optimize build for speed. (is this VC specific? -->
<arg value="/O2" />
<!-- next two wipe out a lot of deprecated warnings about strings when using VC++ 8.0 and SDK-->
<arg value="/D _CRT_SECURE_NO_DEPRECATE" />
<arg value="/D _CRT_NONSTDC_NO_DEPRECATE" />
<arg value="/D _STATIC_CPPLIB" />
<arg value="${src.cpp}/*.cpp"/>
</exec>
</target>
<target name="compile.x64" if="shouldBuild.x64">
<echo>Clean up the (x64) target folders and file, for safety</echo>
<delete file="${release.dir.x64.cpp}/**/*.*" />
<echo>Compiling C++ (x64) classes with JDK JNI library ${JDK}</echo>
<exec executable="${compiler.x64}" dir="${release.dir.x64.cpp}" failonerror="true">
<env key="include" value="${JDK}\include;${JDK}\include\win32;${include.x86.platformSDK};${include.x86};${include.x86.atl}"/>
<env key="Path" value="${MSDEV_IDE_DIR}"/>
<arg value="/nologo"/>
<arg value="/c"/>
<arg value="/D WIN64"/>
<arg value="/D NDEBUG"/>
<arg value="/D _WINDOWS"/>
<arg value="/D _USRDLL"/>
<arg value="/D _WINDLL" />
<!-- create a multi threaded dll -->
<arg value="/MT"/>
<!-- raise the warning level from the default -->
<!-- <arg value="/Wp64"/> -->
<arg value="/W3" />
<!-- sets the exception model -->
<arg value="/EHsc" />
<!-- /O2 and /RCT1 are incompatible -->
<!-- optimize build for speed. (is this VC specific? -->
<arg value="/O2" />
<!-- next two wipe out a lot of deprecated warnings about strings when using VC++ 8.0 and SDK-->
<arg value="/D _CRT_SECURE_NO_DEPRECATE" />
<arg value="/D _CRT_NONSTDC_NO_DEPRECATE" />
<arg value="/D _STATIC_CPPLIB" />
<arg value="${src.cpp}/*.cpp"/>
</exec>
</target>
<!-- ======================================================================
Link the obj files into a DLL.
DLL construction matrix (Yes=DLL can be built, No=DLL cannot)
_________________________________________________
Type of machine ANT is running on
32 bit 64 bit
32 bit target Yes No
64 bit target Yes Yes
================================================================== -->
<target name="makeDll.x86" depends="compile.x86" if="shouldBuild.x86">
<echo>Clean up the target folders and file, for safety</echo>
<echo>Using ${library.x86}</echo>
<delete file="${release.file.x86.dll}" />
<echo>Creating ${release.file.x86.dll}</echo>
<exec executable="${linker.x86}" dir="${release.dir.x86.cpp}" failonerror="true">
<env key="Path" value="${MSDEV_IDE_DIR}"/>
<arg value="/nologo" />
<arg value="/MANIFEST" />
<arg value="/MANIFESTFILE:${release.dir.x86.cpp}/jacob.dll.manifest" />
<arg value="/dll" />
<arg value="/version:${version}" />
<arg value="/out:${release.file.x86.dll}" />
<arg value="/libpath:${library.x86}" />
<arg value="/libpath:${library.x86.platformSDK}" />
<arg value="/libpath:${library.x86.atl}" />
<arg value="${JDK}\lib\jvm.lib" />
<arg value="${release.dir.x86.cpp}/*obj"/>
</exec>
<exec executable="${manifestool.x86}" dir="${release.dir.x86.cpp}" failonerror="true">
<env key="Path" value="${MSDEV_IDE_DIR}"/>
<arg value="-outputresource:${release.file.x86.dll};2"/>
<arg value="-manifest"/>
<arg value="${release.dir.x86.cpp}\jacob.dll.manifest" />
</exec>
</target>
<target name="makeDll.x64" depends="compile.x64" if="shouldBuild.x64">
<echo>Clean up the target folders and file, for safety</echo>
<delete file="${release.file.x64.dll}" />
<echo>Creating {$release.file.x64.dll}</echo>
<exec executable="${linker.x64}" dir="${release.dir.x64.cpp}" failonerror="true">
<env key="Path" value="${MSDEV_IDE_DIR}"/>
<arg value="/nologo" />
<arg value="/MANIFEST" />
<arg value="/MANIFESTFILE:${release.dir.x64.cpp}/jacob.dll.manifest" />
<arg value="/dll" />
<arg value="/version:${version}" />
<arg value="/out:${release.file.x64.dll}" />
<arg value="/libpath:${library.x64}" />
<arg value="/libpath:${library.x64.platformSDK}" />
<arg value="/libpath:${library.x64.atl}" />
<arg value="${JDK}\lib\jvm.lib" />
<arg value="${release.dir.x64.cpp}/*.obj" />
</exec>
<exec executable="${manifestool.x86}" dir="${release.dir.x64.cpp}" failonerror="true">
<env key="Path" value="${MSDEV_IDE_DIR}"/>
<arg value="-outputresource:${release.file.x64.dll};2"/>
<arg value="-manifest"/>
<arg value="${release.dir.x64.cpp}\jacob.dll.manifest" />
</exec>
</target>
<!-- ======================================================================
Use this target to create javadoc from ${src.java.mainpackage}/*
================================================================== -->
<target name="generateJavaDoc">
<defaultexcludes add="**/*Test*"/>
<javadoc
packagenames="${src.java.mainpackage}/**"
sourcepath="${src.java.mainroot}"
destdir="${release.dir.java}/docs/api"
author="true"
version="true"
use="true"
windowtitle="${application.title} API Docs">
<doctitle><![CDATA[<h1>${application.title}</h1>]]></doctitle>
<bottom><![CDATA[<i>${application.vendor}</i>]]></bottom>
<group title="Core COM Communication" packages="${src.java.mainpackage}.com/**"/>
<group title="Higher Level Active X" packages="${src.java.mainpackage}.activeX/**"/>
<group title="API Stub Generator" packages="${src.java.mainpackage}.jacobgen/**"/>
<link offline="true" href="http://java.sun.com/j2se/1.5.0/docs/api/" packagelistLoc="C:\tmp"/>
<link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
</javadoc>
<defaultexcludes default="true"/>
</target>
<!-- ======================================================================
Use this target to package all the files for a release
================================================================== -->
<target name="PackageRelease"
depends="makeDll.x86,makeDll.x64,javaJarBin,generateJavaDoc">
<echo>Packaging release... ${release.file.jar}</echo>
<zip
destfile="${release.dir}/${generated.filename.zip}.zip">
<exclude name="**/CVS" />
<exclude name="**/*.obj" />
<exclude name="**/*.class" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="LICENSE.* ${generated.filename.version} README.txt" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="docs/**" />
<zipfileset dir="${release.dir.x86}" prefix="${generated.filename.zip}" includes="${generated.filename.dll.x86}" />
<zipfileset dir="${release.dir.x64}" prefix="${generated.filename.zip}" includes="${generated.filename.dll.x64}" />
<zipfileset dir="${release.dir.java}" prefix="${generated.filename.zip}" includes="${generated.filename.jar}" />
<zipfileset dir="${release.dir.java}" prefix="${generated.filename.zip}" includes="docs/**"/>
</zip>
<zip
destfile="${release.dir}/${generated.filename.zip}_src.zip">
<exclude name="**/CVS" />
<exclude name="**/*.obj" />
<exclude name="**/*.class" />
<exclude name="**/*.dll" />
<exclude name="**/*.exp" />
<exclude name="**/*.jar" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="src/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="docs/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="jni/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="samples/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="unittest/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="vstudio/jacob.vcproj" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="lib/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="build.xml, README.txt" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="LICENSE.* ${generated.filename.version}" />
</zip>
</target>
<!-- ======================================================================
JUnit testing
This should probably be dependent on dll also
This assumes we are always testing on X86
This assumes that ant-junit is available
================================================================== -->
<target name='test' depends='javaCompile' >
<junit printsummary="yes"
haltonfailure="yes"
fork="true"
dir="${release.dir.java}"
>
<sysproperty key="java.library.path" value="${release.dir.x86}" />
<classpath>
<pathelement location="${junit.jar}"/>
<pathelement location="${release.dir.java}"/>
<pathelement path="${src.java.unittest}"/>
</classpath>
<formatter type="brief" usefile="false"/>
<batchtest>
<!-- use the source directory because it tries to run inner classes
if we use the release directory -->
<fileset dir="${src.java.unittest}">
<include name="**/*.java"/>
</fileset>
</batchtest>
</junit>
</target>
</project>

View File

@@ -1,144 +0,0 @@
<HTML>
<BODY>
<h1> Overview </h1>
JACOB is built on windows machines using ANT, most commonly from inside of Eclipse.
The main steps for getting a working Jacob build are:
<ol>
<li>Check out the source code or unpack the source zip file from sourceforge</li>
<li>Install the Development Environment</li>
<li>Configure the build by creating a <i>compilation_tools.properties</i> file.</li>
<li>Run Eclipse and load the project into eclipse</li>
<li>Open the build.xml file in Eclipse and run the default ant target </li>
</ol>
<p>
<h1> Repository Organization </h1>
<p>
Unpack the source archive zip file or check the files out of CVS into d:\jacob
or some other familiar place. Source Java and JNI files are located in seperate
packages from the unit tests and the samples.
<p>
<ul>
<li>docs: documentation
<li>jni: c++ code
<li>lib: libraries needed to compile unit tests
<li>release: a directory built by the ant script where jacob is constructed
<li>samples: sample programs
<li>src: Jacob Java source files
<li>unittest: JUnit 3.8.1 unit test programs. Run from the test target in build.xml
<li>vstudio: some out of date VC++ project files
<li>bulid.xml: the ant build script. It can be run from inside Eclipse
</ul>
<p>
The Servlet examples that required j2ee libraries to compile have temporarily
been removed.
<p>
<H1>Development Environment</h1>
The simplest build environment includes MS Visual C++ 8.0 (Studio 2005),
Eclipse 3.3 with the C/C++ module and JDK 1.5.
In that situation, you would just create the <i>compilation_tools.properties</i>
using the example build.xml as a template.
<UL>
<li> Microsoft Visual C++ 8.0 and it's included library. (to C:\ProgramFiles in my case)
<li> Eclipse 3.4 or later from www.eclipse.org as the Java IDE.
<li> Eclipse 3.4 or later with the C/C++ plugin can be used for C coding in place of VC++ IDE.
<li> Java JDK 1.5 (1.15 was built using 1.5.0.16)
</ul>
<p>
<p>
<table>
<TR><TD>Release</TD><TD>C Version</TD><TD>Java Version</TD><TD>ANT Version</TD><TD>Eclipse Version Used</TD><TD>generated DLLs</TD></TR>
<TR><TD>up to 1.6</TD><TD>VC 98 (6.0)</TD><TD>?</TD><td>MAKE</td><TD>?</TD><TD>32 bit</TD></TR>
<TR><TD>1.7</TD><TD>VC 98 (6.0)</TD><TD>1.4</TD><td>1.?</td><TD>?</TD><TD>32 bit</TD></TR>
<TR><TD>1.8</TD><TD>VC 98 (6.0)</TD><TD>1.4</TD><td>1.?</td><TD>?</TD><TD>32 bit</TD></TR>
<TR><TD>1.9</TD><TD>VC 98 (6.0)</TD><TD>1.4</TD><td>1.?</td><TD>?</TD><TD>32 bit</TD></TR>
<TR><TD>1.10</TD><TD>VC 98 (6.0)</TD><TD>1.4</TD><td>1.?</td><TD>3.??</TD><TD>32 bit</TD></TR>
<TR><TD>1.11</TD><TD>VC 98 (6.0) & 2003 64bit libs</TD><TD>1.4.?</TD><td>1.6.?</td><TD>3.2.1</TD><TD>32 and 64 bit</TD></TR>
<TR><TD>1.12</TD><TD>VC 98 (6.0) & 2003 64bit libs</TD><TD>1.4.2</TD><td>1.6.5</td><TD>3.2.2</TD><TD>32 and 64 bit</TD></TR>
<TR><TD>1.13</TD><TD>VC 2005</TD><TD>1.4.2</TD><TD>1.7.0</TD><TD>3.3</TD><TD>32 and 64 bit</TD></TR>
<TR><TD>1.14</TD><TD>VC 2005</TD><TD>1.5.0</TD><TD>1.7.0</TD><TD>3.3</TD><TD>32 and 64 bit</TD></TR>
<TR><TD>1.15</TD><TD>VC 2005</TD><TD>1.5.0</TD><TD>1.7.0</TD><TD>3.4</TD><TD>32 and 64 bit</TD></TR>
</table>
Microsoft Visual C++ 8.0 supports 64 bit builds. so no additional tools are required.
<p>
<H1>Build Process</H1>
The build process is based on ANT.
You can run ANT from inside of eclipse or from the command line.
The ant process is driven off of a configuration file named
<code>compilation_tools.properties</code> that describes the locations of the JDK and Microsoft
C++ tools. The <code>build.xml</code> file in the root directory contains examples of the contents
of this file.
<p>
There are two main ant targets.
<UL>
<li>"default" executes the following steps when using the default target.
<UL>
<li> Build the Java code
<li> Build the jni code
<li> create the dll
<li> create jar file
</UL>
<li>"package" runs the above listed steps and then
<UL>
<LI>builds the javadoc
<LI>builds a source zip
<li>builds a binary zip with the javadoc
</UL>
</UL>
<p>
<H1>Eclipse Java IDE</h1>
<p>
Eclipse users have to do some minor tweaks to their project if they
want to use the integrated build process. This is because the unit
tests are files located in the "unittest" directory while
the project source files themselves are in "src" the root directory.
By default, eclipse will add the entire project as source. This
messes up the package naming. In addition, the build directory should be
set to be the same place the ANT build puts the compiled java classes.
A couple small tweaks to the build path fix these problems:
<p>
Open up the project properties and go to the "Java Build Path" properties panel.
<ul>
<li> Remove the root of the project from the build path</li>
<li> Add folders <code>samples</code>, <code>src</code> and <code>unittest</code>
to the build path in the Source tab.</li>
<li> Exclude *.txt from each of the newly added folders. </li>
<li> Set the default build output directory to <code>jacob-project/release/java</code></li>
</ul>
<h2> Troubleshooting Build Problems </h2>
<ul>
<li>
Symptom: The jar is built but no dlls were compiled.<p>
Problem: compilation_tools.properties does not have the correct location for the Microsoft tools.<p>
</li>
<li>
Sympton: Can't find jni.h or can't find C++ compiler<p>
Problem: compilation_tools.properties configured incorrectly. Either
paths are wrong or the separator is wrong. It requires two backslashes for a separator.<p>
</li>
</ul>
<h1> Running Samples and Tests </h1>
Samples and JUnit test programs can be found in the source jar or in CVS. The programs
can be run from a bat file or from inside the Eclipse IDE. The java library
path variable must be set to include the directory the jacob.dll is in. The
simplest way to do that is to add it as a command line option. The following
assume that your jacob development area is located in c:\dev\jacob:
<pre>
-Djava.library.path=c:/dev/jacob/release/x86
-Dcom.jacob.autogc=false
-Dcom.jacob.debug=false
-Xcheck:jni
</pre>
<p>
JUnit test programs can be individually run from inside eclipse or en-masse
via the <code>ant test</code> target.
Last Modified 10/2008 1.15
</BODY>
</HTML>

View File

@@ -1,88 +0,0 @@
<html>
<head>
<title>Jacob can register Java classes for MS application events or callbacks</title>
<BODY>
<H2>Overview</H2>
Jacob can register Java classes for MS application events or callbacks.
<H2>Sequence of Events</H2>
The normal flow for this is:
<OL>
<LI>Application thread creates an instance of the event handler and registers it with Jacob
<LI>The application continues on doing other work.
<LI>Some time later, the MS application takes some action and initiates the event callback.
<LI>The Java VM receives the event and spins up a new thread to handle it.
<LI>The Jacob jni EventProxy in the dll is called by the VM.
<LI>The Jacob jni EventProxy creates Variant objects to handle the parameters of the passed in event.
<LI>The Jacob jni EventProxy sends the name of the callback and the array of Variant objects to the Java InvocationProxy that was registered to catch events.
<LI>The Java InvocationProxy uses reflection to map the event name to a method name with the exact same name.
<LI>The Java InvocationProxy sends the message to the registered event handler and returns if the event handler is of type void (standard behavior).
<LI>The Java InvocationProxy sends the message to the registered event handler and returns the Variant that resulted from the call back to the Jacob jni EventProxy that then returns it to the windows calling program.
</OL>
<H2>SWING Issues</H2>
Swing developers should note that this message comes in on a thread other than the event thread.
All objects receiving events that require user intervention or drawing in the UI should use
invokeLater() to post requests for actions onto the event queue. Failure to do so will
insure random failures in the GUI.
Java Web Start (JWS) and other launchers can have additional issues related to the class loader.
The Jacob C++ library uses FindClass() to find the Variant class when building the parameter list.
FindClass() uses the system class loader which includes only the classes specified at run time or
in the CLASSPATH. Most of the application classes in this situation live in an alternate set of
class loaders that were created when the launcher located and ran the application classes. This
means that the search for Variant will fail usually with the silent and immediate termination of
the Java application. The thread classloader probably can<61>t be used to try and find the class
because this new thread does not have a classloader associated with it other than the system class
loader. The end result is that the Variant class needs to be located via other means and that the
thread classloader should be set to be the context class loader of the event handler class.
<H2>1.8 and 1.9 behavior</H2>
The Jacob EventProxy class has been modified (off of the 1.8 tree) so that it takes a two step approach towards fixing these problems.
<OL>
<LI>The EventProxy constructor now accepts an extra object, an instance of the Variant class. This gives the EventProxy a way to get to the Variant class and thus to its classloader. All of the callers of the constructor have been modified to pass a Variant object to the EventProxy without programmer intervention.
<LI>EventProxy first attempts to locate the Variant class using FindClass()
<LI>Failing that, it looks to see if a variant object had been passed in. If so, it calls class() and goes from there.
<LI>If all that fails, it logs a message and then fails in the spectacular fashion of the previous versions.
</OL>
<p>
<H2>1.10 behavior</H2>
The Jacob EventProxy class has been modified so that it takes a different approach towards fixing this problem.
<OL>
<LI>All objects that request event notification are now wrapped in a Java InvocationProxy
so that a standard interface is always presented to the JNI EventProxy object.
<LI>The EventProxy constructor accepts any Java class. It wraps the class if it is not an
InvocationProxy or uses just the passed in object if it is an InvocationProxy.
The JNI layer talks to the InvocationProxy instead of talking directly to the event listener
as in previous releases.
<LI>The Java InvocationProxy has a method on it that will return the Variant class that the
EventProxy. The JNI code uses this method to acquire the class so that it can call newInstance().
</OL>
Developers can receive call back events in JWS other Java launching programs without implementing any additional code. They should be aware that their callback methods may need to set the class loader. If they expect to create any objects.:
<pre>
Public xxx someHandler(Variant[] foo){
Thread.currentThread().setContextClassLoader(
this.getClass().getClassLoader());
// do something
}
</pre>
There may still be a dual event queue issue in JWS applications that needs to be looked at.
<p>
<H2>1.12 Experimental Behavior</H2>
Release 1.12 adds experimental support for event handlers that accept java objects as parameters
to closer match the signature of the windows callback. New ActiveXDispatchEvents and
ActiveXInvocationProxy operate in tandem in the same way as DispatchEvents and InvocationProxy.
DispatchEvents overrides getInvocationProxy() to create a new ActiveXInvocationProxy in place
of the normal InvocationProxy. ActiveXInvocationProxy has its own invoke() method that uses
reflection to call back using java objects as parameters.
<p>
Issues with this approach
<ul>
<li>Event callbacks that use java signatures do not support parameter modification. Many
windows callbacks let a user reject an event that is about to happen by modifying one of the
parameters. In this situation, the old DispatchEvents/InvocationProxy pair must be used instead
of the new handlers.
</ul>
</body>
</html>

View File

@@ -1,51 +0,0 @@
<H1>COM Object Lifetime in JACOB</H1>
<p>
<H2>introduction</H2>
<p>
JACOB Version 1.7 implements a new
<a href="JacobThreading.html">Threading Model</a> that is more
compatible with COM apartments. There is also an incompatibility
between the Java object lifetime model and that of COM objects.
COM Objects live and die by their reference count, whereas Java
objects are collected by the Garbage Collector (GC) based on algortihms
that are hidden from the user.
<H2>COM Object Lifetime in JACOB Prior to Version 1.7</H2>
<p>
In version 1.6 and earlier, JACOB objects which wrapped COM objects
had <code>finalize()</code> methods that would call a native
<code>release</code> method which would call a COM <code>Release</code>.
<p>
This has many problems. For one thing, the GC may take a long time to
kick in and resource consumption may grow. However, the more problematic
issue is that finalizers are called from a separate thread, and, as was
discussed in the <a href="JacobThreading.html">Threading Model</a>
document, this can result in COM errors if the object is running in an
STA. Even if the object is running in an MTA, the finalizer may decide
to run after we have terminated the thread that holds the component, in
which case we would get fatal errors and crashes.
<H2>COM Object Lifetime in JACOB in Version 1.7</H2>
<p>
In Version 1.7, all JACOB objects which wrap COM objects extend
<code>com.jacob.com.JacobObject</code>. This object has some special
code to register itself with a <code>com.jacob.com.ROT</code> object
which represents a Running Object Table (ROT). This table maps a
Thread to the set of JacobObjects created in that thread. Therefore,
when you call <code>ComThread.Release()</code>, the ROT checks whether
that thread has created any objects, and these objects are released
by calling their native <code>release</code> method (which is public).
<p>
This lifetime management method ties the lifecycle to the thread's
lifecycle rather than the GC. The JacobObject's still have finalizers,
but they will typically not perform the native <code>release</code>
since that has already been called. The native <code>release</code>
methods were written such that you can call them multiple times without
worrying - since they zero out the native pointer when called the first
time.
<p>
If you choose to call <code>release</code> methods on your objects
yourself, that is allowed. In that case, when the thread is released
the release calls will be no-ops.
<p>
It becomes important for you to call <code>ComThread.Release()</code>
on any thread before you allow it to exit, otherwise you may get
some random crashes later on in your code.

View File

@@ -1,410 +0,0 @@
<H1>COM Apartments in JACOB</H1>
<p>
<H2>introduction</H2>
<p>
The COM model for Threading differs from the Java model.
In COM, each component can declare whether or not it support
multi-threading.
You can find some basic information about COM threading at:
<p>
<a href="http://www.execpc.com/~gopalan/com/com_threading.html">
http://www.execpc.com/~gopalan/com/com_threading.html</a>
<p>
<a href="www.microsoft.com/msj/0297/apartment/apartment.htm">
www.microsoft.com/msj/0297/apartment/apartment.htm</a>
<p>
<a href="http://www.cswl.com/whiteppr/white/multithreading.html">
http://www.cswl.com/whiteppr/white/multithreading.html
</a>
<p>
The term <b>Single Threaded Apartment (STA)</b> refers to a thread
where all COM objects created in that thread are
single-threaded. This can manifest itself in two ways:
<br>
Either all calls into that component are made from the same thread
that created the component
<br>
OR any call that is made from another thread gets serialized by COM.
This serialization of calls is done by using a Windows message loop and
posting messages to a hidden window (I'm not kidding). The way COM
achieves this is by requiring any other thread to make calls through
a local Proxy object rather than the original object (more on this
when we discuss the JACOB DispatchProxy class).
<p>
What does this mean for a Java application? If you are using a component
that declares itself as <b>ThreadingModel "Apartment"</b> (you can
find this out by looking in the registry under its CLSID), and you plan
to create, use and destroy this component in one thread - then you are
following the rules of an STA and you can declare the thread as an
STA thread.
<p>
On the other hand, if you need to make method calls from another thread
(e.g. in a servlet) then you have a few choices. Either you
create the component in its own STA, by extending
<code>com.jacob.com.STA</code>, and use the
<code>com.jacob.com.DispatchProxy</code> class to pass the Dispatch
pointer between threads, or you can declare your thread as an MTA
thread. In that case, COM will make
the cross-thread calls into the STA that is running your component.
If you create an Apartment threaded component in the MTA,
COM will automatically create an STA for you and put your
component in there, and then marshall all the calls.
<p>
This brings us to the notion of a <b>Main STA</b>. COM requires that
if there is any Apartment threaded component in your application, then
the first STA created is tagged as the <b>Main STA</b>. COM uses the
Main STA to create all the Apartment threaded components that are
created from an MTA thread. The problem is that if you have already
created an STA, then COM will pick that as the Main STA, and if you
ever exit that thread - the whole application will exit.
<H2>COM Threads in JACOB Prior to Version 1.7</H2>
<p>
Up until version 1.7 of JACOB, there was only one model available
in JACOB:
<ul>
<li>
Before version 1.6: All threads were automatically initialized as STAs.
</li>
<li>
In version 1.6: All threads were automatically initialized as MTAs.
</li>
</ul>
<p>
The reason for the change in default was that tagging a Java thread
as an STA can cause problems. Any Java Swing application, as well as
servlets and applets need to be able to make calls from multiple
threads. If you try to make COM method calls across STA threads - it
will fail!
<p>
In most cases, the default chosen by JACOB 1.6 (MTA) works fine, however
there are some notable exceptions that have caused people grief. One
such exception is in the case of MAPI. It turns out that if you try to
create a MAPI object from an MTA thread - it simply fails and exits.
This has caused some people to recompile JACOB 1.6 back with the STA
default.
<p>
There is another problem with MTA threads: when you are using Apartment
threaded components, we already noted that COM will create the
components in the Main STA. If one doesn't exist, COM will create it.
However, this means that <b>all</b> Apartment threaded components will
be created in the <b>same STA</b>. This creates a bottleneck, and a
dependency between unrelated components. Also, if that STA exits, then
all components are destroyed and the application will likely crash.
<H2>COM Threads in JACOB Version 1.7</H2>
<p>
In Version 1.7 we have added finer grained control to allow the
Java programmer to control how COM creates its components.
Unfortunately, this means that you need to have a pretty good
understanding of the dark and mystical subject of COM Apartments.
There are a few different cases you need to consider:
<H3>Default</H3>
<p>
If you simply run code that was created in Version 1.6 and ignore
the COM threading issue, then you will get the same behavior as in 1.6:
Each java thread will be an MTA thread, and all Apartment threaded
components will be created by COM in its own Main STA. This typically
works for most applications (exceptions noted above).
<H3>Create Your Own Apartment</H3>
<p>
To declare an MTA thread use the following template:
<br>
<pre>
<code>
ComThread.InitMTA();
...
...
ComThread.Release();
</pre>
</code>
<br>
If you want JACOB to create its own Main STA (rather than having COM
choose an STA for you), then you should use:
<br>
<code>
<pre>
Thread 1:
ComThread.InitMTA(true); // a true tells JACOB to create a Main STA
...
...
ComThread.Release();
...
Thread 2:
ComThread.InitMTA();
...
...
ComThread.Release();
...
...
ComThread.quitMainSTA();
</pre>
</code>
<br>
In this case, you can also create the Main STA explicitly:
<br>
<code>
<pre>
ComThread.startMainSTA();
...
...
Thread 1:
ComThread.InitMTA();
...
...
ComThread.Release();
...
Thread 2:
ComThread.InitMTA();
...
...
ComThread.Release();
...
...
ComThread.quitMainSTA();
</pre>
</code>
<br>
In the latter case, all Apartment threaded components will be created in
JACOB's main STA. This still has all the problems of components
sharing the same Main STA and creating a bottleneck. To avoid that,
you can also create STA threads yourself:
<br>
<code>
<pre>
ComThread.startMainSTA();
...
...
Thread 1:
ComThread.InitSTA();
...
...
ComThread.Release();
...
Thread 2:
ComThread.InitMTA();
...
...
ComThread.Release();
...
...
ComThread.quitMainSTA();
</pre>
</code>
<br>
In this example, thread 1 is an STA and thread 2 is an MTA. You could
omit the call to ComThread.startMainSTA(), but if you do, then COM will
make the first STA your main one, and then if you exit that thread,
the application will crash.
<p>
Actually, Thread 1 is <i>almost</i> an STA. It's lacking a windows
message loop. So, this type of STA is fine as long as you are creating
a component and using it in the same thread, and not makind event
callbacks.
<H3>JACOB's STA Class</H3>
<p>
If you want to create an true STA where you can create a component and
then let other threads call methods on it, then you need a windows
message loop. JACOB provides a class called:
<code>com.jacob.com.STA</code> which does exactly this.
<code>
<pre>
public class com.jacob.com.STA extends java.lang.Thread
{
public com.jacob.com.STA();
public boolean OnInit(); // you override this
public void OnQuit(); // you override this
public void quit(); // you can call this from ANY thread
}
</pre>
</code>
<p>
The STA class extends
<code>java.lang.Thread</code> and it provides you with two methods
that you can override: <code>OnInit</code> and <code>OnQuit</code>.
These methods are called from the thread's <code>run</code> method
so they will execute in the new thread. These methods allow you to
create COM components (Dispatch objects) and release them.
To create an STA, you subclass it and override the OnInit.
<p>
The <code>quit</code> method is the <b>only</b> other method that
can be called from any thread. This method uses the Win32 function
<code>PostThreadMessage</code> to force the STA's windows message loop
to exit, thereby terminating the thread.
<p>
You will then need to make calls into the component that is running
in the STA thread. If you simply try to make calls from another thread
on a Dispatch object created in the STA thread, you will get a COM
Exception. For more details see:
<a href="http://www.develop.com/effectivecom">
Don Box 'Effective COM' Rule 29</a>: Don't Access raw
interface pointers across apartment boundaries.
<H3>The DispatchProxy Class</H3>
Since you cannot call methods directly on a Dispatch object created
in another STA JACOB provides a method for the class that created
the Dispatch object to marshal it to your thread. This is done via
the <code>com.jacob.com.DispatchProxy</code> class.
<code>
<pre>
public class DispatchProxy extends JacobObject {
public DispatchProxy(Dispatch);
public Dispatch toDispatch();
public native void release();
public void finalize();
}
</code>
</pre>
<p>
This class works as follows: the thread that created the Dispatch
object constructs an instance of DispatchProxy(Dispatch) with the
Dispatch as a parameter. This instance can then be accessed from
another thread, which will invoke its <code>toDispatch</code> method
proxy as if it were local to your thread. COM will do the inter-thread
marshalling transparently.
<p>
The following example is part of samples/test/ScriptTest2.java in the
JACOB distribution. It shows how you can create the ScriptControl
in one STA thread and make method calls on it from another:
<code>
<pre>
import com.jacob.com.*;
import com.jacob.activeX.*;
class ScriptTest2 extends STA
{
public static ActiveXComponent sC;
public static Dispatch sControl = null;
public static DispatchProxy sCon = null;
public boolean OnInit()
{
try
{
System.out.println("OnInit");
System.out.println(Thread.currentThread());
String lang = "VBScript";
sC = new ActiveXComponent("ScriptControl");
sControl = (Dispatch)sC.getObject();
// sCon can be called from another thread
sCon = new DispatchProxy(sControl);
Dispatch.put(sControl, "Language", lang);
return true;
}
catch (Exception e)
{
e.printStackTrace();
return false;
}
}
public void OnQuit()
{
System.out.println("OnQuit");
}
public static void main(String args[]) throws Exception
{
try {
ComThread.InitSTA();
ScriptTest2 script = new ScriptTest2();
Thread.sleep(1000);
// get a thread-local Dispatch from sCon
Dispatch sc = sCon.toDispatch();
// call a method on the thread-local Dispatch obtained
// from the DispatchProxy. If you try to make the same
// method call on the sControl object - you will get a
// ComException.
Variant result = Dispatch.call(sc, "Eval", args[0]);
System.out.println("eval("+args[0]+") = "+ result);
script.quit();
System.out.println("called quit");
} catch (ComException e) {
e.printStackTrace();
}
finally
{
ComThread.Release();
}
}
}
</pre>
</code>
<p>
You can try to modify the <code>Dispatch.call</code> invocation in
the main thread to use <code>sControl</code> directly, and you will see
that it fails. Notice that once we construct the ScriptTest2 object
in the main thread, we sleep for a second to allow the other thread
time to initialize itself.
<p>
The STA thread calls <code>sCon = new DispatchProxy(sControl);</code>
to save a global reference to the DispatchProxy that represents the
<code>sControl</code> object. The main thread then calls:
<code>Dispatch sc = sCon.toDispatch();</code> to get a local Dispatch
proxy out of the DispatchProxy object.
<p>
At most <b>one(!)</b>
thread can call toDispatch(), and the call can be made only once.
This is because a IStream object is used to pass the proxy, and
it is only written once and closed when you read it.
If you need multiple threads to access a Dispatch pointer, then
create that many DispatchProxy objects. For more details please
refer to the Don Box reference above.
<H3>Recommended Procedure</H3>
<ul>
<li>
It is recommended that you always allow JACOB to manage the main STA
rather than letting COM create one on its own or tag one of yours.
</li>
<li>
Declare an STA thread using ComThread.InitSTA()
if all your
method calls for that component are going to come from the same thread.
</li>
<li>
If you want an STA thread that allows other threads to call into it,
use the <code>com.jacob.com.STA</code> class as outlined above.
</li>
<li>
If you have a COM component that declares its ThreadingModel as
"Free" or "Both", then use the MTA.
</li>
<li>
In most cases, if you need to make method calls from multiple threads,
you can simply
use MTA threads, and allow COM to create the components in
the Main STA. You should only create your own STA's and DispatchProxy
if you understand COM well enough to know when the MTA solution
will fail or have other shortcomings.
<p>
There are 3 examples in the samples/test directory that demonstrate
these cases:
<p>
ScriptTest.java - creates an STA for the ScriptControl component and
runs all its method calls from that STA.
<p>
ScriptTest2.java - creates a separate STA thread, and makes
method calls into the component from another thread using DispatchProxy.
<p>
ScriptTest3.java - creates a separate MTA thread, and makes method
calls into the component from another MTA thread. This is simpler
than ScriptTest2 for most applications.
<p>
<h3>Default Threading Model</h3>
If you create a new thread, and don't call
<code>ComThread.InitSTA()</code> or <code>ComThread.InitMTA()</code>
on it, then the first time your java code creates a JacobObject, it
will try to register itself with the ROT, and when it sees that the
current thread is not initialized, it will initialize it as MTA.
This means that the code to do this is no longer inside the native
jni code - it is now in the <code>com.jacob.com.ROT</code> class.
For more details on the ROT, see the
<a href="JacobComLifetime.html">Object Lifetime</a> document.

File diff suppressed because it is too large Load Diff

View File

@@ -1,263 +0,0 @@
<HTML>
<BODY>
Jacob is a Java library that lets Java applications communicate with Microsoft Windows
DLLs or COM libraries. It does this through the use of a custom DLL that the Jacob
Java classes communicate with via JNI. The library and dll isolate the Java developer
from the underlying windows libraries so that the Java developer does not have to write
custom JNI code.
<p>
Jacob is not used for creating ActiveX plugins or other modules that
live inside of Microsoft Windows applications.
<hr>
<h2> The Jacob Packages </h2>
<p>
The JACOB jar contains two main packages: the <code>com.jacob.com.*</code>> package and
the <code>com.jacob.activeX</code> package. The <code>com.jacob.com.*</code> package contains classes
map very closely to the com dispatch model with the <code>com.jacob.com.Dispatch</code>
acting as the primary communication class. Dispatch operate as a function library with
a set of static methods that map very closely to the C++ Dispatch APIs provided
to the COM layer.
<p><code>com.jacob.activex.ActiveXComponent</code> can be used in place of Dispatch
to provide a more object like API.
The only exception to this guideline is that the <code>ActiveXComponent</code> class is always
used to make the initial connection to the target dll/COM component.
<hr>
<H2> Considerations when doing server side automation of office </h2>
<p>
Most office and many windows client type applications are not written to be used
in high volume or multi-threaded server environment. There is a
<a href="http://support.microsoft.com/kb/257757/">
support note </a>
on the Microsoft web site that discusses some of the issues.
<p>
<hr>
<H2> Determining the API of the target application </h2>
<p>
Section not yet written.
<p>
<hr>
<h2> The Jacob DLL </h2>
<p>
Jacob.jar relies on a DLL file that it loads off of the library path or classpath.
This means that you must either copy the appropriate jacob ddll into your path or
use VM options to add directory holding jacob dll to the path. Prior to 1.14M6,
the jacob DLL name was always "jacob.dll". This made it hard to verify jacob
was loading the correct dll when multiple copies of jacob were installed on a
single system. It also was confusing on 64 bit systems where the 32 bit and 64 bit
dlls have the same tames.
Starting in 1.14M6, Jacob's library
loader selects a dll with the appropriate name based on the jacob release and platform.
The dll naming convention is: <BR>
<code>jacob&lt;platform&gt;.&lt;version.&gt;.dll</code>
<p>
<h3>Classloader issues</h3>
The code is written so that the jacob.dll is only loaded one time per classloader.
This works fine in the standard application but can cause problems if jacob.jar
is loaded from more than one class loader. This can happen in the situation where multiple
jacob dependent web applications run in the same container like a web server or JWS runtime.
In the case of a web server, Jacob is normally put in the application specific WEB-INF/lib directory.
This is the "right" way to do it and works in most situations.
But, if Jacob is put in the WEB-INF/lib directory of each application's war file for more than
one application then a problem occurs.
In this situation, the web server uses a different classloader for each application.
This means that each application will attempt to load the jacob.dll and errors
are generated. The only way around this at this time (1.11) is to put the jacob.jar
in the common/lib because that classloader is inherited by all of the applications
so the DLLs will only get loaded once. This problem is described in SF 1645463 and
should be fixed in some future release, fix method and time not yet determined.
<p>
<hr>
<h2>Microsoft Visual C++ library dependencies.</h2>
<p>
Jacob 1.15 is build with VC++ 2005 statically linked into the DLL. This
removes the need for a separate msvcr80.dll installation.
</p>
<p>
Jacob 1.13 is built with VC++ 2005 that creates a dependency on msvcr80.dll.
Windows XP and later seem to already include the necessary components.
NT/2000 and Server/2003 require that you download the Visual C 2005 redistributable
package, vcredist_x86.exe from the Microsoft web site.
Microsoft has a download available that supplies the necessary components.
It is distributed as a redistributable package.
</p>
<p>
If you see the following message then you probably don't have the right C++ libraries.
</p>
<pre>
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\apps\...\jacob.dll: This application has
failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem
</pre>
<pre>
<A href="http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en">
Visual C redistributable installer SP1</A>
</pre>
<p></p>
<hr>
<h2>Jacob Command Line Settings</h2>
This library supports several different command line options:
<table border=1>
<tr><td colspan=3>
<h3>dll path location and dll name customization</h3>
</td></tr>
<tr><td>&nbsp;&nbsp;&nbsp;</td><td valign="top">
<h4>java.library.path</h4>
</td><td>
Standard Java property used to add the location of the jacob dll to the JVM's library path.
(Added 1.11)
<p>
Example: <code>-Djava.library.path=d:/jacob/release/x86</code>
</td></tr>
<tr><td>&nbsp;&nbsp;&nbsp;</td><td valign="top">
<h4>jacob.dll.name</h4>
</td><td>
Override the standard DLL name with a custom one. This stops jacob from
using its 32bit/64bit detection and dll rendezvous logic.
Sometimes used when
Jacob is bundled with another application and the application wishes
to tie the jacob dll version number to the application version number.
(Added 1.14M7)
<p>
Example: <code>-Djacob.dll.name=MyFunkyDllName.dll</code>
</td></tr>
<tr><td>&nbsp;&nbsp;&nbsp;</td><td valign="top">
<h4>jacob.dll.name.x86 & jacob.dll.name.x64</h4>
</td><td>
Override the standard 32 bit DLL name with custom ones.
Sometimes used when
Jacob is bundled with another application and the application wishes
to tie the jacob dll version number to the application version number.
(Added 1.14M7)
<p>
Example to override 32 bit dll name: <code>-Djacob.dll.name.x86=MyFunkyDllName-32bit.dll</code>
</td></tr>
<tr><td colspan=3>
<h3>Memory Management</h3>
</td></tr>
<tr><td>&nbsp;&nbsp;&nbsp;</td><td valign="top">
<h4>com.jacob.autogc </h4>
</td><td>
Determines if automatic garbage collection is enabled. This is the
only way to free up objects created in event callbacks. Automatic garbage collection ,
based on Java gc rules, garbage collection can be enabled via the
<code>com.java.autogc</code> command line option.
<em>This feature was added in release 1.9 is not fully debugged. </em>
<p>
There are real reasons for managing the
lifetime of JacobObjects on a per thread basis.
Jacob normally manages the the com/Java object lifetime as described in the
<a href="JacobComLifetime.html">JacobComLifetime.html</a> document.
Some users have run into situations where they wish to try and let the Java
GC lifetime manage the lifetime of objects. This seems to usually be tied
to long running threads or to objects created as part of event callbacks.
Code was added to let users try and let the JVM manage the object life cycles
even though the <a href="JacobComLifetime.html">JacobComLifetime.html</a> document
says this is a bad idea. Added 1.9.
<p>
<p>
This value is cached at startup and cannot be changed on-the-fly via <code>System.setProperty();</code>
<p>
The default value is <em>false</em>
<p>
Example: <code>-Dcom.jacob.autogc=false</code>
</td></tr>
<tr><td>&nbsp;&nbsp;&nbsp;</td><td valign="top">
<h4>com.jacob.includeAllClassesInROT</h4>
</td><td>
Acts as master switch for and &ltclass_name&gt.PutInROT.
This property determines if the (experimental) PutInROT property is even
checked. It was added in version 1.15 because the property check in
PutInROT brok applets because they are not allowed to check system properties
at run time. com.jacob.includeAllClassesInROT is checked at class initialization
which is allowed.
<p>The default value of this flag is <i>true</i> which matches all behavior
prior to 1.13 and the default behavior for 1.13 on</p>
<p>Setting this flag to false causes Jacob to check the and &lt;class_name&gt;.PutInROT
property for every Jacob object that is created.</p>
</td></tr>
<tr><td>&nbsp;&nbsp;&nbsp;</td><td valign="top">
<h4>&ltclass_name&gt.PutInROT</h4>
</td><td>
Lets a program specify that instances of certain classes are to not be inserted
into the ROT. This experimental (1.13) feature provides a mechanism for freeing
VariantViaEvent objects that are created in Event threads. There is normally no
way to free those objects because the thread terminates outside of any normally MTA/STA
Startup/Teardown code. Each event occurs in a new thread and creates a new ROT entry
so they grow without bounds.
<p>
This option may cause VM crashes in certain situations where windows memory is freed
outside of the thread it was created in but empirical evidence shows there are
situations where this great reduces the long running memory footprint of applications
that process a lot of events. <em>This function is still experimental</em>.
The functionality was added 1.13. Some of this overlaps the experimental <code>com.jacob.autogc</code> introduced
in 1.9.
See the ROT.java test program for an example of the effects of this option.
<p>
This value is checked every time and can be changed on-the-fly via <code>System.setProperty();</code>
<p>
Example: <code>System.setProperty("com.jacob.com.VariantViaVariant.PutInROT","false");</code>
<BR>
Example: <code>-Dcom.jacob.com.VariantViaVariant.PutInROT=false</code>
</td></tr>
<tr><td colspan=3>
<h3>Debugging and Troubleshooting</h3>
</td></tr>
<tr><td>&nbsp;&nbsp;&nbsp;</td><td valign="top">
<h4>com.jacob.debug</h4>
</td><td>
Determines if debug output is enabled to standard out.
<p>
This value is cached at startup and cannot be changed on-the-fly via <code>System.setProperty();</code>
<p>
The default value is <strong>false</strong>
<p>
Example: <code>-Dcom.jacob.debug=false</code>
</td><tr>
<tr><td>&nbsp;&nbsp;&nbsp;</td><td valign="top">
<h4>-XCheck:jni</h4>
</td><td>
This turns on additional JVM checking for JNI issues. This is
not an actual JACOB system property but a property used by the JVM.
<p>
The default is "no additional checking"
Example: <code>-XCheck:jni</code>
</td></tr>
</table>
<p></p>
<hr>
<h2>Finding the DLL version using windows command line</h2>
The jacob.dll file includes the jacob release number in the version field.
Run the following from the command prompt <code>dumpbin /version jacob.dll</code> .
The dll version number is stored in the "image version" field of the
"OPTIONAL HEADER VALUES" section.
This information from <a href="http://msdn2.microsoft.com/en-gb/library/h88b7dc8(VS.71).aspx">
The Microsoft msdn web site</a>
<hr>
<h2>Unit Tests</h2>
Jacob must know the location of the DLL when running the unit tests in Eclipse.
The simplest way to do this is to add the dll path to the unit as a VM argument.
The argument should be specified based on where you installed the jacob source package.
If you have jacob unpacked in c:/dev/jacob and built using build.xml,
then the vm arguments would be:
<br><code>-Djava.library.path=c:/dev/jacob/release/x86</code> .
<p>
Last Modified 4/2008 1.15
</BODY>
</HTML>

View File

@@ -1,4 +0,0 @@
jacob.dll
jacob.lib
jacob.exp

View File

@@ -1,47 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "stdafx.h"
#include <objbase.h>
#include "ComThread.h"
// Win32 support for Ole Automation
#include <wchar.h>
#include <string.h>
#include <atlbase.h>
#include <oleauto.h>
#include <olectl.h>
#include "util.h"
extern "C"
{
JNIEXPORT void JNICALL Java_com_jacob_com_ComThread_doCoInitialize
(JNIEnv *env, jclass cls, jint mode)
{
int threadModel = mode;
CoInitializeEx(NULL, threadModel);
}
JNIEXPORT void JNICALL Java_com_jacob_com_ComThread_doCoUninitialize
(JNIEnv *env, jclass cls)
{
CoUninitialize();
}
}

View File

@@ -1,48 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <jni.h>
/* Header for class com_jacob_com_ComThread */
#ifndef _Included_com_jacob_com_ComThread
#define _Included_com_jacob_com_ComThread
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_jacob_com_ComThread
* Method: doCoInitialize
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_ComThread_doCoInitialize
(JNIEnv *, jclass, jint);
/*
* Class: com_jacob_com_ComThread
* Method: doCoUninitialize
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_ComThread_doCoUninitialize
(JNIEnv *, jclass);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,560 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "stdafx.h"
#include <objbase.h>
#include "Dispatch.h"
// Win32 support for Ole Automation
#include <wchar.h>
#include <string.h>
#include <atlbase.h>
#include <oleauto.h>
#include <olectl.h>
#include "util.h"
extern "C"
{
#define DISP_FLD "m_pDispatch"
// extract a IDispatch from a jobject
IDispatch *extractDispatch(JNIEnv *env, jobject arg)
{
jclass argClass = env->GetObjectClass(arg);
jfieldID ajf = env->GetFieldID( argClass, DISP_FLD, "I");
jint anum = env->GetIntField(arg, ajf);
IDispatch *v = (IDispatch *)anum;
return v;
}
/**
* This method finds an interface rooted on the passed in dispatch object.
* This creates a new Dispatch object so it is NOT reliable
* in the event callback thread of a JWS client where the root class loader
* does not have com.jacob.com.Dispatch in its classpath
*/
JNIEXPORT jobject JNICALL Java_com_jacob_com_Dispatch_QueryInterface
(JNIEnv *env, jobject _this, jstring _iid)
{
// get the current IDispatch
IDispatch *pIDispatch = extractDispatch(env, _this);
if (!pIDispatch) return NULL;
// if we used env->GetStringChars() would that let us drop the conversion?
const char *siid = env->GetStringUTFChars(_iid, NULL);
USES_CONVERSION;
LPOLESTR bsIID = A2W(siid);
env->ReleaseStringUTFChars(_iid, siid);
IID iid;
HRESULT hr = IIDFromString(bsIID, &iid);
if (FAILED(hr)) {
ThrowComFail(env, "Can't get IID from String", hr);
return NULL;
}
// try to call QI on the passed IID
IDispatch *disp;
hr = pIDispatch->QueryInterface(iid, (void **)&disp);
if (FAILED(hr)) {
ThrowComFail(env, "QI on IID from String Failed", hr);
return NULL;
}
jclass autoClass = env->FindClass("com/jacob/com/Dispatch");
jmethodID autoCons = env->GetMethodID(autoClass, "<init>", "(I)V");
// construct a Dispatch object to return
// I am copying the pointer to java
// jacob-msg 1817 - SF 1053871 : QueryInterface already called AddRef!!
//if (disp) disp->AddRef();
jobject newAuto = env->NewObject(autoClass, autoCons, disp);
return newAuto;
}
/**
* starts up a new instance of the requested program (progId)
* and connects to it. does special code if the progid
* is of the alternate format (with ":")
**/
JNIEXPORT void JNICALL Java_com_jacob_com_Dispatch_createInstanceNative
(JNIEnv *env, jobject _this, jstring _progid)
{
jclass clazz = env->GetObjectClass(_this);
jfieldID jf = env->GetFieldID( clazz, DISP_FLD, "I");
// if we used env->GetStringChars() would that let us drop the conversion?
const char *progid = env->GetStringUTFChars(_progid, NULL);
CLSID clsid;
HRESULT hr;
IUnknown *punk = NULL;
IDispatch *pIDispatch;
USES_CONVERSION;
LPOLESTR bsProgId = A2W(progid);
if (strchr(progid,':'))
{
env->ReleaseStringUTFChars(_progid, progid);
// it's a moniker
hr = CoGetObject(bsProgId, NULL, IID_IUnknown, (LPVOID *)&punk);
if (FAILED(hr)) {
ThrowComFail(env, "Can't find moniker", hr);
return;
}
IClassFactory *pIClass;
// if it was a clsid moniker, I may have a class factory
hr = punk->QueryInterface(IID_IClassFactory, (void **)&pIClass);
if (!SUCCEEDED(hr)) goto doDisp;
punk->Release();
// try to create an instance
hr = pIClass->CreateInstance(NULL, IID_IUnknown, (void **)&punk);
if (FAILED(hr)) {
ThrowComFail(env, "Can't create moniker class instance", hr);
return;
}
pIClass->Release();
goto doDisp;
}
env->ReleaseStringUTFChars(_progid, progid);
// Now, try to find an IDispatch interface for progid
hr = CLSIDFromProgID(bsProgId, &clsid);
if (FAILED(hr)) {
ThrowComFail(env, "Can't get object clsid from progid", hr);
return;
}
// standard creation
hr = CoCreateInstance(clsid,NULL,CLSCTX_LOCAL_SERVER|CLSCTX_INPROC_SERVER,IID_IUnknown, (void **)&punk);
if (!SUCCEEDED(hr)) {
ThrowComFail(env, "Can't co-create object", hr);
return;
}
doDisp:
// now get an IDispatch pointer from the IUnknown
hr = punk->QueryInterface(IID_IDispatch, (void **)&pIDispatch);
if (!SUCCEEDED(hr)) {
ThrowComFail(env, "Can't QI object for IDispatch", hr);
return;
}
// CoCreateInstance called AddRef
punk->Release();
env->SetIntField(_this, jf, (unsigned int)pIDispatch);
}
/**
* attempts to connect to an running instance of the requested program
* This exists solely for the factory method connectToActiveInstance.
**/
JNIEXPORT void JNICALL Java_com_jacob_com_Dispatch_getActiveInstanceNative
(JNIEnv *env, jobject _this, jstring _progid)
{
jclass clazz = env->GetObjectClass(_this);
jfieldID jf = env->GetFieldID( clazz, DISP_FLD, "I");
// if we used env->GetStringChars() would that let us drop the conversion?
const char *progid = env->GetStringUTFChars(_progid, NULL);
CLSID clsid;
HRESULT hr;
IUnknown *punk = NULL;
IDispatch *pIDispatch;
USES_CONVERSION;
LPOLESTR bsProgId = A2W(progid);
env->ReleaseStringUTFChars(_progid, progid);
// Now, try to find an IDispatch interface for progid
hr = CLSIDFromProgID(bsProgId, &clsid);
if (FAILED(hr)) {
ThrowComFail(env, "Can't get object clsid from progid", hr);
return;
}
// standard connection
//printf("trying to connect to running %ls\n",bsProgId);
hr = GetActiveObject(clsid,NULL, &punk);
if (!SUCCEEDED(hr)) {
ThrowComFail(env, "Can't get active object", hr);
return;
}
// now get an IDispatch pointer from the IUnknown
hr = punk->QueryInterface(IID_IDispatch, (void **)&pIDispatch);
if (!SUCCEEDED(hr)) {
ThrowComFail(env, "Can't QI object for IDispatch", hr);
return;
}
// GetActiveObject called AddRef
punk->Release();
env->SetIntField(_this, jf, (unsigned int)pIDispatch);
}
/**
* starts up a new instance of the requested program (progId).
* This exists solely for the factory method connectToActiveInstance.
**/
JNIEXPORT void JNICALL Java_com_jacob_com_Dispatch_coCreateInstanceNative
(JNIEnv *env, jobject _this, jstring _progid)
{
jclass clazz = env->GetObjectClass(_this);
jfieldID jf = env->GetFieldID( clazz, DISP_FLD, "I");
// if we used env->GetStringChars() would that let us drop the conversion?
const char *progid = env->GetStringUTFChars(_progid, NULL);
CLSID clsid;
HRESULT hr;
IUnknown *punk = NULL;
IDispatch *pIDispatch;
USES_CONVERSION;
LPOLESTR bsProgId = A2W(progid);
env->ReleaseStringUTFChars(_progid, progid);
// Now, try to find an IDispatch interface for progid
hr = CLSIDFromProgID(bsProgId, &clsid);
if (FAILED(hr)) {
ThrowComFail(env, "Can't get object clsid from progid", hr);
return;
}
// standard creation
hr = CoCreateInstance(clsid,NULL,CLSCTX_LOCAL_SERVER|CLSCTX_INPROC_SERVER,IID_IUnknown, (void **)&punk);
if (!SUCCEEDED(hr)) {
ThrowComFail(env, "Can't co-create object", hr);
return;
}
// now get an IDispatch pointer from the IUnknown
hr = punk->QueryInterface(IID_IDispatch, (void **)&pIDispatch);
if (!SUCCEEDED(hr)) {
ThrowComFail(env, "Can't QI object for IDispatch", hr);
return;
}
// CoCreateInstance called AddRef
punk->Release();
env->SetIntField(_this, jf, (unsigned int)pIDispatch);
}
/**
* release method
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Dispatch_release
(JNIEnv *env, jobject _this)
{
jclass clazz = env->GetObjectClass(_this);
jfieldID jf = env->GetFieldID( clazz, DISP_FLD, "I");
jint num = env->GetIntField(_this, jf);
IDispatch *disp = (IDispatch *)num;
if (disp) {
disp->Release();
env->SetIntField(_this, jf, (unsigned int)0);
}
}
static HRESULT
name2ID(IDispatch *pIDispatch, const char *prop, DISPID *dispid, long lcid)
{
HRESULT hresult;
USES_CONVERSION;
LPOLESTR propOle = A2W(prop);
hresult = pIDispatch->GetIDsOfNames(IID_NULL,(LPOLESTR*)&propOle,1,lcid,dispid);
return hresult;
}
JNIEXPORT jintArray JNICALL Java_com_jacob_com_Dispatch_getIDsOfNames
(JNIEnv *env, jclass clazz, jobject disp, jint lcid, jobjectArray names)
{
IDispatch *pIDispatch = extractDispatch(env, disp);
if (!pIDispatch) return NULL;
int l = env->GetArrayLength(names);
int i;
LPOLESTR *lps = (LPOLESTR *)CoTaskMemAlloc(l * sizeof(LPOLESTR));
DISPID *dispid = (DISPID *)CoTaskMemAlloc(l * sizeof(DISPID));
for(i=0;i<l;i++)
{
USES_CONVERSION;
jstring s = (jstring)env->GetObjectArrayElement(names, i);
// if we used env->GetStringChars() would that let us drop the conversion?
const char *nm = env->GetStringUTFChars(s, NULL);
LPOLESTR nmos = A2W(nm);
env->ReleaseStringUTFChars(s, nm);
lps[i] = nmos;
env->DeleteLocalRef(s);
}
HRESULT hr = pIDispatch->GetIDsOfNames(IID_NULL,lps,l,lcid,dispid);
if (FAILED(hr)) {
CoTaskMemFree(lps);
CoTaskMemFree(dispid);
char buf[1024];
strcpy_s(buf, "Can't map names to dispid:");
for(i=0;i<l;i++)
{
USES_CONVERSION;
jstring s = (jstring)env->GetObjectArrayElement(names, i);
const char *nm = env->GetStringUTFChars(s, NULL);
strcat_s(buf, nm);
env->ReleaseStringUTFChars(s, nm);
env->DeleteLocalRef(s);
}
ThrowComFail(env, buf, hr);
return NULL;
}
jintArray iarr = env->NewIntArray(l);
// SF 1511033 -- the 2nd parameter should be 0 and not i!
env->SetIntArrayRegion(iarr, 0, l, dispid);
CoTaskMemFree(lps);
CoTaskMemFree(dispid);
return iarr;
}
static char* BasicToCharString(const BSTR inBasicString)
{
char* charString = NULL;
const size_t charStrSize = ::SysStringLen(inBasicString) + 1;
if (charStrSize > 1)
{
charString = new char[charStrSize];
size_t convertedSize;
::wcstombs_s(&convertedSize, charString, charStrSize, inBasicString, charStrSize);
}
else
{
charString = ::_strdup("");
}
return charString;
}
static wchar_t* CreateErrorMsgFromResult(HRESULT inResult)
{
wchar_t* msg = NULL;
::FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM, NULL, inResult,MAKELANGID(LANG_NEUTRAL,
SUBLANG_DEFAULT), (LPWSTR) &msg, 0, NULL);
if (msg == NULL)
{
const wchar_t* message_text = L"An unknown COM error has occured.";
size_t bufferLength = (wcslen(message_text) + 1) * sizeof(wchar_t);
msg = (wchar_t*) ::LocalAlloc(LPTR, bufferLength);
wcscpy_s(msg, bufferLength, message_text);
}
return msg;
}
static wchar_t* CreateErrorMsgFromInfo(HRESULT inResult, EXCEPINFO* ioInfo,
const char* methName)
{
wchar_t* msg = NULL;
size_t methNameWSize = 0;
mbstowcs_s(&methNameWSize, NULL, 0, methName, _TRUNCATE);
wchar_t* methNameW = new wchar_t[methNameWSize];
mbstowcs_s(NULL, methNameW, methNameWSize, methName, _TRUNCATE);
// If this is a dispatch exception (triggered by an Invoke message),
// then we have to take some additional steps to process the error
// message.
if (inResult == DISP_E_EXCEPTION)
{
// Check to see if the server deferred filling in the exception
// information. If so, make the call to populate the structure.
if (ioInfo->pfnDeferredFillIn != NULL)
(*(ioInfo->pfnDeferredFillIn))(ioInfo);
// Build the error message from exception information content.
int sourceLen = SysStringLen(ioInfo->bstrSource);
int descLen = SysStringLen(ioInfo->bstrDescription);
const size_t MSG_LEN = ::wcslen(methNameW) + sourceLen + descLen + 128;
msg = new wchar_t[MSG_LEN];
::wcsncpy_s(msg, MSG_LEN, L"Invoke of: ", wcslen(L"Invoke of: "));
::wcsncat_s(msg, MSG_LEN, methNameW, wcslen(methNameW));
::wcsncat_s(msg, MSG_LEN, L"\nSource: ", wcslen(L"\nSource: "));
::wcsncat_s(msg, MSG_LEN, ioInfo->bstrSource, sourceLen);
::wcsncat_s(msg, MSG_LEN, L"\nDescription: ", wcslen(L"\nDescription: "));
::wcsncat_s(msg, MSG_LEN, ioInfo->bstrDescription, descLen);
::wcsncat_s(msg, MSG_LEN, L"\n", wcslen(L"\n"));
}
else
{
wchar_t* msg2 = CreateErrorMsgFromResult(inResult);
const size_t MSG_LEN = ::wcslen(methNameW) + ::wcslen(msg2) + 256;
msg = new wchar_t[MSG_LEN];
::wcsncpy_s(msg, MSG_LEN,
L"A COM exception has been encountered:\nAt Invoke of: ",
wcslen(L"A COM exception has been encountered:\nAt Invoke of: "));
::wcsncat_s(msg, MSG_LEN, methNameW, wcslen(methNameW));
::wcsncat_s(msg, MSG_LEN, L"\nDescription: ", wcslen(L"\nDescription: "));
::wcsncat_s(msg, MSG_LEN, msg2, wcslen(msg2));
// jacob-msg 1075 - SF 1053872 : Documentation says "use LocalFree"!!
//delete msg2;
LocalFree(msg2);
}
delete methNameW;
return msg;
}
#define SETDISPPARAMS(dp, numArgs, pvArgs, numNamed, pNamed) \
{\
(dp).cArgs = numArgs; \
(dp).rgvarg = pvArgs; \
(dp).cNamedArgs = numNamed; \
(dp).rgdispidNamedArgs = pNamed; \
}
#define SETNOPARAMS(dp) SETDISPPARAMS(dp, 0, NULL, 0, NULL)
JNIEXPORT jobject JNICALL Java_com_jacob_com_Dispatch_invokev
(JNIEnv *env, jclass clazz,
jobject disp, jstring name, jint dispid,
jint lcid, jint wFlags, jobjectArray vArg, jintArray uArgErr)
{
DISPPARAMS dispparams;
EXCEPINFO excepInfo;
IDispatch *pIDispatch = extractDispatch(env, disp);
if (!pIDispatch) return NULL;
int dispID = dispid;
if (name != NULL)
{
const char *nm = env->GetStringUTFChars(name, NULL);
HRESULT hr;
if (FAILED(hr = name2ID(pIDispatch, nm, (long *)&dispID, lcid))) {
char buf[1024];
sprintf_s(buf, 1024, "Can't map name to dispid: %s", nm);
ThrowComFail(env, buf, -1);
return NULL;
}
env->ReleaseStringUTFChars(name, nm);
}
int num_args = env->GetArrayLength(vArg);
int i, j;
VARIANT *varr = NULL;
if (num_args)
{
varr = (VARIANT *)CoTaskMemAlloc(num_args*sizeof(VARIANT));
/* reverse args for dispatch */
for(i=num_args-1,j=0;0<=i;i--,j++)
{
VariantInit(&varr[j]);
jobject arg = env->GetObjectArrayElement(vArg, i);
VARIANT *v = extractVariant(env, arg);
// no escape from copy?
VariantCopy(&varr[j], v);
env->DeleteLocalRef(arg);
}
}
// prepare a new return value
jclass variantClass = env->FindClass("com/jacob/com/Variant");
jmethodID variantCons =
env->GetMethodID(variantClass, "<init>", "()V");
// construct a variant to return
jobject newVariant = env->NewObject(variantClass, variantCons);
// get the VARIANT from the newVariant
VARIANT *v = extractVariant(env, newVariant);
DISPID dispidPropertyPut = DISPID_PROPERTYPUT;
// determine how to dispatch
switch (wFlags)
{
case DISPATCH_PROPERTYGET: // GET
case DISPATCH_METHOD: // METHOD
case DISPATCH_METHOD|DISPATCH_PROPERTYGET:
{
SETDISPPARAMS(dispparams, num_args, varr, 0, NULL);
break;
}
case DISPATCH_PROPERTYPUT:
case DISPATCH_PROPERTYPUTREF: // jacob-msg 1075 - SF 1053872
{
SETDISPPARAMS(dispparams, num_args, varr, 1, &dispidPropertyPut);
break;
}
}
HRESULT hr = 0;
jint count = env->GetArrayLength(uArgErr);
if ( count != 0 )
{
jint *uAE = env->GetIntArrayElements(uArgErr, NULL);
hr = pIDispatch->Invoke(dispID,IID_NULL,
lcid,(WORD)wFlags,&dispparams,v,&excepInfo,(unsigned int *)uAE); // SF 1689061
env->ReleaseIntArrayElements(uArgErr, uAE, 0);
}
else
{
hr = pIDispatch->Invoke(dispID,IID_NULL,
lcid,(WORD)wFlags,&dispparams,v,&excepInfo, NULL); // SF 1689061
}
if (num_args)
{
// to account for inouts, I need to copy the inputs back to
// the java array after the method returns
// this occurs, for example, in the ADO wrappers
for(i=num_args-1,j=0;0<=i;i--,j++)
{
jobject arg = env->GetObjectArrayElement(vArg, i);
VARIANT *v = extractVariant(env, arg);
// reverse copy
VariantCopy(v, &varr[j]);
// clear out the temporary variant
VariantClear(&varr[j]);
env->DeleteLocalRef(arg);
}
}
if (varr) CoTaskMemFree(varr);
// check for error and display a somewhat verbose error message
if (!SUCCEEDED(hr)) {
// two buffers that may have to be freed later
wchar_t *buf = NULL;
char *dispIdAsName = NULL;
// this method can get called with a name or a dispatch id
// we need to handle both SF 1114159
if (name != NULL){
const char *nm = env->GetStringUTFChars(name, NULL);
buf = CreateErrorMsgFromInfo(hr, &excepInfo, nm);
env->ReleaseStringUTFChars(name, nm);
} else {
dispIdAsName = new char[256];
// get the id string
_itoa_s (dispID, dispIdAsName, 256,10);
//continue on mostly as before
buf = CreateErrorMsgFromInfo(hr,&excepInfo,dispIdAsName);
}
// jacob-msg 3696 - SF 1053866
if(hr == DISP_E_EXCEPTION)
{
if(excepInfo.scode != 0)
{
hr = excepInfo.scode;
}
else
{
hr = _com_error::WCodeToHRESULT(excepInfo.wCode);
}
}
ThrowComFailUnicode(env, buf, hr);
if (buf) delete buf;
if (dispIdAsName) delete dispIdAsName;
return NULL;
}
return newVariant;
}
}

View File

@@ -1,87 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <jni.h>
/* Header for class Dispatch */
#ifndef _Included_Dispatch
#define _Included_Dispatch
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_jacob_com_Dispatch
* Method: QueryInterface
* Signature: (Ljava/lang/String;)Lcom/jacob/com/Dispatch;
*/
JNIEXPORT jobject JNICALL Java_com_jacob_com_Dispatch_QueryInterface
(JNIEnv *, jobject, jstring);
/*
* Class: Dispatch
* Method: createInstance
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Dispatch_createInstanceNative
(JNIEnv *, jobject, jstring);
/*
* Class: Dispatch
* Method: getActiveInstance
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Dispatch_getActiveInstanceNative
(JNIEnv *, jobject, jstring);
/*
* Class: Dispatch
* Method: coCreateInstance
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Dispatch_coCreateInstanceNative
(JNIEnv *, jobject, jstring);
/*
* Class: Dispatch
* Method: release
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Dispatch_release
(JNIEnv *, jobject);
/*
* Class: Dispatch
* Method: getIDsOfNames
* Signature: (Ljava/lang/Object;I[Ljava/lang/String;)[I
*/
JNIEXPORT jintArray JNICALL Java_com_jacob_com_Dispatch_getIDsOfNames
(JNIEnv *, jclass, jobject, jint, jobjectArray);
/*
* Class: Dispatch
* Method: invokev
* Signature: (Ljava/lang/Object;Ljava/lang/String;III[LVariant;[I)LVariant;
*/
JNIEXPORT jobject JNICALL Java_com_jacob_com_Dispatch_invokev
(JNIEnv *, jclass, jobject, jstring, jint, jint, jint, jobjectArray, jintArray);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,370 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "DispatchEvents.h"
#include "EventProxy.h"
// Win32 support for Ole Automation
#include <wchar.h>
#include <string.h>
#include <atlbase.h>
#include <objbase.h>
#include <oleauto.h>
#include <olectl.h>
#include "util.h"
extern "C"
{
#define PROXY_FLD "m_pConnPtProxy"
// defined below
BOOL GetEventIID(IUnknown*, IID*, CComBSTR **, DISPID **, int *,LPOLESTR);
BOOL GetEventIIDForTypeLib(BSTR, IID*, CComBSTR **, DISPID **, int *,LPOLESTR);
BOOL getClassInfoFromProgId(LPOLESTR bsProgId,LPTYPEINFO *pClassInfo);
BOOL MapEventIIDs(IID*, CComBSTR **, DISPID **, int *, LPOLESTR , LPTYPEINFO );
// extract a EventProxy* from a jobject
EventProxy *extractProxy(JNIEnv *env, jobject arg)
{
jclass argClass = env->GetObjectClass(arg);
jfieldID ajf = env->GetFieldID( argClass, PROXY_FLD, "I");
jint anum = env->GetIntField(arg, ajf);
EventProxy *v = (EventProxy *)anum;
return v;
}
/*
* pushes the EventProxy (*ep) into tje jobject in the PROXY_FLD location
*/
void putProxy(JNIEnv *env, jobject arg, EventProxy *ep)
{
jclass argClass = env->GetObjectClass(arg);
jfieldID ajf = env->GetFieldID( argClass, PROXY_FLD, "I");
jint anum = env->GetIntField(arg, ajf);
env->SetIntField(arg, ajf, (jint)ep);
}
/*
* Class: com_jacob_com_DispatchEvents
* Method: init3
* Signature: (Lcom/jacob/com/Dispatch;Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_DispatchEvents_init3
(JNIEnv *env,
jobject _this, jobject src,
jobject sink,
jstring _progid,
jstring _typelib)
{
USES_CONVERSION;
if (_typelib != NULL && _progid == NULL){
// both are required if typelib exists
ThrowComFail(env,"TypeLib was specified but no program id was",-1);
return;
}
BSTR typeLib = NULL;
if (_typelib != NULL){
// why is this UTF instead of unicode? Then we could probably drop the A2W
const char *typelib = env->GetStringUTFChars(_typelib, NULL);
typeLib = A2W(typelib);
// should we call env->ReleaseStringUTFChars(,) to free the memory like we do everywhere lese?
//printf("we have a type lib %ls\n",typeLib);
}
// find progid if any
LPOLESTR bsProgId = NULL;
if (_progid!=NULL) {
// why is this UTF instead of unicode? Then we could probably drop the A2W
const char *progid = env->GetStringUTFChars(_progid, NULL);
bsProgId = A2W(progid);
// should we call env->ReleaseStringUTFChars(,) to free the memory like we do everywhere lese?
//printf("we have an applicaton %ls\n",bsProgId);
}
// get the IDispatch for the source object
IDispatch *pDisp = extractDispatch(env, src);
CComQIPtr<IUnknown, &IID_IUnknown> pUnk(pDisp);
// see if it implements connection points
CComQIPtr<IConnectionPointContainer, &IID_IConnectionPointContainer> pCPC(pUnk);
if (!pCPC)
{
// no events, throw something
ThrowComFail(env, "Can't find IConnectionPointContainer", -1);
return;
}
IID eventIID;
CComBSTR *mNames;
DISPID *mIDs;
int n_EventMethods;
if (_typelib == NULL){
if (!GetEventIID(pUnk, &eventIID, &mNames, &mIDs, &n_EventMethods,bsProgId)) {
ThrowComFail(env, "Can't find event iid", -1);
return;
}
} else {
if (!GetEventIIDForTypeLib(typeLib, &eventIID, &mNames, &mIDs, &n_EventMethods,bsProgId)) {
ThrowComFail(env, "Can't find event iid for type lib", -1);
return;
}
}
// hook up to the default source iid
CComPtr<IConnectionPoint> pCP;
HRESULT hr = pCPC->FindConnectionPoint(eventIID, &pCP);
if (SUCCEEDED(hr))
{
EventProxy *ep = new EventProxy(env, sink, pCP, eventIID, mNames, mIDs, n_EventMethods);
// need to store ep on _this, in case it gets collected
putProxy(env, _this, ep);
} else {
ThrowComFail(env, "Can't FindConnectionPoint", hr);
}
}
/*
* Class: DispatchEvents
* Method: release
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_DispatchEvents_release
(JNIEnv *env, jobject _this)
{
EventProxy *ep = extractProxy(env, _this);
if (ep) {
// this is the line that blows up in IETest
ep->Release();
putProxy(env, _this, NULL);
}
}
/*
* I need a reverse map from the event interface's dispids to
* function names so that we can reflect them to java
*/
void
LoadNameCache(LPTYPEINFO pTypeInfo, LPTYPEATTR pta,
CComBSTR **mNames, DISPID **mIDs, int *nmeth)
{
CComBSTR *names = NULL;
DISPID *ids = NULL;
int m_nCount;
m_nCount = pta->cFuncs;
*nmeth = m_nCount;
names = m_nCount == 0 ? NULL : new CComBSTR[m_nCount];
ids = m_nCount == 0 ? NULL : new DISPID[m_nCount];
for (int i=0; i<m_nCount; i++)
{
FUNCDESC* pfd;
if (SUCCEEDED(pTypeInfo->GetFuncDesc(i, &pfd)))
{
CComBSTR bstrName;
if (SUCCEEDED(pTypeInfo->GetDocumentation(pfd->memid, &bstrName, NULL, NULL, NULL)))
{
names[i].Attach(bstrName.Detach());
ids[i] = pfd->memid;
/*
USES_CONVERSION;
printf("map:%d -> %s\n", ids[i], W2A((OLECHAR *)names[i]));
*/
}
pTypeInfo->ReleaseFuncDesc(pfd);
}
}
*mNames = names;
*mIDs = ids;
}
#define IMPLTYPE_MASK \
(IMPLTYPEFLAG_FDEFAULT | IMPLTYPEFLAG_FSOURCE | IMPLTYPEFLAG_FRESTRICTED)
#define IMPLTYPE_DEFAULTSOURCE \
(IMPLTYPEFLAG_FDEFAULT | IMPLTYPEFLAG_FSOURCE)
BOOL GetEventIID(IUnknown *m_pObject, IID* piid,
CComBSTR **mNames, DISPID **mIDs, int *nmeth,LPOLESTR bsProgId)
{
*piid = GUID_NULL;
ATLASSERT(m_pObject != NULL);
// I Always use IProvideClassInfo rather than IProvideClassInfo2
// since I also need to create a mapping from dispid to name
LPPROVIDECLASSINFO pPCI = NULL;
LPTYPEINFO pClassInfo = NULL;
if (SUCCEEDED(m_pObject->QueryInterface(IID_IProvideClassInfo, (LPVOID*)&pPCI)))
{
//printf("got IProvideClassInfo\n");
ATLASSERT(pPCI != NULL);
HRESULT hr = pPCI->GetClassInfo(&pClassInfo);
pPCI->Release();
if (!SUCCEEDED(hr)) return false;
}
else if (getClassInfoFromProgId(bsProgId,&pClassInfo)) {
}
else {
printf("GetEventIID: couldn't get IProvideClassInfo\n");
return false;
}
return MapEventIIDs(piid, mNames, mIDs, nmeth, bsProgId, pClassInfo);
}
BOOL MapEventIIDs(IID* piid,
CComBSTR **mNames, DISPID **mIDs, int *nmeth, LPOLESTR bsProgId, LPTYPEINFO pClassInfo)
{
ATLASSERT(pClassInfo != NULL);
//printf("MapEventIIDs: got past ClassInfo assert\n");
LPTYPEATTR pClassAttr;
if (SUCCEEDED(pClassInfo->GetTypeAttr(&pClassAttr)))
{
//printf("MapEventIIDs: got TypeAttr\n");
ATLASSERT(pClassAttr != NULL);
ATLASSERT(pClassAttr->typekind == TKIND_COCLASS);
// Search for typeinfo of the default events interface.
int nFlags;
HREFTYPE hRefType;
//printf("MapEventIIDs: looking at %d class attribute impl types \n");
for (unsigned int i = 0; i < pClassAttr->cImplTypes; i++)
{
if (SUCCEEDED(pClassInfo->GetImplTypeFlags(i, &nFlags)) &&
((nFlags & IMPLTYPE_MASK) == IMPLTYPE_DEFAULTSOURCE))
{
// Found it. Now look at its attributes to get IID.
LPTYPEINFO pEventInfo = NULL;
if (SUCCEEDED(pClassInfo->GetRefTypeOfImplType(i,
&hRefType)) &&
SUCCEEDED(pClassInfo->GetRefTypeInfo(hRefType,
&pEventInfo)))
{
ATLASSERT(pEventInfo != NULL);
LPTYPEATTR pEventAttr;
if (SUCCEEDED(pEventInfo->GetTypeAttr(&pEventAttr)))
{
ATLASSERT(pEventAttr != NULL);
// create a mapping from dispid to string
LoadNameCache(pEventInfo, pEventAttr,
mNames, mIDs, nmeth);
*piid = pEventAttr->guid;
pEventInfo->ReleaseTypeAttr(pEventAttr);
}
pEventInfo->Release();
}
break;
}
}
pClassInfo->ReleaseTypeAttr(pClassAttr);
}
pClassInfo->Release();
return (!IsEqualIID(*piid, GUID_NULL));
}
BOOL getClassInfoFromProgId(LPOLESTR bsProgId,LPTYPEINFO *pClassInfo)
{
USES_CONVERSION;
CLSID clsid;
GUID libid;
if (FAILED(CLSIDFromProgID(bsProgId, &clsid))) return false;
if (FAILED(StringFromCLSID(clsid,&bsProgId))) return false;
HKEY keySoftware, keyClasses, keyCLSID, keyXXXX, keyTypeLib;
DWORD dwType, dwCountData=50;
BYTE abData[50];
LONG lVal;
lVal = RegOpenKeyEx(HKEY_LOCAL_MACHINE,_T("SOFTWARE"),0,KEY_READ,&keySoftware);
if (lVal==ERROR_SUCCESS) {
lVal = RegOpenKeyEx(keySoftware,_T("Classes"),0,KEY_READ,&keyClasses);
if (lVal==ERROR_SUCCESS) {
lVal = RegOpenKeyEx(keyClasses,_T("CLSID"),0,KEY_READ,&keyCLSID);
if (lVal==ERROR_SUCCESS) {
_TCHAR *tsProgId = W2T(bsProgId);
lVal = RegOpenKeyEx(keyCLSID,tsProgId,0,KEY_READ,&keyXXXX);
if (lVal==ERROR_SUCCESS) {
lVal = RegOpenKeyEx(keyXXXX,_T("TypeLib"),0,KEY_READ,&keyTypeLib);
if (lVal==ERROR_SUCCESS) {
lVal = RegQueryValueExA(keyTypeLib,NULL,NULL,&dwType,abData,&dwCountData);
RegCloseKey(keyTypeLib);
}
RegCloseKey(keyXXXX);
}
RegCloseKey(keyCLSID);
}
RegCloseKey(keyClasses);
}
RegCloseKey(keySoftware);
}
if (lVal!=ERROR_SUCCESS) return false;
BSTR bsLibId = A2BSTR((char*)abData);
if (FAILED(CLSIDFromString(bsLibId,&libid))) return false;
//Try loading from registry information.
ITypeLib* pITypeLib;
if (FAILED(LoadRegTypeLib(libid,1,0, LANG_NEUTRAL, &pITypeLib))) return false;
//Find ITypeInfo for coclass.
pITypeLib->GetTypeInfoOfGuid(clsid, pClassInfo);
pITypeLib->Release();
return true;
}
/*
* Get the class info from the progId using the given typeLib.
*/
BOOL getClassInfoFromProgIdTypeLib(BSTR typeLib, LPOLESTR bsProgId, LPTYPEINFO *pClassInfo)
{
USES_CONVERSION;
CLSID clsid;
if (FAILED(CLSIDFromProgID(bsProgId, &clsid))) return false;
if (FAILED(StringFromCLSID(clsid,&bsProgId))) return false;
ITypeLib* pITypeLib;
if (FAILED(LoadTypeLib(typeLib, &pITypeLib))) return false;
//Find ITypeInfo for coclass.
pITypeLib->GetTypeInfoOfGuid(clsid, pClassInfo);
pITypeLib->Release();
return true;
}
BOOL GetEventIIDForTypeLib(BSTR typeLib, IID* piid,
CComBSTR **mNames, DISPID **mIDs, int *nmeth,LPOLESTR bsProgId)
{
LPTYPEINFO pClassInfo = NULL;
if(getClassInfoFromProgIdTypeLib(typeLib, bsProgId,&pClassInfo))
{
if (pClassInfo == NULL){
printf("we had a successful return but pClassInfo is null\n");
}
return MapEventIIDs(piid, mNames, mIDs, nmeth, bsProgId, pClassInfo);
}
else
{
printf("GetEventIIDForTypeLib: couldn't get IProvideClassInfo\n");
return false;
}
}
}

View File

@@ -1,50 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <jni.h>
/* Header for class DispatchEvents */
#ifndef _Included_DispatchEvents
#define _Included_DispatchEvents
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_jacob_com_DispatchEvents
* Method: init3
* Signature: (Lcom/jacob/com/Dispatch;Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_DispatchEvents_init3
(JNIEnv *, jobject, jobject, jobject, jstring, jstring);
/*
* Class: DispatchEvents
* Method: release
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_DispatchEvents_release
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,106 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "stdafx.h"
#include <objbase.h>
#include "ComThread.h"
// Win32 support for Ole Automation
#include <wchar.h>
#include <string.h>
#include <atlbase.h>
#include <oleauto.h>
#include <olectl.h>
#include "util.h"
extern "C"
{
// extract a IStream from a jobject
IStream *extractStream(JNIEnv *env, jobject arg)
{
jclass argClass = env->GetObjectClass(arg);
jfieldID ajf = env->GetFieldID( argClass, "m_pStream", "I");
jint anum = env->GetIntField(arg, ajf);
IStream *v = (IStream *)anum;
return v;
}
JNIEXPORT void JNICALL Java_com_jacob_com_DispatchProxy_MarshalIntoStream
(JNIEnv *env, jobject _this, jobject disp)
{
IDispatch *pIDispatch = extractDispatch(env, disp);
if (!pIDispatch) return;
IStream *ps; // this is the stream we will marshall into
HRESULT hr = CoMarshalInterThreadInterfaceInStream(
IID_IDispatch, pIDispatch, &ps);
if (!SUCCEEDED(hr))
{
ThrowComFail(env, "Could not Marshal Dispatch into IStream", hr);
return;
}
// store the stream pointer on the object
jclass argClass = env->GetObjectClass(_this);
jfieldID ajf = env->GetFieldID( argClass, "m_pStream", "I");
env->SetIntField(_this, ajf, (jint)ps);
}
JNIEXPORT jobject JNICALL Java_com_jacob_com_DispatchProxy_MarshalFromStream
(JNIEnv *env, jobject _this)
{
IStream *ps = extractStream(env, _this);
if (!ps)
{
ThrowComFail(env, "Could not get IStream from DispatchProxy", -1);
return NULL;
}
IDispatch *pD;
HRESULT hr = CoGetInterfaceAndReleaseStream(ps, IID_IDispatch, (void **)&pD);
// zero out the stream pointer on the object
// since the stream can only be read once
jclass argClass = env->GetObjectClass(_this);
jfieldID ajf = env->GetFieldID( argClass, "m_pStream", "I");
env->SetIntField(_this, ajf, (unsigned int)0);
if (!SUCCEEDED(hr))
{
ThrowComFail(env, "Could not Marshal Dispatch from IStream", hr);
return NULL;
}
jclass autoClass = env->FindClass("com/jacob/com/Dispatch");
jmethodID autoCons = env->GetMethodID(autoClass, "<init>", "(I)V");
// construct a Dispatch object to return
// I am copying the pointer to java
if (pD) pD->AddRef();
jobject newAuto = env->NewObject(autoClass, autoCons, pD);
return newAuto;
}
JNIEXPORT void JNICALL Java_com_jacob_com_DispatchProxy_release
(JNIEnv *env, jobject _this)
{
IStream *ps = extractStream(env, _this);
if (ps) {
ps->Release();
jclass argClass = env->GetObjectClass(_this);
jfieldID ajf = env->GetFieldID( argClass, "m_pStream", "I");
env->SetIntField(_this, ajf, (unsigned int)0);
}
}
}

View File

@@ -1,55 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <jni.h>
/* Header for class com_jacob_com_DispatchProxy */
#ifndef _Included_com_jacob_com_DispatchProxy
#define _Included_com_jacob_com_DispatchProxy
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_jacob_com_DispatchProxy
* Method: MarshalIntoStream
* Signature: (Lcom/jacob/com/Dispatch;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_DispatchProxy_MarshalIntoStream
(JNIEnv *, jobject, jobject);
/*
* Class: com_jacob_com_DispatchProxy
* Method: MarshalFromStream
* Signature: ()Lcom/jacob/com/Dispatch;
*/
JNIEXPORT jobject JNICALL Java_com_jacob_com_DispatchProxy_MarshalFromStream
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_DispatchProxy
* Method: release
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_DispatchProxy_release
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,131 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "stdafx.h"
#include <objbase.h>
#include "Dispatch.h"
// Win32 support for Ole Automation
#include <wchar.h>
#include <string.h>
#include <atlbase.h>
#include <oleauto.h>
#include <olectl.h>
#include "util.h"
/**
* An implementation of IEnumVariant based on code submitted by
* Thomas Hallgren (mailto:Thomas.Hallgren@eoncompany.com)
*/
extern "C"
{
// extract a IDispatch from a jobject
IEnumVARIANT* extractEnumVariant(JNIEnv* env, jobject arg)
{
jfieldID FID_pIEnumVARIANT = 0;
jclass clazz = env->GetObjectClass(arg);
FID_pIEnumVARIANT = env->GetFieldID(clazz, "m_pIEnumVARIANT", "I");
return (IEnumVARIANT*)env->GetIntField(arg, FID_pIEnumVARIANT);
}
JNIEXPORT jint JNICALL
Java_com_jacob_com_EnumVariant_Next(JNIEnv* env, jobject _this, jobjectArray vars)
{
IEnumVARIANT* self = extractEnumVariant(env, _this);
//printf("self=%x\n", self);
if(self == NULL)
return 0;
ULONG count = (ULONG)env->GetArrayLength(vars);
if(count == 0)
return 0;
VARIANT* sink = (VARIANT*)CoTaskMemAlloc(count * sizeof(VARIANT));
ULONG fetchCount = 0;
HRESULT hr = self->Next(count, sink, &fetchCount);
if(FAILED(hr))
{
CoTaskMemFree(sink);
ThrowComFail(env, "IEnumVARIANT::Next", hr);
return 0;
}
// prepare a new return value array
//
jclass clazz = env->FindClass("com/jacob/com/Variant");
jmethodID ctor = env->GetMethodID(clazz, "<init>", "()V");
for(ULONG idx = 0; idx < fetchCount; ++idx)
{
// construct a variant to return
//
jobject newVariant = env->NewObject(clazz, ctor);
VARIANT* v = extractVariant(env, newVariant);
VariantCopy(v, sink + idx);
env->SetObjectArrayElement(vars, idx, newVariant);
env->DeleteLocalRef(newVariant);
//Sourceforge-1674179 fix memory leak
// Variants received while iterating IEnumVARIANT must be cleared when no longer needed
// The variant has been copied so no longer needed
VariantClear(sink);
}
CoTaskMemFree(sink);
return (jint)fetchCount;
}
JNIEXPORT void JNICALL
Java_com_jacob_com_EnumVariant_release(JNIEnv* env, jobject _this)
{
IEnumVARIANT* self = extractEnumVariant(env, _this);
if(self != NULL)
{
self->Release();
jfieldID FID_pIEnumVARIANT = 0;
jclass clazz = env->GetObjectClass(_this);
FID_pIEnumVARIANT = env->GetFieldID(clazz, "m_pIEnumVARIANT", "I");
env->SetIntField(_this, FID_pIEnumVARIANT, (unsigned int)0);
}
}
JNIEXPORT void JNICALL
Java_com_jacob_com_EnumVariant_Reset(JNIEnv* env, jobject _this)
{
IEnumVARIANT* self = extractEnumVariant(env, _this);
if(self == NULL)
return;
HRESULT hr = self->Reset();
if(FAILED(hr))
ThrowComFail(env, "IEnumVARIANT::Reset", hr);
}
JNIEXPORT void JNICALL
Java_com_jacob_com_EnumVariant_Skip(JNIEnv* env, jobject _this, jint count)
{
IEnumVARIANT* self = extractEnumVariant(env, _this);
if(self == NULL)
return;
HRESULT hr = self->Skip((ULONG)count);
if(FAILED(hr))
ThrowComFail(env, "IEnumVARIANT::Skip", hr);
}
}

View File

@@ -1,63 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _Included_EnumVariant
#define _Included_EnumVariant
#include <jni.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_jacob_com_EnumVariant
* Method: Next
* Signature: ([Lcom/jacob/com/Variant;)I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_EnumVariant_Next
(JNIEnv *, jobject, jobjectArray);
/*
* Class: com_jacob_com_EnumVariant
* Method: Release
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_EnumVariant_release
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_EnumVariant
* Method: Reset
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_EnumVariant_Reset
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_EnumVariant
* Method: Skip
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_EnumVariant_Skip
(JNIEnv *, jobject, jint);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,870 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "EventProxy.h"
#include "Variant.h"
// hook myself up as a listener for delegate
EventProxy::EventProxy(JNIEnv *env,
jobject aSinkObj,
CComPtr<IConnectionPoint> pConn,
IID eid,
CComBSTR mName[],
DISPID mID[],
int mNum) :
// initialize some variables
m_cRef(0), pCP(pConn),
eventIID(eid), MethNum(mNum), MethName(mName),
MethID(mID)
{
// keep a pointer to the sink
javaSinkObj = env->NewGlobalRef(aSinkObj);
if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear();}
// we need this to attach to the event invocation thread
env->GetJavaVM(&jvm);
if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear();}
AddRef();
Connect(env);
}
void EventProxy::Connect(JNIEnv *env) {
HRESULT hr = pCP->Advise(this, &dwEventCookie);
if (SUCCEEDED(hr)) {
connected = 1;
} else {
connected = 0;
ThrowComFail(env, "Advise failed", hr);
}
}
// unhook myself up as a listener and get rid of delegate
EventProxy::~EventProxy()
{
JNIEnv *env;
Disconnect();
jint vmConnectionStatus = JNI_EVERSION ;
jint attachReturnStatus = -1; // AttachCurrentThread return status.. negative numbers are failure return codes.
// attach to the current running thread -- JDK 1.4 jni.h has two param cover for 3 param call
vmConnectionStatus = jvm->GetEnv((void **)&env, JNI_VERSION_1_2);
if ((env != NULL)&& env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear();}
if (vmConnectionStatus == JNI_EDETACHED){
//printf("Unhook: Attaching to current thread using JNI Version 1.2 (%d)\n",vmConnectionStatus);
JavaVMAttachArgs attachmentArgs;
attachmentArgs.version = JNI_VERSION_1_2;
attachmentArgs.name = NULL;
attachmentArgs.group = NULL;
attachReturnStatus = jvm->AttachCurrentThread((void **)&env, &attachmentArgs);
if ((env != NULL) && env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear();}
} else {
// should really look for JNI_OK versus an error because it could have been JNI_EVERSION
// started method with thread hooked to VM so no need to attach again
//printf("Unhook: No need to attach because already attached %d\n",vmConnectionStatus);
}
// we should always have an env by this point but lets be paranoid and check
if (env != NULL){
env->DeleteGlobalRef(javaSinkObj);
if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear();}
}
if (MethNum) {
delete [] MethName;
delete [] MethID;
}
// detach from thread only if we attached to it in this function
if (attachReturnStatus == 0){
jvm->DetachCurrentThread();
//printf("Unhook: Detached\n");
} else {
//printf("Unhook: No need to detatch because attached prior to method\n");
}
//fflush(stdout);
}
void EventProxy::Disconnect() {
if (connected) {
pCP->Unadvise(dwEventCookie);
}
}
// I only support the eventIID interface which was passed in
// by the DispatchEvent wrapper who looked it up as the
// source object's default source interface
STDMETHODIMP EventProxy::QueryInterface(REFIID rid, void **ppv)
{
if (rid == IID_IUnknown || rid == eventIID || rid == IID_IDispatch)
{
*ppv = this;
AddRef();
return S_OK;
}
return E_NOINTERFACE;
}
// This should never get called - the event source fires events
// by dispid's, not by name
STDMETHODIMP EventProxy::GetIDsOfNames(REFIID riid,
OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgDispID)
{
return E_UNEXPECTED;
}
// The actual callback from the connection point arrives here
STDMETHODIMP EventProxy::Invoke(DISPID dispID, REFIID riid,
LCID lcid, unsigned short wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
const char *eventMethodName = NULL; //Sourceforge report 1394001
JNIEnv *env = NULL;
// map dispID to jmethodID
for(int i=0;i<MethNum;i++)
{
if (MethID[i] == dispID) {
USES_CONVERSION;
eventMethodName = W2A((OLECHAR *)MethName[i]);
}
}
// added 1.12
if (!eventMethodName) {
// just bail if can't find signature. no need to attach
// printf("Invoke: didn't find method name for dispatch id %d\n",dispID);
return S_OK;
}
if (DISPATCH_METHOD & wFlags)
{
// attach to the current running thread
//printf("Invoke: Attaching to current thread using JNI Version 1.2\n");
JavaVMAttachArgs attachmentArgs;
attachmentArgs.version = JNI_VERSION_1_2;
attachmentArgs.name = NULL;
attachmentArgs.group = NULL;
jvm->AttachCurrentThread((void **)&env, &attachmentArgs);
if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear();}
if (!eventMethodName)
{
// could not find this signature in list
// printf("Invoke: didn't find method name for dispatch id %d\n",dispID);
// this probably leaves a native thread attached to the vm when we don't want it
ThrowComFail(env, "Event method received was not defined as part of callback interface", -1);
// should we detatch before returning?? We probably never get here if we ThrowComFail()
// jvm->DetachCurrentThread();
return S_OK;
}
// find the class of the InvocationHandler
jclass javaSinkClass = env->GetObjectClass(javaSinkObj);
if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear();}
//printf("Invoke: Got sink class\n");
jmethodID invokeMethod;
invokeMethod = env->GetMethodID(javaSinkClass, "invoke", "(Ljava/lang/String;[Lcom/jacob/com/Variant;)Lcom/jacob/com/Variant;");
if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear();}
jstring eventMethodNameAsString = env->NewStringUTF(eventMethodName);
//printf("Invoke: Got method name\n");
// now do what we need for the variant
jmethodID getVariantMethod = env->GetMethodID(javaSinkClass, "getVariant", "()Lcom/jacob/com/Variant;");
if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear();}
//printf("Invoke: Found way too getVariant\n");
jobject aVariantObj = env->CallObjectMethod(javaSinkObj, getVariantMethod);
if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear();}
//printf("Invoke: Made Variant\n");
jclass variantClass = env->GetObjectClass(aVariantObj);
if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear();}
// create the variant parameter array
// how many params
int numVariantParams = pDispParams->cArgs;
// make an array of them
jobjectArray varr = env->NewObjectArray(numVariantParams, variantClass, 0);
if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear();}
//printf("Invoke: Created Array\n");
int i,j;
for(i=numVariantParams-1,j=0;i>=0;i--,j++)
{
// construct a java variant holder
jobject arg = env->CallObjectMethod(javaSinkObj, getVariantMethod);
if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear();}
// get the empty variant from it
VARIANT *va = extractVariant(env, arg);
// copy the value
VariantCopy(va, &pDispParams->rgvarg[i]);
// put it in the array
env->SetObjectArrayElement(varr, j, arg);
env->DeleteLocalRef(arg);
if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear();}
}
//printf("Invoke: Filled Array\n");
// Set up the return value
jobject ret;
ret = env->CallObjectMethod(javaSinkObj, invokeMethod,
eventMethodNameAsString, varr);
//printf("Invoke: Invoked callback\n");
if (!env->ExceptionOccurred() && ret != NULL) {
VariantCopy(pVarResult, extractVariant(env,ret));
}
if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear();}
// don't need the first variant we created to get the class
// SF 1689061 change not accepted but put in as comment for later reminder
//Java_com_jacob_com_Variant_release(env, aVariantObj);
env->DeleteLocalRef(aVariantObj);
if (env->ExceptionOccurred()) { env->ExceptionDescribe(); env->ExceptionClear();}
// Begin code from Jiffie team that copies parameters back from java to COM
for(i=numVariantParams-1,j=0;i>=0;i--,j++)
{
jobject arg = env->GetObjectArrayElement(varr, j);
VARIANT *java = extractVariant(env, arg);
VARIANT *com = &pDispParams->rgvarg[i];
convertJavaVariant(java, com);
// SF 1689061 change not accepted but put in as comment for later reminder
//Java_com_jacob_com_Variant_release(env, arg);
zeroVariant(env, arg);
env->DeleteLocalRef(arg);
}
// End code from Jiffie team that copies parameters back from java to COM
// detach from thread
//printf("Invoke: Detatching\n");
jvm->DetachCurrentThread();
//fflush(stdout);
return S_OK;
}
return E_NOINTERFACE;
}
void EventProxy::convertJavaVariant(VARIANT *java, VARIANT *com) {
switch (com->vt)
{
case VT_DISPATCH:
{
switch (java->vt)
{
case VT_DISPATCH:
{
V_DISPATCH(com) = V_DISPATCH(java);
break;
}
case VT_DISPATCH | VT_BYREF:
{
V_DISPATCH(com) = *V_DISPATCHREF(java);
break;
}
}
break;
}
case VT_DISPATCH | VT_BYREF:
{
switch (java->vt)
{
case VT_DISPATCH:
{
*V_DISPATCHREF(com) = V_DISPATCH(java);
break;
}
case VT_DISPATCH | VT_BYREF:
{
*V_DISPATCHREF(com) = *V_DISPATCHREF(java);
break;
}
}
break;
}
case VT_BOOL:
{
switch (java->vt)
{
case VT_BOOL:
{
V_BOOL(com) = V_BOOL(java);
break;
}
case VT_BOOL | VT_BYREF:
{
V_BOOL(com) = *V_BOOLREF(java);
break;
}
}
break;
}
case VT_BOOL | VT_BYREF:
{
switch (java->vt)
{
case VT_BOOL:
{
*V_BOOLREF(com) = V_BOOL(java);
break;
}
case VT_BOOL | VT_BYREF:
{
*V_BOOLREF(com) = *V_BOOLREF(java);
break;
}
}
break;
}
case VT_UI1:
{
switch (java->vt)
{
case VT_UI1:
{
V_UI1(com) = V_UI1(java);
break;
}
case VT_UI1 | VT_BYREF:
{
V_UI1(com) = *V_UI1REF(java);
break;
}
}
break;
}
case VT_UI1 | VT_BYREF:
{
switch (java->vt)
{
case VT_UI1:
{
*V_UI1REF(com) = V_UI1(java);
break;
}
case VT_UI1 | VT_BYREF:
{
*V_UI1REF(com) = *V_UI1REF(java);
break;
}
}
break;
}
case VT_I2:
{
switch (java->vt)
{
case VT_I2:
{
V_I2(com) = V_I2(java);
break;
}
case VT_I2 | VT_BYREF:
{
V_I2(com) = *V_I2REF(java);
break;
}
}
break;
}
case VT_I2 | VT_BYREF:
{
switch (java->vt)
{
case VT_I2:
{
*V_I2REF(com) = V_I2(java);
break;
}
case VT_I2 | VT_BYREF:
{
*V_I2REF(com) = *V_I2REF(java);
break;
}
}
break;
}
case VT_I4:
{
switch (java->vt)
{
case VT_I4:
{
V_I4(com) = V_I4(java);
break;
}
case VT_I4 | VT_BYREF:
{
V_I4(com) = *V_I4REF(java);
break;
}
}
break;
}
case VT_I4 | VT_BYREF:
{
switch (java->vt)
{
case VT_I4:
{
*V_I4REF(com) = V_I4(java);
break;
}
case VT_I4 | VT_BYREF:
{
*V_I4REF(com) = *V_I4REF(java);
break;
}
}
break;
}
case VT_R4:
{
switch (java->vt)
{
case VT_R4:
{
V_R4(com) = V_R4(java);
break;
}
case VT_R4 | VT_BYREF:
{
V_R4(com) = *V_R4REF(java);
break;
}
}
break;
}
case VT_R4 | VT_BYREF:
{
switch (java->vt)
{
case VT_R4:
{
*V_R4REF(com) = V_R4(java);
break;
}
case VT_R4 | VT_BYREF:
{
*V_R4REF(com) = *V_R4REF(java);
break;
}
}
break;
}
case VT_R8:
{
switch (java->vt)
{
case VT_R8:
{
V_R8(com) = V_R8(java);
break;
}
case VT_R8 | VT_BYREF:
{
V_R8(com) = *V_R8REF(java);
break;
}
}
break;
}
case VT_R8 | VT_BYREF:
{
switch (java->vt)
{
case VT_R8:
{
*V_R8REF(com) = V_R8(java);
break;
}
case VT_R8 | VT_BYREF:
{
*V_R8REF(com) = *V_R8REF(java);
break;
}
}
break;
}
case VT_I1:
{
switch (java->vt)
{
case VT_I1:
{
V_I1(com) = V_I1(java);
break;
}
case VT_I1 | VT_BYREF:
{
V_I1(com) = *V_I1REF(java);
break;
}
}
break;
}
case VT_I1 | VT_BYREF:
{
switch (java->vt)
{
case VT_I1:
{
*V_I1REF(com) = V_I1(java);
break;
}
case VT_I1 | VT_BYREF:
{
*V_I1REF(com) = *V_I1REF(java);
break;
}
}
break;
}
case VT_UI2:
{
switch (java->vt)
{
case VT_UI2:
{
V_UI2(com) = V_UI2(java);
break;
}
case VT_UI2 | VT_BYREF:
{
V_UI2(com) = *V_UI2REF(java);
break;
}
}
break;
}
case VT_UI2 | VT_BYREF:
{
switch (java->vt)
{
case VT_UI2:
{
*V_UI2REF(com) = V_UI2(java);
break;
}
case VT_UI2 | VT_BYREF:
{
*V_UI2REF(com) = *V_UI2REF(java);
break;
}
}
break;
}
case VT_UI4:
{
switch (java->vt)
{
case VT_UI4:
{
V_UI4(com) = V_UI4(java);
break;
}
case VT_UI4 | VT_BYREF:
{
V_UI4(com) = *V_UI4REF(java);
break;
}
}
break;
}
case VT_UI4 | VT_BYREF:
{
switch (java->vt)
{
case VT_UI4:
{
*V_UI4REF(com) = V_UI4(java);
break;
}
case VT_UI4 | VT_BYREF:
{
*V_UI4REF(com) = *V_UI4REF(java);
break;
}
}
break;
}
case VT_INT:
{
switch (java->vt)
{
case VT_INT:
{
V_INT(com) = V_INT(java);
break;
}
case VT_INT | VT_BYREF:
{
V_INT(com) = *V_INTREF(java);
break;
}
}
break;
}
case VT_INT | VT_BYREF:
{
switch (java->vt)
{
case VT_INT:
{
*V_INTREF(com) = V_INT(java);
break;
}
case VT_INT | VT_BYREF:
{
*V_INTREF(com) = *V_INTREF(java);
break;
}
}
break;
}
case VT_UINT:
{
switch (java->vt)
{
case VT_UINT:
{
V_UINT(com) = V_UINT(java);
break;
}
case VT_UINT | VT_BYREF:
{
V_UINT(com) = *V_UINTREF(java);
break;
}
}
break;
}
case VT_UINT | VT_BYREF:
{
switch (java->vt)
{
case VT_UINT:
{
*V_UINTREF(com) = V_UINT(java);
break;
}
case VT_UINT | VT_BYREF:
{
*V_UINTREF(com) = *V_UINTREF(java);
break;
}
}
break;
}
case VT_CY:
{
switch (java->vt)
{
case VT_CY:
{
V_CY(com) = V_CY(java);
break;
}
case VT_CY | VT_BYREF:
{
V_CY(com) = *V_CYREF(java);
break;
}
}
break;
}
case VT_CY | VT_BYREF:
{
switch (java->vt)
{
case VT_CY:
{
*V_CYREF(com) = V_CY(java);
break;
}
case VT_CY | VT_BYREF:
{
*V_CYREF(com) = *V_CYREF(java);
break;
}
}
break;
}
case VT_DATE:
{
switch (java->vt)
{
case VT_DATE:
{
V_DATE(com) = V_DATE(java);
break;
}
case VT_DATE | VT_BYREF:
{
V_DATE(com) = *V_DATEREF(java);
break;
}
}
break;
}
case VT_DATE | VT_BYREF:
{
switch (java->vt)
{
case VT_DATE:
{
*V_DATEREF(com) = V_DATE(java);
break;
}
case VT_DATE | VT_BYREF:
{
*V_DATEREF(com) = *V_DATEREF(java);
break;
}
}
break;
}
case VT_BSTR:
{
switch (java->vt)
{
case VT_BSTR:
{
V_BSTR(com) = V_BSTR(java);
break;
}
case VT_BSTR | VT_BYREF:
{
V_BSTR(com) = *V_BSTRREF(java);
break;
}
}
break;
}
case VT_BSTR | VT_BYREF:
{
switch (java->vt)
{
case VT_BSTR:
{
*V_BSTRREF(com) = V_BSTR(java);
break;
}
case VT_BSTR | VT_BYREF:
{
*V_BSTRREF(com) = *V_BSTRREF(java);
break;
}
}
break;
}
case VT_DECIMAL:
{
switch (java->vt)
{
case VT_DECIMAL:
{
V_DECIMAL(com) = V_DECIMAL(java);
break;
}
case VT_DECIMAL | VT_BYREF:
{
V_DECIMAL(com) = *V_DECIMALREF(java);
break;
}
}
break;
}
case VT_DECIMAL | VT_BYREF:
{
switch (java->vt)
{
case VT_DECIMAL:
{
*V_DECIMALREF(com) = V_DECIMAL(java);
break;
}
case VT_DECIMAL | VT_BYREF:
{
*V_DECIMALREF(com) = *V_DECIMALREF(java);
break;
}
}
break;
}
}
}

View File

@@ -1,101 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <jni.h>
#include <windows.h>
#include <objbase.h>
#include <oleauto.h>
#include <olectl.h>
#include "stdafx.h"
#include "util.h"
/*
* An instance of this class stands between a connection point
* and a java object. When it gets invoked from the cp, it reflects
* the call into the java object dynamically. The eventIID is passed
* in as are the valid dispids and the corresponding names. A map
* is created between the dispids and the java object's method in
* the constructor. For now, all the java event methods have to have
* the same signature: <name>(Variant[])
*/
class EventProxy : public IDispatch
{
private:
int connected;
LONG m_cRef; // a reference counter
CComPtr<IConnectionPoint> pCP; // the connection point
DWORD dwEventCookie; // connection point cookie
jobject javaSinkObj; // the java object to delegate calls
IID eventIID; // the interface iid passed in
int MethNum; // number of methods in the callback interface
CComBSTR *MethName; // Array of method names
DISPID *MethID; // Array of method ids, used to match invokations to method names
JavaVM *jvm; // The java vm we are running
void convertJavaVariant(VARIANT *java, VARIANT *com);
void Connect(JNIEnv *env);
void Disconnect();
public:
// constuct with a global JNI ref to a sink object
// to which we will delegate event callbacks
EventProxy(JNIEnv *jenv,
jobject aSinkObj,
CComPtr<IConnectionPoint> pConn,
IID eventIID,
CComBSTR *mName,
DISPID *mID,
int mNum);
~EventProxy();
// IUnknown methods
STDMETHODIMP_(ULONG) AddRef(void)
{
LONG res = InterlockedIncrement(&m_cRef);
return res;
}
STDMETHODIMP_(ULONG) Release(void)
{
LONG res = InterlockedDecrement(&m_cRef);
if (res == 0) {
delete this;
}
return res;
}
STDMETHODIMP QueryInterface(REFIID rid, void **ppv);
// IDispatch methods
STDMETHODIMP GetTypeInfoCount(UINT *num)
{
*num = 0;
return S_OK;
}
STDMETHODIMP GetTypeInfo(UINT, LCID, ITypeInfo **pptInfo)
{
*pptInfo=NULL;
return E_NOTIMPL;
}
// These are the actual supported methods
STDMETHODIMP GetIDsOfNames(REFIID, OLECHAR **, UINT, LCID , DISPID *);
STDMETHODIMP Invoke(DISPID, REFIID, LCID, WORD , DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *);
};

View File

@@ -1,63 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "stdafx.h"
#include <objbase.h>
#include "ComThread.h"
// Win32 support for Ole Automation
#include <wchar.h>
#include <string.h>
#include <atlbase.h>
#include <oleauto.h>
#include <olectl.h>
#include "util.h"
extern "C"
{
JNIEXPORT void JNICALL Java_com_jacob_com_STA_doMessagePump
(JNIEnv *env, jobject obj)
{
// store the current thread id so we can kill it
jclass argClass = env->GetObjectClass(obj);
jfieldID ajf = env->GetFieldID( argClass, "threadID", "I");
jint threadID = (jint)GetCurrentThreadId();
env->SetIntField(obj, ajf, threadID);
MSG msg;
ZeroMemory(&msg, sizeof(msg));
msg.wParam = S_OK;
while (GetMessage(&msg, NULL, 0, 0))
{
DispatchMessage(&msg);
}
}
JNIEXPORT void JNICALL Java_com_jacob_com_STA_quitMessagePump
(JNIEnv *env, jobject obj)
{
jclass argClass = env->GetObjectClass(obj);
jfieldID ajf = env->GetFieldID( argClass, "threadID", "I");
jint threadID = env->GetIntField(obj, ajf);
PostThreadMessage((DWORD)threadID, WM_QUIT, 0, 0);
}
}

View File

@@ -1,47 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <jni.h>
/* Header for class STA */
#ifndef _Included_com_jacob_com_STA
#define _Included_com_jacob_com_STA
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_jacob_com_STA
* Method: doMessagePump
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_STA_doMessagePump
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_STA
* Method: quitMessagePump
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_STA_quitMessagePump
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,940 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <jni.h>
/* Header for class com_jacob_com_SafeArray */
#ifndef _Included_com_jacob_com_SafeArray
#define _Included_com_jacob_com_SafeArray
#ifdef __cplusplus
extern "C" {
#endif
/* Inaccessible static: buildVersion */
/* Inaccessible static: buildDate */
/* Inaccessible static: DEBUG */
/* Inaccessible static: class_00024com_00024jacob_00024com_00024JacobObject */
/*
* Class: com_jacob_com_SafeArray
* Method: init
* Signature: (I[I[I)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_init
(JNIEnv *, jobject, jint, jintArray, jintArray);
/*
* Class: com_jacob_com_SafeArray
* Method: clone
* Signature: ()Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_com_jacob_com_SafeArray_clone
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: destroy
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_destroy
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: getvt
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_SafeArray_getvt
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: reinit
* Signature: (Lcom/jacob/com/SafeArray;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_reinit
(JNIEnv *, jobject, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: reinterpretType
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_reinterpretType
(JNIEnv *, jobject, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getLBound
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_SafeArray_getLBound__
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: getLBound
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_SafeArray_getLBound__I
(JNIEnv *, jobject, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getUBound
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_SafeArray_getUBound__
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: getUBound
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_SafeArray_getUBound__I
(JNIEnv *, jobject, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getNumDim
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_SafeArray_getNumDim
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: getFeatures
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_SafeArray_getFeatures
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: getElemSize
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_SafeArray_getElemSize
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: fromCharArray
* Signature: ([C)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_fromCharArray
(JNIEnv *, jobject, jcharArray);
/*
* Class: com_jacob_com_SafeArray
* Method: fromIntArray
* Signature: ([I)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_fromIntArray
(JNIEnv *, jobject, jintArray);
/*
* Class: com_jacob_com_SafeArray
* Method: fromLongArray
* Signature: ([L)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_fromLongArray
(JNIEnv *, jobject, jlongArray);
/*
* Class: com_jacob_com_SafeArray
* Method: fromShortArray
* Signature: ([S)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_fromShortArray
(JNIEnv *, jobject, jshortArray);
/*
* Class: com_jacob_com_SafeArray
* Method: fromDoubleArray
* Signature: ([D)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_fromDoubleArray
(JNIEnv *, jobject, jdoubleArray);
/*
* Class: com_jacob_com_SafeArray
* Method: fromStringArray
* Signature: ([Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_fromStringArray
(JNIEnv *, jobject, jobjectArray);
/*
* Class: com_jacob_com_SafeArray
* Method: fromByteArray
* Signature: ([B)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_fromByteArray
(JNIEnv *, jobject, jbyteArray);
/*
* Class: com_jacob_com_SafeArray
* Method: fromFloatArray
* Signature: ([F)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_fromFloatArray
(JNIEnv *, jobject, jfloatArray);
/*
* Class: com_jacob_com_SafeArray
* Method: fromBooleanArray
* Signature: ([Z)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_fromBooleanArray
(JNIEnv *, jobject, jbooleanArray);
/*
* Class: com_jacob_com_SafeArray
* Method: fromVariantArray
* Signature: ([Lcom/jacob/com/Variant;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_fromVariantArray
(JNIEnv *, jobject, jobjectArray);
/*
* Class: com_jacob_com_SafeArray
* Method: toCharArray
* Signature: ()[C
*/
JNIEXPORT jcharArray JNICALL Java_com_jacob_com_SafeArray_toCharArray
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: toIntArray
* Signature: ()[I
*/
JNIEXPORT jintArray JNICALL Java_com_jacob_com_SafeArray_toIntArray
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: toLongArray
* Signature: ()[L
*/
JNIEXPORT jlongArray JNICALL Java_com_jacob_com_SafeArray_toLongArray
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: toShortArray
* Signature: ()[S
*/
JNIEXPORT jshortArray JNICALL Java_com_jacob_com_SafeArray_toShortArray
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: toDoubleArray
* Signature: ()[D
*/
JNIEXPORT jdoubleArray JNICALL Java_com_jacob_com_SafeArray_toDoubleArray
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: toStringArray
* Signature: ()[Ljava/lang/String;
*/
JNIEXPORT jobjectArray JNICALL Java_com_jacob_com_SafeArray_toStringArray
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: toByteArray
* Signature: ()[B
*/
JNIEXPORT jbyteArray JNICALL Java_com_jacob_com_SafeArray_toByteArray
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: toFloatArray
* Signature: ()[F
*/
JNIEXPORT jfloatArray JNICALL Java_com_jacob_com_SafeArray_toFloatArray
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: toBooleanArray
* Signature: ()[Z
*/
JNIEXPORT jbooleanArray JNICALL Java_com_jacob_com_SafeArray_toBooleanArray
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: toVariantArray
* Signature: ()[Lcom/jacob/com/Variant;
*/
JNIEXPORT jobjectArray JNICALL Java_com_jacob_com_SafeArray_toVariantArray
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: getChar
* Signature: (I)C
*/
JNIEXPORT jchar JNICALL Java_com_jacob_com_SafeArray_getChar__I
(JNIEnv *, jobject, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getChar
* Signature: (II)C
*/
JNIEXPORT jchar JNICALL Java_com_jacob_com_SafeArray_getChar__II
(JNIEnv *, jobject, jint, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setChar
* Signature: (IC)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setChar__IC
(JNIEnv *, jobject, jint, jchar);
/*
* Class: com_jacob_com_SafeArray
* Method: setChar
* Signature: (IIC)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setChar__IIC
(JNIEnv *, jobject, jint, jint, jchar);
/*
* Class: com_jacob_com_SafeArray
* Method: getChars
* Signature: (II[CI)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_getChars
(JNIEnv *, jobject, jint, jint, jcharArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setChars
* Signature: (II[CI)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setChars
(JNIEnv *, jobject, jint, jint, jcharArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getInt
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_SafeArray_getInt__I
(JNIEnv *, jobject, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getInt
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_SafeArray_getInt__II
(JNIEnv *, jobject, jint, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setInt
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setInt__II
(JNIEnv *, jobject, jint, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setInt
* Signature: (III)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setInt__III
(JNIEnv *, jobject, jint, jint, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getInts
* Signature: (II[II)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_getInts
(JNIEnv *, jobject, jint, jint, jintArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setInts
* Signature: (II[II)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setInts
(JNIEnv *, jobject, jint, jint, jintArray, jint);
/*
* Class: SafeArray
* Method: getLong
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL Java_com_jacob_com_SafeArray_getLong__I
(JNIEnv *env, jobject _this, jint idx);
/*
* Class: SafeArray
* Method: getLong
* Signature: (II)J
*/
JNIEXPORT jlong JNICALL Java_com_jacob_com_SafeArray_getLong__II
(JNIEnv *env, jobject _this, jint i, jint j);
/*
* Class: SafeArray
* Method: setLong
* Signature: (IJ)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setLong__IJ
(JNIEnv *env, jobject _this, jint idx, jlong c);
/*
* Class: SafeArray
* Method: setLong
* Signature: (IIJ)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setLong__IIJ
(JNIEnv *env, jobject _this, jint i, jint j, jlong c);
/*
* Class: SafeArray
* Method: getLongs
* Signature: (II[JI)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_getLongs
(JNIEnv *env, jobject _this, jint idx, jint nelem, jlongArray ja, jint ja_start);
/*
* Class: SafeArray
* Method: setLongs
* Signature: (II[JI)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setLongs
(JNIEnv *env, jobject _this, jint idx, jint nelem, jlongArray ja, jint ja_start);
/*
* Class: com_jacob_com_SafeArray
* Method: getShort
* Signature: (I)S
*/
JNIEXPORT jshort JNICALL Java_com_jacob_com_SafeArray_getShort__I
(JNIEnv *, jobject, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getShort
* Signature: (II)S
*/
JNIEXPORT jshort JNICALL Java_com_jacob_com_SafeArray_getShort__II
(JNIEnv *, jobject, jint, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setShort
* Signature: (IS)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setShort__IS
(JNIEnv *, jobject, jint, jshort);
/*
* Class: com_jacob_com_SafeArray
* Method: setShort
* Signature: (IIS)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setShort__IIS
(JNIEnv *, jobject, jint, jint, jshort);
/*
* Class: com_jacob_com_SafeArray
* Method: getShorts
* Signature: (II[SI)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_getShorts
(JNIEnv *, jobject, jint, jint, jshortArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setShorts
* Signature: (II[SI)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setShorts
(JNIEnv *, jobject, jint, jint, jshortArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getDouble
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL Java_com_jacob_com_SafeArray_getDouble__I
(JNIEnv *, jobject, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getDouble
* Signature: (II)D
*/
JNIEXPORT jdouble JNICALL Java_com_jacob_com_SafeArray_getDouble__II
(JNIEnv *, jobject, jint, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setDouble
* Signature: (ID)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setDouble__ID
(JNIEnv *, jobject, jint, jdouble);
/*
* Class: com_jacob_com_SafeArray
* Method: setDouble
* Signature: (IID)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setDouble__IID
(JNIEnv *, jobject, jint, jint, jdouble);
/*
* Class: com_jacob_com_SafeArray
* Method: getDoubles
* Signature: (II[DI)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_getDoubles
(JNIEnv *, jobject, jint, jint, jdoubleArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setDoubles
* Signature: (II[DI)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setDoubles
(JNIEnv *, jobject, jint, jint, jdoubleArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getString
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_jacob_com_SafeArray_getString__I
(JNIEnv *, jobject, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getString
* Signature: (II)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_jacob_com_SafeArray_getString__II
(JNIEnv *, jobject, jint, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setString
* Signature: (ILjava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setString__ILjava_lang_String_2
(JNIEnv *, jobject, jint, jstring);
/*
* Class: com_jacob_com_SafeArray
* Method: setString
* Signature: (IILjava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setString__IILjava_lang_String_2
(JNIEnv *, jobject, jint, jint, jstring);
/*
* Class: com_jacob_com_SafeArray
* Method: getStrings
* Signature: (II[Ljava/lang/String;I)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_getStrings
(JNIEnv *, jobject, jint, jint, jobjectArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setStrings
* Signature: (II[Ljava/lang/String;I)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setStrings
(JNIEnv *, jobject, jint, jint, jobjectArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getByte
* Signature: (I)B
*/
JNIEXPORT jbyte JNICALL Java_com_jacob_com_SafeArray_getByte__I
(JNIEnv *, jobject, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getByte
* Signature: (II)B
*/
JNIEXPORT jbyte JNICALL Java_com_jacob_com_SafeArray_getByte__II
(JNIEnv *, jobject, jint, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setByte
* Signature: (IB)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setByte__IB
(JNIEnv *, jobject, jint, jbyte);
/*
* Class: com_jacob_com_SafeArray
* Method: setByte
* Signature: (IIB)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setByte__IIB
(JNIEnv *, jobject, jint, jint, jbyte);
/*
* Class: com_jacob_com_SafeArray
* Method: getBytes
* Signature: (II[BI)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_getBytes
(JNIEnv *, jobject, jint, jint, jbyteArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setBytes
* Signature: (II[BI)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setBytes
(JNIEnv *, jobject, jint, jint, jbyteArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getFloat
* Signature: (I)F
*/
JNIEXPORT jfloat JNICALL Java_com_jacob_com_SafeArray_getFloat__I
(JNIEnv *, jobject, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getFloat
* Signature: (II)F
*/
JNIEXPORT jfloat JNICALL Java_com_jacob_com_SafeArray_getFloat__II
(JNIEnv *, jobject, jint, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setFloat
* Signature: (IF)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setFloat__IF
(JNIEnv *, jobject, jint, jfloat);
/*
* Class: com_jacob_com_SafeArray
* Method: setFloat
* Signature: (IIF)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setFloat__IIF
(JNIEnv *, jobject, jint, jint, jfloat);
/*
* Class: com_jacob_com_SafeArray
* Method: getFloats
* Signature: (II[FI)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_getFloats
(JNIEnv *, jobject, jint, jint, jfloatArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setFloats
* Signature: (II[FI)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setFloats
(JNIEnv *, jobject, jint, jint, jfloatArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getBoolean
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_com_jacob_com_SafeArray_getBoolean__I
(JNIEnv *, jobject, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getBoolean
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_com_jacob_com_SafeArray_getBoolean__II
(JNIEnv *, jobject, jint, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setBoolean
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setBoolean__IZ
(JNIEnv *, jobject, jint, jboolean);
/*
* Class: com_jacob_com_SafeArray
* Method: setBoolean
* Signature: (IIZ)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setBoolean__IIZ
(JNIEnv *, jobject, jint, jint, jboolean);
/*
* Class: com_jacob_com_SafeArray
* Method: getBooleans
* Signature: (II[ZI)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_getBooleans
(JNIEnv *, jobject, jint, jint, jbooleanArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setBooleans
* Signature: (II[ZI)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setBooleans
(JNIEnv *, jobject, jint, jint, jbooleanArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getVariant
* Signature: (I)Lcom/jacob/com/Variant;
*/
JNIEXPORT jobject JNICALL Java_com_jacob_com_SafeArray_getVariant__I
(JNIEnv *, jobject, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getVariant
* Signature: (II)Lcom/jacob/com/Variant;
*/
JNIEXPORT jobject JNICALL Java_com_jacob_com_SafeArray_getVariant__II
(JNIEnv *, jobject, jint, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setVariant
* Signature: (ILcom/jacob/com/Variant;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setVariant__ILcom_jacob_com_Variant_2
(JNIEnv *, jobject, jint, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: setVariant
* Signature: (IILcom/jacob/com/Variant;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setVariant__IILcom_jacob_com_Variant_2
(JNIEnv *, jobject, jint, jint, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: getVariants
* Signature: (II[Lcom/jacob/com/Variant;I)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_getVariants
(JNIEnv *, jobject, jint, jint, jobjectArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: setVariants
* Signature: (II[Lcom/jacob/com/Variant;I)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setVariants
(JNIEnv *, jobject, jint, jint, jobjectArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getVariant
* Signature: ([I)Lcom/jacob/com/Variant;
*/
JNIEXPORT jobject JNICALL Java_com_jacob_com_SafeArray_getVariant___3I
(JNIEnv *, jobject, jintArray);
/*
* Class: com_jacob_com_SafeArray
* Method: setVariant
* Signature: ([ILcom/jacob/com/Variant;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setVariant___3ILcom_jacob_com_Variant_2
(JNIEnv *, jobject, jintArray, jobject);
/*
* Class: com_jacob_com_SafeArray
* Method: getChar
* Signature: ([I)C
*/
JNIEXPORT jchar JNICALL Java_com_jacob_com_SafeArray_getChar___3I
(JNIEnv *, jobject, jintArray);
/*
* Class: com_jacob_com_SafeArray
* Method: setChar
* Signature: ([IC)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setChar___3IC
(JNIEnv *, jobject, jintArray, jchar);
/*
* Class: com_jacob_com_SafeArray
* Method: getInt
* Signature: ([I)I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_SafeArray_getInt___3I
(JNIEnv *, jobject, jintArray);
/*
* Class: com_jacob_com_SafeArray
* Method: setInt
* Signature: ([II)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setInt___3II
(JNIEnv *, jobject, jintArray, jint);
/*
* Class: com_jacob_com_SafeArray
* Method: getLong
* Signature: ([I)J
*/
JNIEXPORT jlong JNICALL Java_com_jacob_com_SafeArray_getLong___3I
(JNIEnv *env, jobject _this, jintArray indices);
/*
* Class: com_jacob_com_SafeArray
* Method: setLong
* Signature: ([IJ)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setLong___3IJ
(JNIEnv *env, jobject _this, jintArray indices, jlong c);
/*
* Class: com_jacob_com_SafeArray
* Method: getShort
* Signature: ([I)S
*/
JNIEXPORT jshort JNICALL Java_com_jacob_com_SafeArray_getShort___3I
(JNIEnv *, jobject, jintArray);
/*
* Class: com_jacob_com_SafeArray
* Method: setShort
* Signature: ([IS)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setShort___3IS
(JNIEnv *, jobject, jintArray, jshort);
/*
* Class: com_jacob_com_SafeArray
* Method: getDouble
* Signature: ([I)D
*/
JNIEXPORT jdouble JNICALL Java_com_jacob_com_SafeArray_getDouble___3I
(JNIEnv *, jobject, jintArray);
/*
* Class: com_jacob_com_SafeArray
* Method: setDouble
* Signature: ([ID)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setDouble___3ID
(JNIEnv *, jobject, jintArray, jdouble);
/*
* Class: com_jacob_com_SafeArray
* Method: getString
* Signature: ([I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_jacob_com_SafeArray_getString___3I
(JNIEnv *, jobject, jintArray);
/*
* Class: com_jacob_com_SafeArray
* Method: setString
* Signature: ([ILjava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setString___3ILjava_lang_String_2
(JNIEnv *, jobject, jintArray, jstring);
/*
* Class: com_jacob_com_SafeArray
* Method: getByte
* Signature: ([I)B
*/
JNIEXPORT jbyte JNICALL Java_com_jacob_com_SafeArray_getByte___3I
(JNIEnv *, jobject, jintArray);
/*
* Class: com_jacob_com_SafeArray
* Method: setByte
* Signature: ([IB)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setByte___3IB
(JNIEnv *, jobject, jintArray, jbyte);
/*
* Class: com_jacob_com_SafeArray
* Method: getFloat
* Signature: ([I)F
*/
JNIEXPORT jfloat JNICALL Java_com_jacob_com_SafeArray_getFloat___3I
(JNIEnv *, jobject, jintArray);
/*
* Class: com_jacob_com_SafeArray
* Method: setFloat
* Signature: ([IF)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setFloat___3IF
(JNIEnv *, jobject, jintArray, jfloat);
/*
* Class: com_jacob_com_SafeArray
* Method: getBoolean
* Signature: ([I)Z
*/
JNIEXPORT jboolean JNICALL Java_com_jacob_com_SafeArray_getBoolean___3I
(JNIEnv *, jobject, jintArray);
/*
* Class: com_jacob_com_SafeArray
* Method: setBoolean
* Signature: ([IZ)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_SafeArray_setBoolean___3IZ
(JNIEnv *, jobject, jintArray, jboolean);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,51 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently
#if !defined(AFX_STDAFX_H__9988E984_6789_11D3_A646_000000000000__INCLUDED_)
#define AFX_STDAFX_H__9988E984_6789_11D3_A646_000000000000__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef STRICT
#define STRICT
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400
#endif
//#define _ATL_APARTMENT_THREADED
#include <windows.h>
#include <comdef.h>
#include <comutil.h>
#include <atlbase.h>
//You may derive a class from CComModule and use it if you want to override
//something, but do not change the name of _Module
extern CComModule _Module;
//#include <atlcom.h>
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__9988E984_6789_11D3_A646_000000000000__INCLUDED)

File diff suppressed because it is too large Load Diff

View File

@@ -1,605 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <jni.h>
/* Header for class com_jacob_com_Variant */
#ifndef _Included_com_jacob_com_Variant
#define _Included_com_jacob_com_Variant
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_jacob_com_Variant
* Method: toEnumVariant
* Signature: ()Lcom/jacob/com/EnumVariant;
*/
JNIEXPORT jobject JNICALL Java_com_jacob_com_Variant_toEnumVariant
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: putVariantNull
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantNull
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: cloneIndirect
* Signature: ()Lcom_jacob_com_Variant;
*/
JNIEXPORT jobject JNICALL Java_com_jacob_com_Variant_cloneIndirect
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: putVariantShortRef
* Signature: (S)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantShortRef
(JNIEnv *, jobject, jshort);
/*
* Class: com_jacob_com_Variant
* Method: putVariantIntRef
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantIntRef
(JNIEnv *, jobject, jint);
/*
* Class: com_jacob_com_Variant
* Method: putVariantDoubleRef
* Signature: (D)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantDoubleRef
(JNIEnv *, jobject, jdouble);
/*
* Class: com_jacob_com_Variant
* Method: putVariantDateRef
* Signature: (D)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantDateRef
(JNIEnv *, jobject, jdouble);
/*
* Class: com_jacob_com_Variant
* Method: putVariantStringRef
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantStringRef
(JNIEnv *, jobject, jstring);
/*
* Class: com_jacob_com_Variant
* Method: getVariantShortRef
* Signature: ()S
*/
JNIEXPORT jshort JNICALL Java_com_jacob_com_Variant_getVariantShortRef
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getVariantIntRef
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_Variant_getVariantIntRef
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: putVariantShort
* Signature: (S)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantShort
(JNIEnv *, jobject, jshort);
/*
* Class: com_jacob_com_Variant
* Method: getVariantShort
* Signature: ()S
*/
JNIEXPORT jshort JNICALL Java_com_jacob_com_Variant_getVariantShort
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getVariantDoubleRef
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL Java_com_jacob_com_Variant_getVariantDoubleRef
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getVariantDateRef
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL Java_com_jacob_com_Variant_getVariantDateRef
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getStringRef
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_jacob_com_Variant_getVariantStringRef
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: com_jacob_com_VariantClear
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_VariantClear
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: toDispatch
* Signature: ()LDispatch;
*/
JNIEXPORT jobject JNICALL Java_com_jacob_com_Variant_toVariantDispatch
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: clone
* Signature: ()Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_com_jacob_com_Variant_clone
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getVariantInt
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_Variant_getVariantInt
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getVariantDate
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL Java_com_jacob_com_Variant_getVariantDate
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: putVariantInt
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantInt
(JNIEnv *, jobject, jint);
/*
* Class: com_jacob_com_Variant
* Method: putVariantDate
* Signature: (D)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantDate
(JNIEnv *, jobject, jdouble);
/*
* Class: com_jacob_com_Variant
* Method: getVariantBoolean
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_com_jacob_com_Variant_getVariantBoolean
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getVariantByte
* Signature: ()B
*/
JNIEXPORT jbyte JNICALL Java_com_jacob_com_Variant_getVariantByte
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: putVariantBoolean
* Signature: (Z)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantBoolean
(JNIEnv *, jobject, jboolean);
/*
* Class: com_jacob_com_Variant
* Method: putVariantByte
* Signature: (B)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantByte
(JNIEnv *, jobject, jbyte);
/*
* Class: com_jacob_com_Variant
* Method: putVariantEmpty
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantEmpty
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: putVariantNothing
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantNothing
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getVariantError
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_Variant_getVariantError
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: putVariantError
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantError
(JNIEnv *, jobject, jint);
/*
* Class: com_jacob_com_Variant
* Method: getVariantDouble
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL Java_com_jacob_com_Variant_getVariantDouble
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: putVariantCurrency
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantCurrency
(JNIEnv *, jobject, jlong);
/*
* Class: com_jacob_com_Variant
* Method: putVariantLong
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantLong
(JNIEnv *, jobject, jlong);
/*
* Class: com_jacob_com_Variant
* Method: putVariantDispatch
* Signature: (Ljava/lang/Object;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantDispatch
(JNIEnv *, jobject, jobject);
/*
* Class: com_jacob_com_Variant
* Method: putVariantDouble
* Signature: (D)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantDouble
(JNIEnv *, jobject, jdouble);
/*
* Class: com_jacob_com_Variant
* Method: getVariantCurrency
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_com_jacob_com_Variant_getVariantCurrency
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getVariantLong
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_com_jacob_com_Variant_getVariantLong
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: putVariantFloatRef
* Signature: (F)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantFloatRef
(JNIEnv *, jobject, jfloat);
/*
* Class: com_jacob_com_Variant
* Method: putVariantCurrencyRef
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantCurrencyRef
(JNIEnv *, jobject, jlong);
/*
* Class: com_jacob_com_Variant
* Method: putVariantLongRef
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantLongRef
(JNIEnv *, jobject, jlong);
/*
* Class: com_jacob_com_Variant
* Method: putVariantErrorRef
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantErrorRef
(JNIEnv *, jobject, jint);
/*
* Class: com_jacob_com_Variant
* Method: putVariantBooleanRef
* Signature: (Z)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantBooleanRef
(JNIEnv *, jobject, jboolean);
/*
* Class: com_jacob_com_Variant
* Method: putObjectRef
* Signature: (Ljava/lang/Object;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putObjectRef
(JNIEnv *, jobject, jobject);
/*
* Class: com_jacob_com_Variant
* Method: putVariantByteRef
* Signature: (B)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantByteRef
(JNIEnv *, jobject, jbyte);
/*
* Class: com_jacob_com_Variant
* Method: getString
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_jacob_com_Variant_getVariantString
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: putVariantString
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantString
(JNIEnv *, jobject, jstring);
/*
* Class: com_jacob_com_Variant
* Method: getVariantFloatRef
* Signature: ()F
*/
JNIEXPORT jfloat JNICALL Java_com_jacob_com_Variant_getVariantFloatRef
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getVariantCurrencyRef
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_com_jacob_com_Variant_getVariantCurrencyRef
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getVariantLongRef
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_com_jacob_com_Variant_getVariantLongRef
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getVariantErrorRef
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_Variant_getVariantErrorRef
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getVariantBooleanRef
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_com_jacob_com_Variant_getVariantBooleanRef
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getVariantByteRef
* Signature: ()B
*/
JNIEXPORT jbyte JNICALL Java_com_jacob_com_Variant_getVariantByteRef
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: toVariantSafeArray
* Signature: (Z)Lcom/jacob/com/SafeArray;
*/
JNIEXPORT jobject JNICALL Java_com_jacob_com_Variant_toVariantSafeArray
(JNIEnv *, jobject, jboolean);
/*
* Class: com_jacob_com_Variant
* Method: putVariantSafeArrayRef
* Signature: (LSafeArray;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantSafeArrayRef
(JNIEnv *, jobject, jobject);
/*
* Class: com_jacob_com_Variant
* Method: putVariantSafeArray
* Signature: (LSafeArray;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantSafeArray
(JNIEnv *, jobject, jobject);
/*
* Class: com_jacob_com_Variant
* Method: putVariantNoParam
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantNoParam
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getVariantFloat
* Signature: ()F
*/
JNIEXPORT jfloat JNICALL Java_com_jacob_com_Variant_getVariantFloat
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: putVariantFloat
* Signature: (F)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantFloat
(JNIEnv *, jobject, jfloat);
/*
* Class: com_jacob_com_Variant
* Method: changeVariantType
* Signature: (S)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_changeVariantType
(JNIEnv *, jobject, jshort);
/*
* Class: com_jacob_com_Variant
* Method: getVariantType
* Signature: ()S
*/
JNIEXPORT jshort JNICALL Java_com_jacob_com_Variant_getVariantType
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: release
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_release
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: init
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_init
(JNIEnv *, jobject);
JNIEXPORT jbyteArray JNICALL Java_com_jacob_com_Variant_SerializationWriteToBytes
(JNIEnv *, jobject);
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_SerializationReadFromBytes
(JNIEnv *, jobject, jbyteArray);
/*
* Class: com_jacob_com_Variant
* Method: putVariantVariant
* Signature: (Lcom/jacob/com/Variant;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantVariant
(JNIEnv *, jobject, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getVariantVariant
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_jacob_com_Variant_getVariantVariant
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: putVariantDecRef
* Signature: (Ljava.math.BigDecimal;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantDecRef
(JNIEnv *env, jobject _this, jint signum, jbyte scale, jint lo, jint mid, jint hi);
/*
* Class: com_jacob_com_Variant
* Method: putVariantDec
* Signature: (Ljava.math.BigDecimal;)V
*/
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantDec
(JNIEnv *env, jobject _this, jint signum, jbyte scale, jint lo, jint mid, jint hi);
/*
* Class: com_jacob_com_Variant
* Method: getVariantDecRef
* Signature: ()Ljava.math.BigDecimal
*/
JNIEXPORT jobject JNICALL Java_com_jacob_com_Variant_getVariantDecRef
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: getVariantDec
* Signature: ()Ljava.math.BigDecimal
*/
JNIEXPORT jobject JNICALL Java_com_jacob_com_Variant_getVariantDec
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: isVariantConsideredNull
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_com_jacob_com_Variant_isVariantConsideredNull
(JNIEnv *, jobject);
/*
* Class: com_jacob_com_Variant
* Method: zeroVariant
* Signature: ()V
*
* This should only be used on variant objects created by the
* com layer as part of a call through EventProxy.
* This zeros out the variant pointer in the Variant object
* so that the calling COM program can free the memory.
* instead of both the COM program and the Java GC doing it.
*/
void zeroVariant (JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,75 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "Dispatch.h"
// Win32 support for Ole Automation
#include <wchar.h>
#include <string.h>
#include <atlbase.h>
#include <objbase.h>
#include <oleauto.h>
#include <olectl.h>
#include "util.h"
extern "C"
{
void ThrowComFail(JNIEnv *env, const char* desc, jint hr)
{
jclass failClass = env->FindClass("com/jacob/com/ComFailException");
// call the constructor that takes hr and message
jmethodID failCons =
env->GetMethodID(failClass, "<init>", "(ILjava/lang/String;)V");
if (!desc) {
desc = "Java/COM Error";
}
jstring js = env->NewStringUTF(desc);
jthrowable fail = (jthrowable)env->NewObject(failClass, failCons, hr, js);
env->Throw(fail);
}
void ThrowComFailUnicode(JNIEnv *env, const wchar_t* desc, jint hr)
{
if (!desc) {
ThrowComFail(env, "Java/COM Error", hr);
}
jclass failClass = env->FindClass("com/jacob/com/ComFailException");
// call the constructor that takes hr and message
jmethodID failCons =
env->GetMethodID(failClass, "<init>", "(ILjava/lang/String;)V");
jstring js = env->NewString((const jchar *) desc, wcslen(desc));
jthrowable fail = (jthrowable)env->NewObject(failClass, failCons, hr, js);
env->Throw(fail);
}
// if env's are different throw on the 1st env
int CheckEnv(JNIEnv *env1, JNIEnv *env2)
{
if (env1 != env2) {
jclass failClass = env1->FindClass("com/jacob/com/WrongThreadException");
// call the constructor that takes hr and message
jmethodID failCons =
env1->GetMethodID(failClass, "<init>", "()V");
env1->ThrowNew(failClass, "Wrong Thread");
return 0;
}
return 1;
}
}

View File

@@ -1,29 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <objbase.h>
extern "C" {
VARIANT *extractVariant(JNIEnv *env, jobject arg);
void ThrowComFail(JNIEnv *env, const char* desc, jint hr);
void ThrowComFailUnicode(JNIEnv *env, const wchar_t* desc, jint hr);
IDispatch *extractDispatch(JNIEnv *env, jobject arg);
SAFEARRAY *extractSA(JNIEnv *env, jobject arg);
void setSA(JNIEnv *env, jobject arg, SAFEARRAY *sa, int copy);
SAFEARRAY *copySA(SAFEARRAY *psa);
}

View File

@@ -1,2 +0,0 @@
Placeholder class to retain directory in CVS so build scripts will work.
Part of directory standardization effort with jacobgen

Binary file not shown.

View File

@@ -1,8 +0,0 @@
The ADO sample is a wrapper for the ADO classes. This demonstrates how
to write JACOB wrappers.
The applet sample shows how to use JACOB in an applet. The trick is to
initialize and use the COM object in the same thread.
The test directory has numerous tests that test various features
of the JACOB functionality.

View File

@@ -1,74 +0,0 @@
package com.jacob.samples.JavaWebStart;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import com.jacob.com.LibraryLoader;
/**
* It is sometimes necessary to run Jacob without being able to install the dll
* on the client machine. This is true in JavaWebStart (JWS) and possibly Applet
* (assuming security allows access to the file system). The obvious thing to do
* here is to jar up the Jacob.dll so that it can be downloaded the client along
* with the rest of the resources. This is simple except that the System.Load()
* function does not search jar files for DLLs. It searches the classpath. The
* work around to this problem is to write the DLL to a temporary file and then
* explicitly load the DLL calling passing the full path to the temporary file.
*
* The following code demonstrates this idea.
*
* @author joe
*
*/
public class DLLFromJARClassLoader {
/**
* Load the DLL from the classpath rather than from the java path. This code
* uses this class's class loader to find the dell in one of the jar files
* in this class's class path. It then writes the file as a temp file and
* calls Load() on the temp file. The temporary file is marked to be deleted
* on exit so the dll is deleted from the system when the application exits.
* <p>
* Derived from ample code found in Sun's java forums <p.
*
* @return true if the native library has loaded, false if there was a
* problem.
*/
public boolean loadLibrary() {
try {
// this assumes that the dll is in the root dir of the signed
// jws jar file for this application.
//
// Starting in 1.14M6, the dll is named by platform and architecture
// so the best thing to do is to ask the LibraryLoader what name we
// expect.
// this code might be different if you customize the name of
// the jacob dll to match some custom naming convention
InputStream inputStream = getClass().getResource(
"/" + LibraryLoader.getPreferredDLLName() + ".dll")
.openStream();
// Put the DLL somewhere we can find it with a name Jacob expects
File temporaryDll = File.createTempFile(LibraryLoader
.getPreferredDLLName(), ".dll");
FileOutputStream outputStream = new FileOutputStream(temporaryDll);
byte[] array = new byte[8192];
for (int i = inputStream.read(array); i != -1; i = inputStream
.read(array)) {
outputStream.write(array, 0, i);
}
outputStream.close();
temporaryDll.deleteOnExit();
// Ask LibraryLoader to load the dll for us based on the path we
// set
System.setProperty(LibraryLoader.JACOB_DLL_PATH, temporaryDll
.getPath());
LibraryLoader.loadJacobLibrary();
return true;
} catch (Throwable e) {
e.printStackTrace();
return false;
}
}
}

View File

@@ -1,37 +0,0 @@
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "Math"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'To fire this event, use RaiseEvent with the following syntax:
'RaiseEvent DoneAdd[(arg1, arg2, ... , argn)]
Public Event DoneAdd(result As Variant)
'To fire this event, use RaiseEvent with the following syntax:
'RaiseEvent DoneMult[(arg1, arg2, ... , argn)]
Public Event DoneMult(result As Variant)
Public Function Mult(in1 As Variant, in2 As Variant) As Variant
Mult = in1 * in2
RaiseEvent DoneMult(in1 * in2)
End Function
Public Function Add(in1 As Variant, in2 As Variant) As Variant
Add = in1 + in2
RaiseEvent DoneAdd(in1 + in2)
End Function
Public Function getNothing() As Variant
Set getNothing = Nothing
End Function

View File

@@ -1,83 +0,0 @@
package com.jacob.samples.MathProj;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Dispatch;
import com.jacob.com.DispatchEvents;
import com.jacob.com.Variant;
/**
* This example uses the MathTest sample VB COM DLL under the MathProj directory
* <p>
* May need to run with some command line options (including from inside
* Eclipse). Look in the docs area at the Jacob usage document for command line
* options.
*/
class MathTest {
/**
* standard main program to run the sample
*
* @param args
* command line parameters
*/
public static void main(String[] args) {
MathTest me = new MathTest();
me.runTest();
}
/** default constructor */
public MathTest() {
}
/**
* not clear why we need a class and run method but that's the way it was
* written
*/
public void runTest() {
// deprecated
// System.runFinalizersOnExit(true);
Dispatch test = new ActiveXComponent("MathTest.Math");
TestEvents te = new TestEvents();
DispatchEvents de = new DispatchEvents(test, te);
if (de == null) {
System.out
.println("null returned when trying to create DispatchEvents");
}
System.out.println(Dispatch.call(test, "Add", new Variant(1),
new Variant(2)));
System.out.println(Dispatch.call(test, "Mult", new Variant(2),
new Variant(2)));
Variant v = Dispatch.call(test, "Mult", new Variant(2), new Variant(2));
// this should return false
System.out.println("v.isNull=" + v.isNull());
v = Dispatch.call(test, "getNothing");
// these should return nothing
System.out.println("v.isNull=" + v.isNull());
System.out.println("v.toDispatch=" + v.toDispatch());
}
/**
*
* sample class to catch the events
*
*/
public class TestEvents {
/**
* catches the DoneAdd event
*
* @param args
*/
public void DoneAdd(Variant[] args) {
System.out.println("DoneAdd called in java");
}
/**
* catches the DoneMult event
*
* @param args
*/
public void DoneMult(Variant[] args) {
System.out.println("DoneMult called in java");
}
}
}

View File

@@ -1,35 +0,0 @@
Type=OleDll
Class=Math; Math.cls
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINNT\System32\StdOle2.Tlb#OLE Automation
Startup="(None)"
HelpFile=""
Title="MathTest"
ExeName32="MathTest.dll"
Command32=""
Name="MathTest"
HelpContextID="0"
CompatibleMode="1"
CompatibleEXE32="MathTest.dll"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="Inventure America, Inc."
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=1
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
ThreadingModel=1
DebugStartupOption=0

View File

@@ -1 +0,0 @@
Math = 75, 13, 656, 554,

View File

@@ -1,5 +0,0 @@
A Simple VB COM DLL that exposes two methods and raises events.
The dll must be registered with your system
Run --> regsvr32 <path>\com\jacob\test\MathProj\MathTest.dll

View File

@@ -1,144 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
package com.jacob.samples.access;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.ComThread;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
/**
* May need to run with some command line options (including from inside
* Eclipse). Look in the docs area at the Jacob usage document for command line
* options.
*
*/
class Access {
/**
* the main loop for the test
*
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
ComThread.InitSTA();
// original test used this
// ActiveXComponent ax = new ActiveXComponent("DAO.PrivateDBEngine");
// my xp box with a later release of access needed this
ActiveXComponent ax = new ActiveXComponent("DAO.PrivateDBEngine.35");
// this only works for access files pre-access-2000
// this line doesn't work on my xp box in Eclipse
// Dispatch db = open(ax, ".\\sample2.mdb");
// this works when running in eclipse because the test cases run pwd
// project root
Dispatch db = open(ax, "samples/com/jacob/samples/access/sample2.mdb");
String sql = "select * from MainTable";
// make a temporary querydef
Dispatch qd = Dispatch.call(db, "CreateQueryDef", "").toDispatch();
// set the SQL string on it
Dispatch.put(qd, "SQL", sql);
Variant result = getByQueryDef(qd);
// the 2-d safearray is transposed from what you might expect
System.out.println("resulting array is " + result.toSafeArray());
close(db);
System.out.println("about to call ComThread.Release()");
ComThread.Release();
}
/**
* Open a database
*
* @param ax
* @param fileName
* @return dispatch object that was opened
*/
public static Dispatch open(ActiveXComponent ax, String fileName) {
Variant f = new Variant(false);
// open the file in read-only mode
Variant[] args = new Variant[] { new Variant(fileName), f, f };
Dispatch openDB = ax.invoke("OpenDatabase", args).toDispatch();
return openDB;
}
/**
* Close a database
*
* @param openDB
* db to be closed
*/
public static void close(Dispatch openDB) {
Dispatch.call(openDB, "Close");
}
/**
* Extract the values from the recordset
*
* @param recset
* @return Variant that is the returned values
*/
public static Variant getValues(Dispatch recset) {
Dispatch.callSub(recset, "moveFirst");
Variant vi = new Variant(4096);
Variant v = Dispatch.call(recset, "GetRows", vi);
return v;
}
/**
* should return ?? for the passed in ??
*
* @param qd
* @return Variant results of query?
*/
public static Variant getByQueryDef(Dispatch qd) {
// get a reference to the recordset
Dispatch recset = Dispatch.call(qd, "OpenRecordset").toDispatch();
// get the values as a safe array
String[] cols = getColumns(recset);
for (int i = 0; i < cols.length; i++) {
System.out.print(cols[i] + " ");
}
System.out.println("");
Variant vals = getValues(recset);
return vals;
}
/**
* gets the columns form the rec set
*
* @param recset
* @return list of column names
*/
public static String[] getColumns(Dispatch recset) {
Dispatch flds = Dispatch.get(recset, "Fields").toDispatch();
int n_flds = Dispatch.get(flds, "Count").getInt();
String[] s = new String[n_flds];
Variant vi = new Variant();
for (int i = 0; i < n_flds; i++) {
vi.putInt(i);
// must use the invoke method because this is a method call
// that wants to have a Dispatch.Get flag...
Dispatch fld = Dispatch.invoke(recset, "Fields", Dispatch.Get,
new Object[] { vi }, new int[1]).toDispatch();
Variant name = Dispatch.get(fld, "Name");
s[i] = name.toString();
}
return s;
}
}

View File

@@ -1,88 +0,0 @@
- ADO Wrapper for JACOB - Copyright 1999, Dan Adler
This sample shows how to generate more strongly typed wrapper classes
for the JACOB automation classes. These are pure java classes which
extend com.jacob.com.Dispatch and delegate all the methods to the
unedrlying IDispatch pointer. This methodology is similar to the way
MFC does automation wrappers, rather than using the @com directives
to invisibly delegate the calls, as the Microsoft VM does.
The ADO wrappers in this directory are not a part of the JACOB
distribution, however, they demonstrate the preferred way to create
wrappers around the core functionality. The wrappers included here are
not a complete set, but they could easily be extended to provide all
the functionality of the com.ms.wfc.data classes.
The code in test.java demonstrates two ways to get a Recordset
from SQL Server. In this case, I query for the authors in the 'pubs'
database once by opening a Recordset object directly, and once by
using the Command and Connection objects. The same code, using the WFC
wrappers can be found in ms\testms.java in case you want to compare
the performace. You can run the test.java demo in the MS VM as well.
The constructor of the wrapper is used to create an instance.
For example, the user can write:
Connection c = new Connection();
The code for the Connection constructor is shown here:
public Connection()
{
super("ADODB.Connection");
}
it simply delegates to the com.jacob.com.Dispatch constructor which
takes a ProgID.
Since I don't have a tool like JACTIVEX yet to create the wrappers
automatically from the type library, I created them by hand by using
the JACTIVEX'ed version as a starting point, and replacing the @com
calls with delegated calls to JACOB classes. A simple PERL program
could probably be used to automate this step.
In order to return strongly typed wrappers from method calls, I had to
create a special constructor which constructs the wrapper class instance
and copies over the IDispatch pointer. This is because I can't cast a
java Dispatch object to a super class object.
For example, the Command class has a method like this:
public Connection getActiveConnection();
Ideally, I would like the wrapper code to say:
public Connection getActiveConnection()
{
// this doesn't work
return (Connection)Dispatch.get(this, "ActiveConnection").toDispatch());
}
Thereby wrapping the returned Dispatch pointer in a Connection object.
But, since I can't cast in this way, I use the following construct:
public Connection getActiveConnection()
{
// this works
return new Connection(Dispatch.get(this, "ActiveConnection").toDispatch());
}
Which uses a special constructor inserted into the Connection class:
/**
* This constructor is used instead of a case operation to
* turn a Dispatch object into a wider object - it must exist
* in every wrapper class whose instances may be returned from
* method calls wrapped in VT_DISPATCH Variants.
*/
public Connection(Dispatch d)
{
// take over the IDispatch pointer
m_pDispatch = d.m_pDispatch;
// null out the input's pointer
d.m_pDispatch = 0;
}
I have to add this constructor to any class whose instances I want
to return from wrapped calls.

View File

@@ -1,207 +0,0 @@
package com.jacob.samples.ado;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
/**
* Custom dispatch object to make it easy for us to provide application specific
* API.
*
*/
public class Command extends Dispatch {
/**
* standard constructor
*/
public Command() {
super("ADODB.Command");
}
/**
* This constructor is used instead of a case operation to turn a Dispatch
* object into a wider object - it must exist in every wrapper class whose
* instances may be returned from method calls wrapped in VT_DISPATCH
* Variants.
*
* @param dispatchTarget
*/
public Command(Dispatch dispatchTarget) {
super(dispatchTarget);
}
/**
* runs the "Properties" command
*
* @return the properties
*/
public Variant getProperties() {
return Dispatch.get(this, "Properties");
}
/**
* runs the "ActiveConnection" command
*
* @return a Connection object
*/
public Connection getActiveConnection() {
return new Connection(Dispatch.get(this, "ActiveConnection")
.toDispatch());
}
/**
* Sets the "ActiveConnection" object
*
* @param ppvObject
* the new connection
*/
public void setActiveConnection(Connection ppvObject) {
Dispatch.put(this, "ActiveConnection", ppvObject);
}
/**
*
* @return the results from "CommandText"
*/
public String getCommandText() {
return Dispatch.get(this, "CommandText").toString();
}
/**
*
* @param pbstr
* the new "CommandText"
*/
public void setCommandText(String pbstr) {
Dispatch.put(this, "CommandText", pbstr);
}
/**
*
* @return the results of "CommandTimeout"
*/
public int getCommandTimeout() {
return Dispatch.get(this, "CommandTimeout").getInt();
}
/**
*
* @param plTimeout
* the new "CommandTimeout"
*/
public void setCommandTimeout(int plTimeout) {
Dispatch.put(this, "CommandTimeout", new Variant(plTimeout));
}
/**
*
* @return results from "Prepared"
*/
public boolean getPrepared() {
return Dispatch.get(this, "Prepared").getBoolean();
}
/**
*
* @param pfPrepared
* the new value for "Prepared"
*/
public void setPrepared(boolean pfPrepared) {
Dispatch.put(this, "Prepared", new Variant(pfPrepared));
}
/**
* "Execute"s a command
*
* @param RecordsAffected
* @param Parameters
* @param Options
* @return
*/
public Recordset Execute(Variant RecordsAffected, Variant Parameters,
int Options) {
return (Recordset) Dispatch.call(this, "Execute", RecordsAffected,
Parameters, new Variant(Options)).toDispatch();
}
/**
* "Execute"s a command
*
* @return
*/
public Recordset Execute() {
Variant dummy = new Variant();
return new Recordset(Dispatch.call(this, "Execute", dummy).toDispatch());
}
/**
* creates a parameter
*
* @param Name
* @param Type
* @param Direction
* @param Size
* @param Value
* @return
*/
public Variant CreateParameter(String Name, int Type, int Direction,
int Size, Variant Value) {
return Dispatch.call(this, "CreateParameter", Name, new Variant(Type),
new Variant(Direction), new Variant(Size), Value);
}
// need to wrap Parameters
/**
* @return "Parameters"
*/
public Variant getParameters() {
return Dispatch.get(this, "Parameters");
}
/**
*
* @param plCmdType
* new "CommandType"
*/
public void setCommandType(int plCmdType) {
Dispatch.put(this, "CommandType", new Variant(plCmdType));
}
/**
*
* @return current "CommandType"
*/
public int getCommandType() {
return Dispatch.get(this, "CommandType").getInt();
}
/**
*
* @return "Name"
*/
public String getName() {
return Dispatch.get(this, "Name").toString();
}
/**
*
* @param pbstrName
* new "Name"
*/
public void setName(String pbstrName) {
Dispatch.put(this, "Name", pbstrName);
}
/**
*
* @return curent "State"
*/
public int getState() {
return Dispatch.get(this, "State").getInt();
}
/**
* cancel whatever it is we're doing
*/
public void Cancel() {
Dispatch.call(this, "Cancel");
}
}

View File

@@ -1,13 +0,0 @@
package com.jacob.samples.ado;
// Enum: CommandTypeEnum
public interface CommandTypeEnum {
public static final int adCmdUnspecified = -1;
public static final int adCmdUnknown = 8;
public static final int adCmdText = 1;
public static final int adCmdTable = 2;
public static final int adCmdStoredProc = 4;
public static final int adCmdFile = 256;
public static final int adCmdTableDirect = 512;
}

View File

@@ -1,151 +0,0 @@
package com.jacob.samples.ado;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
public class Connection extends Dispatch {
public Connection() {
super("ADODB.Connection");
}
/**
* This constructor is used instead of a case operation to turn a Dispatch
* object into a wider object - it must exist in every wrapper class whose
* instances may be returned from method calls wrapped in VT_DISPATCH
* Variants.
*/
public Connection(Dispatch d) {
super(d);
}
// need to wrap Properties
public Variant getProperties() {
return Dispatch.get(this, "Properties");
}
public String getConnectionString() {
return Dispatch.get(this, "ConnectionString").toString();
}
public void setConnectionString(String pbstr) {
Dispatch.put(this, "ConnectionString", pbstr);
}
public int getCommandTimeout() {
return Dispatch.get(this, "CommandTimeout").getInt();
}
public void setCommandTimeout(int plTimeout) {
Dispatch.put(this, "CommandTimeout", new Variant(plTimeout));
}
public int getConnectionTimeout() {
return Dispatch.get(this, "ConnectionTimeout").getInt();
}
public void setConnectionTimeout(int plTimeout) {
Dispatch.put(this, "ConnectionTimeout", new Variant(plTimeout));
}
public String getVersion() {
return Dispatch.get(this, "Version").toString();
}
public void Close() {
Dispatch.call(this, "Close");
}
// how to deal with RecordsAffected being output?
public Variant Execute(String CommandText, Variant RecordsAffected,
int Options) {
return Dispatch.call(this, CommandText, RecordsAffected, new Variant(
Options));
}
public int BeginTrans() {
return Dispatch.call(this, "BeginTrans").getInt();
}
public void CommitTrans() {
Dispatch.call(this, "CommitTrans");
}
public void RollbackTrans() {
Dispatch.call(this, "RollbackTrans");
}
public void Open(String ConnectionString, String UserID, String Password,
int Options) {
Dispatch.call(this, "Open", ConnectionString, UserID, Password,
new Variant(Options));
}
public void Open() {
Dispatch.call(this, "Open");
}
public Variant getErrors() {
return Dispatch.get(this, "Errors");
}
public String getDefaultDatabase() {
return Dispatch.get(this, "DefaultDatabase").toString();
}
public void setDefaultDatabase(String pbstr) {
Dispatch.put(this, "DefaultDatabase", pbstr);
}
public int getIsolationLevel() {
return Dispatch.get(this, "IsolationLevel").getInt();
}
public void setIsolationLevel(int Level) {
Dispatch.put(this, "IsolationLevel", new Variant(Level));
}
public int getAttributes() {
return Dispatch.get(this, "Attributes").getInt();
}
public void setAttributes(int plAttr) {
Dispatch.put(this, "Attributes", new Variant(plAttr));
}
public int getCursorLocation() {
return Dispatch.get(this, "CursorLocation").getInt();
}
public void setCursorLocation(int plCursorLoc) {
Dispatch.put(this, "CursorLocation", new Variant(plCursorLoc));
}
public int getMode() {
return Dispatch.get(this, "Mode").getInt();
}
public void setMode(int plMode) {
Dispatch.put(this, "Mode", new Variant(plMode));
}
public String getProvider() {
return Dispatch.get(this, "Provider").toString();
}
public void setProvider(String pbstr) {
Dispatch.put(this, "Provider", pbstr);
}
public int getState() {
return Dispatch.get(this, "State").getInt();
}
public Variant OpenSchema(int Schema, Variant Restrictions, Variant SchemaID) {
return Dispatch.call(this, "OpenSchema", new Variant(Schema),
Restrictions, SchemaID);
}
public void Cancel() {
Dispatch.call(this, "Cancel");
}
}

View File

@@ -1,101 +0,0 @@
package com.jacob.samples.ado;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
public class Field extends Dispatch {
/**
* This constructor is used instead of a case operation to turn a Dispatch
* object into a wider object - it must exist in every wrapper class whose
* instances may be returned from method calls wrapped in VT_DISPATCH
* Variants.
*/
public Field(Dispatch d) {
super(d);
}
public Variant getProperties() {
return Dispatch.get(this, "Properties");
}
public int getActualSize() {
return Dispatch.get(this, "ActualSize").getInt();
}
public int getAttributes() {
return Dispatch.get(this, "Attributes").getInt();
}
public int getDefinedSize() {
return Dispatch.get(this, "DefinedSize").getInt();
}
public String getName() {
return Dispatch.get(this, "Name").toString();
}
public int getType() {
return Dispatch.get(this, "Type").getInt();
}
public Variant getValue() {
return Dispatch.get(this, "Value");
}
public void setValue(Variant pvar) {
Dispatch.put(this, "Value", pvar);
}
public byte getPrecision() {
return Dispatch.get(this, "Precision").getByte();
}
public byte getNumericScale() {
return Dispatch.get(this, "NumericScale").getByte();
}
public void AppendChunk(Variant Data) {
Dispatch.call(this, "AppendChunk", Data);
}
public Variant GetChunk(int Length) {
return Dispatch.call(this, "GetChunk", new Variant(Length));
}
public Variant getOriginalValue() {
return Dispatch.get(this, "OriginalValue");
}
public Variant getUnderlyingValue() {
return Dispatch.get(this, "UnderlyingValue");
}
public Variant getDataFormat() {
return Dispatch.get(this, "DataFormat");
}
public void setDataFormat(Variant ppiDF) {
Dispatch.put(this, "DataFormat", ppiDF);
}
public void setPrecision(byte pb) {
Dispatch.put(this, "Precision", new Variant(pb));
}
public void setNumericScale(byte pb) {
Dispatch.put(this, "NumericScale", new Variant(pb));
}
public void setType(int pDataType) {
Dispatch.put(this, "Type", new Variant(pDataType));
}
public void setDefinedSize(int pl) {
Dispatch.put(this, "DefinedSize", new Variant(pl));
}
public void setAttributes(int pl) {
Dispatch.put(this, "Attributes", new Variant(pl));
}
}

View File

@@ -1,43 +0,0 @@
package com.jacob.samples.ado;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
public class Fields extends Dispatch {
/**
* This constructor is used instead of a case operation to turn a Dispatch
* object into a wider object - it must exist in every wrapper class whose
* instances may be returned from method calls wrapped in VT_DISPATCH
* Variants.
*/
public Fields(Dispatch d) {
super(d);
}
public int getCount() {
return Dispatch.get(this, "Count").getInt();
}
public Variant _NewEnum() {
return Dispatch.call(this, "_NewEnum");
}
public void Refresh() {
Dispatch.call(this, "Refresh");
}
public Field getItem(int Index) {
return new Field(Dispatch.call(this, "Item", new Variant(Index))
.toDispatch());
}
public void Append(String Name, int Type, int DefinedSize, int Attrib) {
Dispatch.call(this, "Append", Name, new Variant(Type), new Variant(
DefinedSize), new Variant(Attrib));
}
public void Delete(Variant Index) {
Dispatch.call(this, "Delete", Index);
}
}

View File

@@ -1,342 +0,0 @@
package com.jacob.samples.ado;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
public class Recordset extends Dispatch {
public Recordset() {
super("ADODB.Recordset");
}
/**
* This constructor is used instead of a case operation to turn a Dispatch
* object into a wider object - it must exist in every wrapper class whose
* instances may be returned from method calls wrapped in VT_DISPATCH
* Variants.
*/
public Recordset(Dispatch d) {
super(d);
}
public Variant getProperties() {
return Dispatch.get(this, "Properties");
}
public int getAbsolutePosition() {
return Dispatch.get(this, "AbsolutePosition").getInt();
}
public void setAbsolutePosition(int pl) {
Dispatch.put(this, "AbsolutePosition", new Variant(pl));
}
public Connection getActiveConnection() {
return new Connection(Dispatch.get(this, "ActiveConnection")
.toDispatch());
}
public void setActiveConnection(Connection ppvObject) {
Dispatch.put(this, "ActiveConnection", ppvObject);
}
public void setActiveConnection(Variant ppvObject) {
Dispatch.put(this, "ActiveConnection", ppvObject);
}
public boolean getBOF() {
return Dispatch.get(this, "BOF").getBoolean();
}
public Variant getBookmark() {
return Dispatch.get(this, "Bookmark");
}
public void setBookmark(Variant pvBookmark) {
Dispatch.put(this, "Bookmark", pvBookmark);
}
public int getCacheSize() {
return Dispatch.get(this, "CacheSize").getInt();
}
public void setCacheSize(int pl) {
Dispatch.put(this, "CacheSize", new Variant(pl));
}
public int getCursorType() {
return Dispatch.get(this, "CursorType").getInt();
}
public void setCursorType(int pl) {
Dispatch.put(this, "CursorType", new Variant(pl));
}
public boolean getEOF() {
return Dispatch.get(this, "EOF").getBoolean();
}
public Fields getFields() {
return new Fields(Dispatch.get(this, "Fields").toDispatch());
}
public int getLockType() {
return Dispatch.get(this, "LockType").getInt();
}
public void setLockType(int plLockType) {
Dispatch.put(this, "LockType", new Variant(plLockType));
}
public int getMaxRecords() {
return Dispatch.get(this, "MaxRecords").getInt();
}
public void setMaxRecords(int pl) {
Dispatch.put(this, "MaxRecords", new Variant(pl));
}
public int getRecordCount() {
return Dispatch.get(this, "RecordCount").getInt();
}
public void setSource(Object pvSource) {
Dispatch.put(this, "Source", pvSource);
}
public void setSource(String pvSource) {
Dispatch.put(this, "Source", pvSource);
}
public Variant getSource() {
return Dispatch.get(this, "Source");
}
public void AddNew(Variant FieldList, Variant Values) {
Dispatch.call(this, "AddNew", FieldList, Values);
}
public void CancelUpdate() {
Dispatch.call(this, "CancelUpdate");
}
public void Close() {
Dispatch.call(this, "Close");
}
public void Delete(int AffectRecords) {
Dispatch.call(this, "Delete", new Variant(AffectRecords));
}
public Variant GetRows(int Rows, Variant Start, Variant Fields) {
return Dispatch.call(this, "GetRows", new Variant(Rows), Start, Fields);
}
// get all rows
public Variant GetRows() {
return Dispatch.call(this, "GetRows");
}
public void Move(int NumRecords, Variant Start) {
Dispatch.call(this, "Move", new Variant(NumRecords), Start);
}
public void MoveNext() {
Dispatch.call(this, "MoveNext");
}
public void MovePrevious() {
Dispatch.call(this, "MovePrevious");
}
public void MoveFirst() {
Dispatch.call(this, "MoveFirst");
}
public void MoveLast() {
Dispatch.call(this, "MoveLast");
}
public void Open(Variant Source, Variant ActiveConnection, int CursorType,
int LockType, int Options) {
Dispatch.call(this, "Open", Source, ActiveConnection, new Variant(
CursorType), new Variant(LockType), new Variant(Options));
}
public void Open(Variant Source, Variant ActiveConnection) {
Dispatch.call(this, "Open", Source, ActiveConnection);
}
public void Requery(int Options) {
Dispatch.call(this, "Requery", new Variant(Options));
}
public void Update(Variant Fields, Variant Values) {
Dispatch.call(this, "Update", Fields, Values);
}
public int getAbsolutePage() {
return Dispatch.get(this, "AbsolutePage").getInt();
}
public void setAbsolutePage(int pl) {
Dispatch.put(this, "AbsolutePage", new Variant(pl));
}
public int getEditMode() {
return Dispatch.get(this, "EditMode").getInt();
}
public Variant getFilter() {
return Dispatch.get(this, "Filter");
}
public void setFilter(Variant Criteria) {
Dispatch.put(this, "Filter", Criteria);
}
public int getPageCount() {
return Dispatch.get(this, "PageCount").getInt();
}
public int getPageSize() {
return Dispatch.get(this, "PageSize").getInt();
}
public void setPageSize(int pl) {
Dispatch.put(this, "PageSize", new Variant(pl));
}
public String getSort() {
return Dispatch.get(this, "Sort").toString();
}
public void setSort(String Criteria) {
Dispatch.put(this, "Sort", Criteria);
}
public int getStatus() {
return Dispatch.get(this, "Status").getInt();
}
public int getState() {
return Dispatch.get(this, "State").getInt();
}
public void UpdateBatch(int AffectRecords) {
Dispatch.call(this, "UpdateBatch", new Variant(AffectRecords));
}
public void CancelBatch(int AffectRecords) {
Dispatch.call(this, "CancelBatch", new Variant(AffectRecords));
}
public int getCursorLocation() {
return Dispatch.get(this, "CursorLocation").getInt();
}
public void setCursorLocation(int pl) {
Dispatch.put(this, "CursorLocation", new Variant(pl));
}
public Recordset NextRecordset(Variant RecordsAffected) {
return new Recordset(Dispatch.call(this, "NextRecordset",
RecordsAffected).toDispatch());
}
public boolean Supports(int CursorOptions) {
return Dispatch.call(this, "Supports", new Variant(CursorOptions))
.getBoolean();
}
public Variant getCollect(Variant Index) {
return Dispatch.get(this, "Collect");
}
public void setCollect(Variant Index, Variant pvar) {
Dispatch.call(this, "Collect", Index, pvar);
}
public int getMarshalOptions() {
return Dispatch.get(this, "MarshalOptions").getInt();
}
public void setMarshalOptions(int pl) {
Dispatch.put(this, "MarshalOptions", new Variant(pl));
}
public void Find(String Criteria, int SkipRecords, int SearchDirection,
Variant Start) {
Dispatch.call(this, "Find", Criteria, new Variant(SkipRecords),
new Variant(SearchDirection), Start);
}
public void Cancel() {
Dispatch.call(this, "Cancel");
}
public Variant getDataSource() {
return Dispatch.get(this, "DataSource");
}
public void setDataSource(Variant ppunkDataSource) {
Dispatch.put(this, "DataSource", ppunkDataSource);
}
public void Save(String FileName, int PersistFormat) {
Dispatch.call(this, "Save", FileName, new Variant(PersistFormat));
}
public Variant getActiveCommand() {
return Dispatch.get(this, "ActiveCommand");
}
public void setStayInSync(boolean pb) {
Dispatch.put(this, "StayInSync", new Variant(pb));
}
public boolean getStayInSync() {
return Dispatch.get(this, "StayInSync").getBoolean();
}
public String GetString(int StringFormat, int NumRows,
String ColumnDelimeter, String RowDelimeter, String NullExpr) {
return Dispatch.call(this, "GetString", new Variant(StringFormat),
new Variant(NumRows), ColumnDelimeter, RowDelimeter, NullExpr)
.toString();
}
public String getDataMember() {
return Dispatch.get(this, "DataMember").toString();
}
public void setDataMember(String pl) {
Dispatch.put(this, "DataMember", new Variant(pl));
}
public int CompareBookmarks(Variant Bookmark1, Variant Bookmark2) {
return Dispatch.call(this, "CompareBookmarks", Bookmark1, Bookmark2)
.getInt();
}
public Recordset Clone(int LockType) {
return new Recordset(Dispatch
.call(this, "Clone", new Variant(LockType)).toDispatch());
}
public void Resync(int AffectRecords, int ResyncValues) {
Dispatch.call(this, "Resync", new Variant(AffectRecords), new Variant(
ResyncValues));
}
public void Seek(Variant KeyValues, int SeekOption) {
Dispatch.call(this, "Seek", KeyValues, new Variant(SeekOption));
}
public void setIndex(String pl) {
Dispatch.put(this, "Index", new Variant(pl));
}
public String getIndex() {
return Dispatch.get(this, "Index)").toString();
}
}

View File

@@ -1,9 +0,0 @@
This is the WFC equivalent of the JACOB ADO example.
This code must be compiled with JVC and run with JVIEW.
The file testms.java has been renamed to tesetms.java.txt
because most folks building this application will
not have the MS JVM installed and will get compiler
warnings. The MS JVM is going away eventually
so this whole test will eventually go away.

View File

@@ -1,66 +0,0 @@
package samples.ado.ms;
import com.ms.com.*;
import com.ms.wfc.data.*;
// an ms-only version of test.java
public class testms
{
public static void printRS(Recordset rs)
{
Fields fs = rs.getFields();
for (int i=0;i<fs.getCount();i++)
{
System.out.print(fs.getItem(i).getName() + " ");
}
System.out.println("");
rs.moveFirst();
while (!rs.getEOF())
{
for(int i=0;i<fs.getCount();i++)
{
Field f = fs.getItem(i);
Variant v = f.getValue();
System.out.print(v + " ");
}
System.out.println("");
rs.moveNext();
}
}
// open a recordset directly
public static void getRS(String con, String query)
{
System.out.println("Recordset Open");
Recordset rs = new Recordset();
rs.open(new Variant(query), new Variant(con));
printRS(rs);
}
// create connection and command objects and use them
// to get a recordset
public static void getCommand(String con, String query)
{
System.out.println("Command+Connection -> Recordset");
Connection c = new Connection();
c.setConnectionString(con);
c.open();
Command comm = new Command();
comm.setActiveConnection(c);
comm.setCommandType(AdoEnums.CommandType.TEXT);
comm.setCommandText(query);
Recordset rs = comm.execute();
printRS(rs);
c.close();
}
public static void main(String[] args)
{
String connectStr = "DRIVER=SQL Server;SERVER=DANADLER;UID=sa;PWD=;WSID=DANADLER;DATABASE=pubs";
String queryStr = "select * from authors";
getCommand(connectStr, queryStr);
getRS(connectStr, queryStr);
}
}

View File

@@ -1,56 +0,0 @@
package com.jacob.samples.ado;
import com.jacob.com.Variant;
public class test {
public static void printRS(Recordset rs) {
Fields fs = rs.getFields();
for (int i = 0; i < fs.getCount(); i++) {
System.out.print(fs.getItem(i).getName() + " ");
}
System.out.println("");
rs.MoveFirst();
while (!rs.getEOF()) {
for (int i = 0; i < fs.getCount(); i++) {
Field f = fs.getItem(i);
Variant v = f.getValue();
System.out.print(v + " ");
}
System.out.println("");
rs.MoveNext();
}
}
// open a recordset directly
public static void getRS(String con, String query) {
System.out.println("Recordset Open");
Recordset rs = new Recordset();
rs.Open(new Variant(query), new Variant(con));
printRS(rs);
}
// create connection and command objects and use them
// to get a recordset
public static void getCommand(String con, String query) {
System.out.println("Command+Connection -> Recordset");
Connection c = new Connection();
c.setConnectionString(con);
c.Open();
Command comm = new Command();
comm.setActiveConnection(c);
comm.setCommandType(CommandTypeEnum.adCmdText);
comm.setCommandText(query);
Recordset rs = comm.Execute();
printRS(rs);
c.Close();
}
public static void main(String[] args) {
String connectStr = "DRIVER=SQL Server;SERVER=DANADLER;UID=sa;PWD=;WSID=DANADLER;DATABASE=pubs";
String queryStr = "select * from authors";
getCommand(connectStr, queryStr);
getRS(connectStr, queryStr);
}
}

View File

@@ -1,8 +0,0 @@
<title>Applet Test (1.1)</title>
<h1>Applet Test (1.1)</h1>
<hr>
<applet code=AppTest.class width=400 height=400>
</applet>
<hr>
<a href="AppTest.java">The source.</a>
<br>

View File

@@ -1,58 +0,0 @@
package com.jacob.samples.applet;
import java.applet.Applet;
import java.awt.Button;
import java.awt.FlowLayout;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
/**
* Applet test case
*/
public class AppTest extends Applet implements ActionListener {
/**
* unique identifier added by Eclipse because this class is serializable
*/
private static final long serialVersionUID = -6676420357823607065L;
TextField in;
TextField out;
Button calc;
ActiveXComponent sC = null;
/**
* startup method
*/
public void init() {
setLayout(new FlowLayout());
add(in = new TextField("1+1", 16));
add(out = new TextField("?", 16));
add(calc = new Button("Calculate"));
calc.addActionListener(this);
}
/**
* action method that receives button actions
*
* @param ev
* the event
*/
public void actionPerformed(ActionEvent ev) {
if (sC == null) {
String lang = "VBScript";
sC = new ActiveXComponent("ScriptControl");
Dispatch.put(sC, "Language", lang);
}
Variant v = Dispatch.call(sC, "Eval", in.getText());
out.setText(v.toString());
}
}

View File

@@ -1,67 +0,0 @@
// Face.cpp : Implementation of CMultiFaceApp and DLL registration.
#include "stdafx.h"
#include "MultiFace.h"
#include "Face.h"
/////////////////////////////////////////////////////////////////////////////
//
STDMETHODIMP Face::InterfaceSupportsErrorInfo(REFIID riid)
{
static const IID* arr[] =
{
&IID_IFace1,
&IID_IFace2,
&IID_IFace3,
};
for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
{
if (InlineIsEqualGUID(*arr[i],riid))
return S_OK;
}
return S_FALSE;
}
STDMETHODIMP Face::get_Face1Name(BSTR *pVal)
{
// TODO: Add your implementation code here
*pVal = name1;
return S_OK;
}
STDMETHODIMP Face::put_Face1Name(BSTR newVal)
{
// TODO: Add your implementation code here
name1 = newVal;
return S_OK;
}
STDMETHODIMP Face::get_Face2Nam(BSTR *pVal)
{
// TODO: Add your implementation code here
*pVal = name2;
return S_OK;
}
STDMETHODIMP Face::put_Face2Nam(BSTR newVal)
{
// TODO: Add your implementation code here
name2 = newVal;
return S_OK;
}
STDMETHODIMP Face::get_Face3Name(BSTR *pVal)
{
// TODO: Add your implementation code here
*pVal = name3;
return S_OK;
}
STDMETHODIMP Face::put_Face3Name(BSTR newVal)
{
// TODO: Add your implementation code here
name3 = newVal;
return S_OK;
}

View File

@@ -1,63 +0,0 @@
// Face.h: Definition of the Face class
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_FACE_H__9BF24413_B2E0_11D4_A695_00104BFF3241__INCLUDED_)
#define AFX_FACE_H__9BF24413_B2E0_11D4_A695_00104BFF3241__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// Face
class Face :
public IDispatchImpl<IFace1, &IID_IFace1, &LIBID_MULTIFACELib>,
public IDispatchImpl<IFace2, &IID_IFace2, &LIBID_MULTIFACELib>,
public IDispatchImpl<IFace3, &IID_IFace3, &LIBID_MULTIFACELib>,
public ISupportErrorInfo,
public CComObjectRoot,
public CComCoClass<Face,&CLSID_Face>
{
// IFace1
private:
CComBSTR name1;
// IFace2
CComBSTR name2;
// IFace3
CComBSTR name3;
public:
Face() {}
BEGIN_COM_MAP(Face)
COM_INTERFACE_ENTRY2(IDispatch, IFace1)
COM_INTERFACE_ENTRY(IFace1)
COM_INTERFACE_ENTRY(IFace2)
COM_INTERFACE_ENTRY(IFace3)
COM_INTERFACE_ENTRY(ISupportErrorInfo)
END_COM_MAP()
//DECLARE_NOT_AGGREGATABLE(Face)
// Remove the comment from the line above if you don't want your object to
// support aggregation.
DECLARE_REGISTRY_RESOURCEID(IDR_Face)
// ISupportsErrorInfo
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
public:
STDMETHOD(get_Face3Name)(/*[out, retval]*/ BSTR *pVal);
STDMETHOD(put_Face3Name)(/*[in]*/ BSTR newVal);
STDMETHOD(get_Face2Nam)(/*[out, retval]*/ BSTR *pVal);
STDMETHOD(put_Face2Nam)(/*[in]*/ BSTR newVal);
STDMETHOD(get_Face1Name)(/*[out, retval]*/ BSTR *pVal);
STDMETHOD(put_Face1Name)(/*[in]*/ BSTR newVal);
};
#endif // !defined(AFX_FACE_H__9BF24413_B2E0_11D4_A695_00104BFF3241__INCLUDED_)

View File

@@ -1,23 +0,0 @@
HKCR
{
MultiFace.Face.1 = s 'Face Class'
{
CLSID = s '{9BF24412-B2E0-11D4-A695-00104BFF3241}'
}
MultiFace.Face = s 'Face Class'
{
CLSID = s '{9BF24412-B2E0-11D4-A695-00104BFF3241}'
}
NoRemove CLSID
{
ForceRemove {9BF24412-B2E0-11D4-A695-00104BFF3241} = s 'Face Class'
{
ProgID = s 'MultiFace.Face.1'
VersionIndependentProgID = s 'MultiFace.Face'
InprocServer32 = s '%MODULE%'
{
val ThreadingModel = s 'both'
}
}
}
}

View File

@@ -1,72 +0,0 @@
// MultiFace.cpp : Implementation of DLL Exports.
// Note: Proxy/Stub Information
// To build a separate proxy/stub DLL,
// run nmake -f MultiFaceps.mk in the project directory.
#include "stdafx.h"
#include "resource.h"
#include <initguid.h>
#include "MultiFace.h"
#include "MultiFace_i.c"
#include "Face.h"
CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_Face, Face)
END_OBJECT_MAP()
/////////////////////////////////////////////////////////////////////////////
// DLL Entry Point
extern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
_Module.Init(ObjectMap, hInstance, &LIBID_MULTIFACELib);
DisableThreadLibraryCalls(hInstance);
}
else if (dwReason == DLL_PROCESS_DETACH)
_Module.Term();
return TRUE; // ok
}
/////////////////////////////////////////////////////////////////////////////
// Used to determine whether the DLL can be unloaded by OLE
STDAPI DllCanUnloadNow(void)
{
return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
}
/////////////////////////////////////////////////////////////////////////////
// Returns a class factory to create an object of the requested type
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
return _Module.GetClassObject(rclsid, riid, ppv);
}
/////////////////////////////////////////////////////////////////////////////
// DllRegisterServer - Adds entries to the system registry
STDAPI DllRegisterServer(void)
{
// registers object, typelib and all interfaces in typelib
return _Module.RegisterServer(TRUE);
}
/////////////////////////////////////////////////////////////////////////////
// DllUnregisterServer - Removes entries from the system registry
STDAPI DllUnregisterServer(void)
{
return _Module.UnregisterServer(TRUE);
}

View File

@@ -1,9 +0,0 @@
; MultiFace.def : Declares the module parameters.
LIBRARY "MultiFace.DLL"
EXPORTS
DllCanUnloadNow @1 PRIVATE
DllGetClassObject @2 PRIVATE
DllRegisterServer @3 PRIVATE
DllUnregisterServer @4 PRIVATE

View File

@@ -1,323 +0,0 @@
# Microsoft Developer Studio Project File - Name="MultiFace" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=MultiFace - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "MultiFace.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "MultiFace.mak" CFG="MultiFace - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "MultiFace - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "MultiFace - Win32 Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "MultiFace - Win32 Release MinSize" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "MultiFace - Win32 Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "MultiFace - Win32 Unicode Release MinSize" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "MultiFace - Win32 Unicode Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "MultiFace - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# Begin Custom Build - Performing registration
OutDir=.\Debug
TargetPath=.\Debug\MultiFace.dll
InputPath=.\Debug\MultiFace.dll
SOURCE="$(InputPath)"
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
regsvr32 /s /c "$(TargetPath)"
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
# End Custom Build
!ELSEIF "$(CFG)" == "MultiFace - Win32 Unicode Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "DebugU"
# PROP BASE Intermediate_Dir "DebugU"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "DebugU"
# PROP Intermediate_Dir "DebugU"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /Yu"stdafx.h" /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# Begin Custom Build - Performing registration
OutDir=.\DebugU
TargetPath=.\DebugU\MultiFace.dll
InputPath=.\DebugU\MultiFace.dll
SOURCE="$(InputPath)"
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
if "%OS%"=="" goto NOTNT
if not "%OS%"=="Windows_NT" goto NOTNT
regsvr32 /s /c "$(TargetPath)"
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
goto end
:NOTNT
echo Warning : Cannot register Unicode DLL on Windows 95
:end
# End Custom Build
!ELSEIF "$(CFG)" == "MultiFace - Win32 Release MinSize"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ReleaseMinSize"
# PROP BASE Intermediate_Dir "ReleaseMinSize"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ReleaseMinSize"
# PROP Intermediate_Dir "ReleaseMinSize"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
# Begin Custom Build - Performing registration
OutDir=.\ReleaseMinSize
TargetPath=.\ReleaseMinSize\MultiFace.dll
InputPath=.\ReleaseMinSize\MultiFace.dll
SOURCE="$(InputPath)"
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
regsvr32 /s /c "$(TargetPath)"
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
# End Custom Build
!ELSEIF "$(CFG)" == "MultiFace - Win32 Release MinDependency"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ReleaseMinDependency"
# PROP BASE Intermediate_Dir "ReleaseMinDependency"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ReleaseMinDependency"
# PROP Intermediate_Dir "ReleaseMinDependency"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
# Begin Custom Build - Performing registration
OutDir=.\ReleaseMinDependency
TargetPath=.\ReleaseMinDependency\MultiFace.dll
InputPath=.\ReleaseMinDependency\MultiFace.dll
SOURCE="$(InputPath)"
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
regsvr32 /s /c "$(TargetPath)"
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
# End Custom Build
!ELSEIF "$(CFG)" == "MultiFace - Win32 Unicode Release MinSize"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ReleaseUMinSize"
# PROP BASE Intermediate_Dir "ReleaseUMinSize"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ReleaseUMinSize"
# PROP Intermediate_Dir "ReleaseUMinSize"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
# Begin Custom Build - Performing registration
OutDir=.\ReleaseUMinSize
TargetPath=.\ReleaseUMinSize\MultiFace.dll
InputPath=.\ReleaseUMinSize\MultiFace.dll
SOURCE="$(InputPath)"
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
if "%OS%"=="" goto NOTNT
if not "%OS%"=="Windows_NT" goto NOTNT
regsvr32 /s /c "$(TargetPath)"
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
goto end
:NOTNT
echo Warning : Cannot register Unicode DLL on Windows 95
:end
# End Custom Build
!ELSEIF "$(CFG)" == "MultiFace - Win32 Unicode Release MinDependency"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ReleaseUMinDependency"
# PROP BASE Intermediate_Dir "ReleaseUMinDependency"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ReleaseUMinDependency"
# PROP Intermediate_Dir "ReleaseUMinDependency"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
# Begin Custom Build - Performing registration
OutDir=.\ReleaseUMinDependency
TargetPath=.\ReleaseUMinDependency\MultiFace.dll
InputPath=.\ReleaseUMinDependency\MultiFace.dll
SOURCE="$(InputPath)"
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
if "%OS%"=="" goto NOTNT
if not "%OS%"=="Windows_NT" goto NOTNT
regsvr32 /s /c "$(TargetPath)"
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
goto end
:NOTNT
echo Warning : Cannot register Unicode DLL on Windows 95
:end
# End Custom Build
!ENDIF
# Begin Target
# Name "MultiFace - Win32 Debug"
# Name "MultiFace - Win32 Unicode Debug"
# Name "MultiFace - Win32 Release MinSize"
# Name "MultiFace - Win32 Release MinDependency"
# Name "MultiFace - Win32 Unicode Release MinSize"
# Name "MultiFace - Win32 Unicode Release MinDependency"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\Face.cpp
# End Source File
# Begin Source File
SOURCE=.\MultiFace.cpp
# End Source File
# Begin Source File
SOURCE=.\MultiFace.def
# End Source File
# Begin Source File
SOURCE=.\MultiFace.idl
# ADD MTL /tlb ".\MultiFace.tlb" /h "MultiFace.h" /iid "MultiFace_i.c" /Oicf
# End Source File
# Begin Source File
SOURCE=.\MultiFace.rc
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\Face.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\Face.rgs
# End Source File
# End Group
# End Target
# End Project

View File

@@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "MultiFace"=.\MultiFace.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -1,571 +0,0 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 5.01.0164 */
/* at Sun Nov 05 01:12:47 2000
*/
/* Compiler settings for D:\jacob_15\samples\test\atl\MultiFace\MultiFace.idl:
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
error checks: allocation ref bounds_check enum stub_data
*/
//@@MIDL_FILE_HEADING( )
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 440
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __MultiFace_h__
#define __MultiFace_h__
#ifdef __cplusplus
extern "C"{
#endif
/* Forward Declarations */
#ifndef __IFace1_FWD_DEFINED__
#define __IFace1_FWD_DEFINED__
typedef interface IFace1 IFace1;
#endif /* __IFace1_FWD_DEFINED__ */
#ifndef __IFace2_FWD_DEFINED__
#define __IFace2_FWD_DEFINED__
typedef interface IFace2 IFace2;
#endif /* __IFace2_FWD_DEFINED__ */
#ifndef __IFace3_FWD_DEFINED__
#define __IFace3_FWD_DEFINED__
typedef interface IFace3 IFace3;
#endif /* __IFace3_FWD_DEFINED__ */
#ifndef __Face_FWD_DEFINED__
#define __Face_FWD_DEFINED__
#ifdef __cplusplus
typedef class Face Face;
#else
typedef struct Face Face;
#endif /* __cplusplus */
#endif /* __Face_FWD_DEFINED__ */
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void __RPC_FAR * );
#ifndef __IFace1_INTERFACE_DEFINED__
#define __IFace1_INTERFACE_DEFINED__
/* interface IFace1 */
/* [unique][helpstring][dual][uuid][object] */
EXTERN_C const IID IID_IFace1;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("9BF2440F-B2E0-11D4-A695-00104BFF3241")
IFace1 : public IDispatch
{
public:
virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Face1Name(
/* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Face1Name(
/* [in] */ BSTR newVal) = 0;
};
#else /* C style interface */
typedef struct IFace1Vtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
IFace1 __RPC_FAR * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
IFace1 __RPC_FAR * This);
ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
IFace1 __RPC_FAR * This);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
IFace1 __RPC_FAR * This,
/* [out] */ UINT __RPC_FAR *pctinfo);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
IFace1 __RPC_FAR * This,
/* [in] */ UINT iTInfo,
/* [in] */ LCID lcid,
/* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
IFace1 __RPC_FAR * This,
/* [in] */ REFIID riid,
/* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
/* [in] */ UINT cNames,
/* [in] */ LCID lcid,
/* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
/* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
IFace1 __RPC_FAR * This,
/* [in] */ DISPID dispIdMember,
/* [in] */ REFIID riid,
/* [in] */ LCID lcid,
/* [in] */ WORD wFlags,
/* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
/* [out] */ VARIANT __RPC_FAR *pVarResult,
/* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
/* [out] */ UINT __RPC_FAR *puArgErr);
/* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Face1Name )(
IFace1 __RPC_FAR * This,
/* [retval][out] */ BSTR __RPC_FAR *pVal);
/* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Face1Name )(
IFace1 __RPC_FAR * This,
/* [in] */ BSTR newVal);
END_INTERFACE
} IFace1Vtbl;
interface IFace1
{
CONST_VTBL struct IFace1Vtbl __RPC_FAR *lpVtbl;
};
#ifdef COBJMACROS
#define IFace1_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define IFace1_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define IFace1_Release(This) \
(This)->lpVtbl -> Release(This)
#define IFace1_GetTypeInfoCount(This,pctinfo) \
(This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
#define IFace1_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
(This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define IFace1_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
(This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define IFace1_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
(This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
#define IFace1_get_Face1Name(This,pVal) \
(This)->lpVtbl -> get_Face1Name(This,pVal)
#define IFace1_put_Face1Name(This,newVal) \
(This)->lpVtbl -> put_Face1Name(This,newVal)
#endif /* COBJMACROS */
#endif /* C style interface */
/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IFace1_get_Face1Name_Proxy(
IFace1 __RPC_FAR * This,
/* [retval][out] */ BSTR __RPC_FAR *pVal);
void __RPC_STUB IFace1_get_Face1Name_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IFace1_put_Face1Name_Proxy(
IFace1 __RPC_FAR * This,
/* [in] */ BSTR newVal);
void __RPC_STUB IFace1_put_Face1Name_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __IFace1_INTERFACE_DEFINED__ */
#ifndef __IFace2_INTERFACE_DEFINED__
#define __IFace2_INTERFACE_DEFINED__
/* interface IFace2 */
/* [unique][helpstring][dual][uuid][object] */
EXTERN_C const IID IID_IFace2;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("9BF24410-B2E0-11D4-A695-00104BFF3241")
IFace2 : public IDispatch
{
public:
virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Face2Nam(
/* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Face2Nam(
/* [in] */ BSTR newVal) = 0;
};
#else /* C style interface */
typedef struct IFace2Vtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
IFace2 __RPC_FAR * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
IFace2 __RPC_FAR * This);
ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
IFace2 __RPC_FAR * This);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
IFace2 __RPC_FAR * This,
/* [out] */ UINT __RPC_FAR *pctinfo);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
IFace2 __RPC_FAR * This,
/* [in] */ UINT iTInfo,
/* [in] */ LCID lcid,
/* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
IFace2 __RPC_FAR * This,
/* [in] */ REFIID riid,
/* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
/* [in] */ UINT cNames,
/* [in] */ LCID lcid,
/* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
/* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
IFace2 __RPC_FAR * This,
/* [in] */ DISPID dispIdMember,
/* [in] */ REFIID riid,
/* [in] */ LCID lcid,
/* [in] */ WORD wFlags,
/* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
/* [out] */ VARIANT __RPC_FAR *pVarResult,
/* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
/* [out] */ UINT __RPC_FAR *puArgErr);
/* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Face2Nam )(
IFace2 __RPC_FAR * This,
/* [retval][out] */ BSTR __RPC_FAR *pVal);
/* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Face2Nam )(
IFace2 __RPC_FAR * This,
/* [in] */ BSTR newVal);
END_INTERFACE
} IFace2Vtbl;
interface IFace2
{
CONST_VTBL struct IFace2Vtbl __RPC_FAR *lpVtbl;
};
#ifdef COBJMACROS
#define IFace2_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define IFace2_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define IFace2_Release(This) \
(This)->lpVtbl -> Release(This)
#define IFace2_GetTypeInfoCount(This,pctinfo) \
(This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
#define IFace2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
(This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define IFace2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
(This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define IFace2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
(This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
#define IFace2_get_Face2Nam(This,pVal) \
(This)->lpVtbl -> get_Face2Nam(This,pVal)
#define IFace2_put_Face2Nam(This,newVal) \
(This)->lpVtbl -> put_Face2Nam(This,newVal)
#endif /* COBJMACROS */
#endif /* C style interface */
/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IFace2_get_Face2Nam_Proxy(
IFace2 __RPC_FAR * This,
/* [retval][out] */ BSTR __RPC_FAR *pVal);
void __RPC_STUB IFace2_get_Face2Nam_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IFace2_put_Face2Nam_Proxy(
IFace2 __RPC_FAR * This,
/* [in] */ BSTR newVal);
void __RPC_STUB IFace2_put_Face2Nam_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __IFace2_INTERFACE_DEFINED__ */
#ifndef __IFace3_INTERFACE_DEFINED__
#define __IFace3_INTERFACE_DEFINED__
/* interface IFace3 */
/* [unique][helpstring][dual][uuid][object] */
EXTERN_C const IID IID_IFace3;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("9BF24411-B2E0-11D4-A695-00104BFF3241")
IFace3 : public IDispatch
{
public:
virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Face3Name(
/* [retval][out] */ BSTR __RPC_FAR *pVal) = 0;
virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Face3Name(
/* [in] */ BSTR newVal) = 0;
};
#else /* C style interface */
typedef struct IFace3Vtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
IFace3 __RPC_FAR * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
IFace3 __RPC_FAR * This);
ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
IFace3 __RPC_FAR * This);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
IFace3 __RPC_FAR * This,
/* [out] */ UINT __RPC_FAR *pctinfo);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
IFace3 __RPC_FAR * This,
/* [in] */ UINT iTInfo,
/* [in] */ LCID lcid,
/* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
IFace3 __RPC_FAR * This,
/* [in] */ REFIID riid,
/* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
/* [in] */ UINT cNames,
/* [in] */ LCID lcid,
/* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
/* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
IFace3 __RPC_FAR * This,
/* [in] */ DISPID dispIdMember,
/* [in] */ REFIID riid,
/* [in] */ LCID lcid,
/* [in] */ WORD wFlags,
/* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
/* [out] */ VARIANT __RPC_FAR *pVarResult,
/* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
/* [out] */ UINT __RPC_FAR *puArgErr);
/* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Face3Name )(
IFace3 __RPC_FAR * This,
/* [retval][out] */ BSTR __RPC_FAR *pVal);
/* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Face3Name )(
IFace3 __RPC_FAR * This,
/* [in] */ BSTR newVal);
END_INTERFACE
} IFace3Vtbl;
interface IFace3
{
CONST_VTBL struct IFace3Vtbl __RPC_FAR *lpVtbl;
};
#ifdef COBJMACROS
#define IFace3_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define IFace3_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define IFace3_Release(This) \
(This)->lpVtbl -> Release(This)
#define IFace3_GetTypeInfoCount(This,pctinfo) \
(This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
#define IFace3_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
(This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define IFace3_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
(This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define IFace3_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
(This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
#define IFace3_get_Face3Name(This,pVal) \
(This)->lpVtbl -> get_Face3Name(This,pVal)
#define IFace3_put_Face3Name(This,newVal) \
(This)->lpVtbl -> put_Face3Name(This,newVal)
#endif /* COBJMACROS */
#endif /* C style interface */
/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IFace3_get_Face3Name_Proxy(
IFace3 __RPC_FAR * This,
/* [retval][out] */ BSTR __RPC_FAR *pVal);
void __RPC_STUB IFace3_get_Face3Name_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IFace3_put_Face3Name_Proxy(
IFace3 __RPC_FAR * This,
/* [in] */ BSTR newVal);
void __RPC_STUB IFace3_put_Face3Name_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __IFace3_INTERFACE_DEFINED__ */
#ifndef __MULTIFACELib_LIBRARY_DEFINED__
#define __MULTIFACELib_LIBRARY_DEFINED__
/* library MULTIFACELib */
/* [helpstring][version][uuid] */
EXTERN_C const IID LIBID_MULTIFACELib;
EXTERN_C const CLSID CLSID_Face;
#ifdef __cplusplus
class DECLSPEC_UUID("9BF24412-B2E0-11D4-A695-00104BFF3241")
Face;
#endif
#endif /* __MULTIFACELib_LIBRARY_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
unsigned long __RPC_USER BSTR_UserSize( unsigned long __RPC_FAR *, unsigned long , BSTR __RPC_FAR * );
unsigned char __RPC_FAR * __RPC_USER BSTR_UserMarshal( unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, BSTR __RPC_FAR * );
unsigned char __RPC_FAR * __RPC_USER BSTR_UserUnmarshal(unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, BSTR __RPC_FAR * );
void __RPC_USER BSTR_UserFree( unsigned long __RPC_FAR *, BSTR __RPC_FAR * );
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,70 +0,0 @@
// MultiFace.idl : IDL source for MultiFace.dll
//
// This file will be processed by the MIDL tool to
// produce the type library (MultiFace.tlb) and marshalling code.
import "oaidl.idl";
import "ocidl.idl";
[
object,
uuid(9BF2440F-B2E0-11D4-A695-00104BFF3241),
dual,
helpstring("IFace1 Interface"),
pointer_default(unique)
]
interface IFace1 : IDispatch
{
[propget, id(1), helpstring("property Face1Name")] HRESULT Face1Name([out, retval] BSTR *pVal);
[propput, id(1), helpstring("property Face1Name")] HRESULT Face1Name([in] BSTR newVal);
};
[
object,
uuid(9BF24410-B2E0-11D4-A695-00104BFF3241),
dual,
helpstring("IFace2 Interface"),
pointer_default(unique)
]
interface IFace2 : IDispatch
{
[propget, id(1), helpstring("property Face2Nam")] HRESULT Face2Nam([out, retval] BSTR *pVal);
[propput, id(1), helpstring("property Face2Nam")] HRESULT Face2Nam([in] BSTR newVal);
};
[
object,
uuid(9BF24411-B2E0-11D4-A695-00104BFF3241),
dual,
helpstring("IFace3 Interface"),
pointer_default(unique)
]
interface IFace3 : IDispatch
{
[propget, id(1), helpstring("property Face3Name")] HRESULT Face3Name([out, retval] BSTR *pVal);
[propput, id(1), helpstring("property Face3Name")] HRESULT Face3Name([in] BSTR newVal);
};
[
uuid(9BF24403-B2E0-11D4-A695-00104BFF3241),
version(1.0),
helpstring("MultiFace 1.0 Type Library")
]
library MULTIFACELib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[
uuid(9BF24412-B2E0-11D4-A695-00104BFF3241),
helpstring("Face Class")
]
coclass Face
{
[default] interface IFace1;
interface IFace2;
interface IFace3;
};
};

View File

@@ -1,48 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: MultiFace - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\TEMP\RSP335.tmp" with contents
[
/nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Fp"Debug/MultiFace.pch" /Yu"stdafx.h" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
"D:\jacob_15\samples\test\atl\MultiFace\MultiFace.cpp"
"D:\jacob_15\samples\test\atl\MultiFace\Face.cpp"
]
Creating command line "cl.exe @C:\TEMP\RSP335.tmp"
Creating temporary file "C:\TEMP\RSP336.tmp" with contents
[
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /incremental:yes /pdb:"Debug/MultiFace.pdb" /debug /machine:I386 /def:".\MultiFace.def" /out:"Debug/MultiFace.dll" /implib:"Debug/MultiFace.lib" /pdbtype:sept
.\Debug\StdAfx.obj
.\Debug\MultiFace.obj
.\Debug\MultiFace.res
.\Debug\Face.obj
]
Creating command line "link.exe @C:\TEMP\RSP336.tmp"
Creating temporary file "C:\TEMP\RSP337.bat" with contents
[
@echo off
regsvr32 /s /c ".\Debug\MultiFace.dll"
echo regsvr32 exec. time > ".\Debug\regsvr32.trg"
]
Creating command line "C:\TEMP\RSP337.bat"
Compiling...
MultiFace.cpp
Face.cpp
Generating Code...
Linking...
<h3>Output Window</h3>
Performing registration
RegSvr32: DllRegisterServer in .\Debug\MultiFace.dll succeeded.
<h3>Results</h3>
MultiFace.dll - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

View File

@@ -1,125 +0,0 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"1 TYPELIB ""MultiFace.tlb""\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "MultiFace Module\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "MultiFace\0"
VALUE "LegalCopyright", "Copyright 2000\0"
VALUE "OriginalFilename", "MultiFace.DLL\0"
VALUE "ProductName", "MultiFace Module\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
VALUE "OLESelfRegister", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// REGISTRY
//
IDR_Face REGISTRY DISCARDABLE "Face.rgs"
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_PROJNAME "MultiFace"
IDS_FACE_DESC "Face Class"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
1 TYPELIB "MultiFace.tlb"
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -1,56 +0,0 @@
/* this file contains the actual definitions of */
/* the IIDs and CLSIDs */
/* link this file in with the server and any clients */
/* File created by MIDL compiler version 5.01.0164 */
/* at Sun Nov 05 01:12:47 2000
*/
/* Compiler settings for D:\jacob_15\samples\test\atl\MultiFace\MultiFace.idl:
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
error checks: allocation ref bounds_check enum stub_data
*/
//@@MIDL_FILE_HEADING( )
#ifdef __cplusplus
extern "C"{
#endif
#ifndef __IID_DEFINED__
#define __IID_DEFINED__
typedef struct _IID
{
unsigned long x;
unsigned short s1;
unsigned short s2;
unsigned char c[8];
} IID;
#endif // __IID_DEFINED__
#ifndef CLSID_DEFINED
#define CLSID_DEFINED
typedef IID CLSID;
#endif // CLSID_DEFINED
const IID IID_IFace1 = {0x9BF2440F,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}};
const IID IID_IFace2 = {0x9BF24410,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}};
const IID IID_IFace3 = {0x9BF24411,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}};
const IID LIBID_MULTIFACELib = {0x9BF24403,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}};
const CLSID CLSID_Face = {0x9BF24412,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}};
#ifdef __cplusplus
}
#endif

View File

@@ -1,570 +0,0 @@
/* this ALWAYS GENERATED file contains the proxy stub code */
/* File created by MIDL compiler version 5.01.0164 */
/* at Sun Nov 05 01:12:47 2000
*/
/* Compiler settings for D:\jacob_15\samples\test\atl\MultiFace\MultiFace.idl:
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
error checks: allocation ref bounds_check enum stub_data
*/
//@@MIDL_FILE_HEADING( )
#define USE_STUBLESS_PROXY
/* verify that the <rpcproxy.h> version is high enough to compile this file*/
#ifndef __REDQ_RPCPROXY_H_VERSION__
#define __REQUIRED_RPCPROXY_H_VERSION__ 440
#endif
#include "rpcproxy.h"
#ifndef __RPCPROXY_H_VERSION__
#error this stub requires an updated version of <rpcproxy.h>
#endif // __RPCPROXY_H_VERSION__
#include "MultiFace.h"
#define TYPE_FORMAT_STRING_SIZE 55
#define PROC_FORMAT_STRING_SIZE 57
typedef struct _MIDL_TYPE_FORMAT_STRING
{
short Pad;
unsigned char Format[ TYPE_FORMAT_STRING_SIZE ];
} MIDL_TYPE_FORMAT_STRING;
typedef struct _MIDL_PROC_FORMAT_STRING
{
short Pad;
unsigned char Format[ PROC_FORMAT_STRING_SIZE ];
} MIDL_PROC_FORMAT_STRING;
extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
/* Object interface: IUnknown, ver. 0.0,
GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
/* Object interface: IDispatch, ver. 0.0,
GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
/* Object interface: IFace1, ver. 0.0,
GUID={0x9BF2440F,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}} */
extern const MIDL_STUB_DESC Object_StubDesc;
extern const MIDL_SERVER_INFO IFace1_ServerInfo;
#pragma code_seg(".orpc")
static const unsigned short IFace1_FormatStringOffsetTable[] =
{
(unsigned short) -1,
(unsigned short) -1,
(unsigned short) -1,
(unsigned short) -1,
0,
28
};
static const MIDL_SERVER_INFO IFace1_ServerInfo =
{
&Object_StubDesc,
0,
__MIDL_ProcFormatString.Format,
&IFace1_FormatStringOffsetTable[-3],
0,
0,
0,
0
};
static const MIDL_STUBLESS_PROXY_INFO IFace1_ProxyInfo =
{
&Object_StubDesc,
__MIDL_ProcFormatString.Format,
&IFace1_FormatStringOffsetTable[-3],
0,
0,
0
};
CINTERFACE_PROXY_VTABLE(9) _IFace1ProxyVtbl =
{
&IFace1_ProxyInfo,
&IID_IFace1,
IUnknown_QueryInterface_Proxy,
IUnknown_AddRef_Proxy,
IUnknown_Release_Proxy ,
0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
0 /* IDispatch_Invoke_Proxy */ ,
(void *)-1 /* IFace1::get_Face1Name */ ,
(void *)-1 /* IFace1::put_Face1Name */
};
static const PRPC_STUB_FUNCTION IFace1_table[] =
{
STUB_FORWARDING_FUNCTION,
STUB_FORWARDING_FUNCTION,
STUB_FORWARDING_FUNCTION,
STUB_FORWARDING_FUNCTION,
NdrStubCall2,
NdrStubCall2
};
CInterfaceStubVtbl _IFace1StubVtbl =
{
&IID_IFace1,
&IFace1_ServerInfo,
9,
&IFace1_table[-3],
CStdStubBuffer_DELEGATING_METHODS
};
/* Object interface: IFace2, ver. 0.0,
GUID={0x9BF24410,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}} */
extern const MIDL_STUB_DESC Object_StubDesc;
extern const MIDL_SERVER_INFO IFace2_ServerInfo;
#pragma code_seg(".orpc")
static const unsigned short IFace2_FormatStringOffsetTable[] =
{
(unsigned short) -1,
(unsigned short) -1,
(unsigned short) -1,
(unsigned short) -1,
0,
28
};
static const MIDL_SERVER_INFO IFace2_ServerInfo =
{
&Object_StubDesc,
0,
__MIDL_ProcFormatString.Format,
&IFace2_FormatStringOffsetTable[-3],
0,
0,
0,
0
};
static const MIDL_STUBLESS_PROXY_INFO IFace2_ProxyInfo =
{
&Object_StubDesc,
__MIDL_ProcFormatString.Format,
&IFace2_FormatStringOffsetTable[-3],
0,
0,
0
};
CINTERFACE_PROXY_VTABLE(9) _IFace2ProxyVtbl =
{
&IFace2_ProxyInfo,
&IID_IFace2,
IUnknown_QueryInterface_Proxy,
IUnknown_AddRef_Proxy,
IUnknown_Release_Proxy ,
0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
0 /* IDispatch_Invoke_Proxy */ ,
(void *)-1 /* IFace2::get_Face2Nam */ ,
(void *)-1 /* IFace2::put_Face2Nam */
};
static const PRPC_STUB_FUNCTION IFace2_table[] =
{
STUB_FORWARDING_FUNCTION,
STUB_FORWARDING_FUNCTION,
STUB_FORWARDING_FUNCTION,
STUB_FORWARDING_FUNCTION,
NdrStubCall2,
NdrStubCall2
};
CInterfaceStubVtbl _IFace2StubVtbl =
{
&IID_IFace2,
&IFace2_ServerInfo,
9,
&IFace2_table[-3],
CStdStubBuffer_DELEGATING_METHODS
};
/* Object interface: IFace3, ver. 0.0,
GUID={0x9BF24411,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}} */
extern const MIDL_STUB_DESC Object_StubDesc;
extern const MIDL_SERVER_INFO IFace3_ServerInfo;
#pragma code_seg(".orpc")
extern const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[1];
static const MIDL_STUB_DESC Object_StubDesc =
{
0,
NdrOleAllocate,
NdrOleFree,
0,
0,
0,
0,
0,
__MIDL_TypeFormatString.Format,
1, /* -error bounds_check flag */
0x20000, /* Ndr library version */
0,
0x50100a4, /* MIDL Version 5.1.164 */
0,
UserMarshalRoutines,
0, /* notify & notify_flag routine table */
1, /* Flags */
0, /* Reserved3 */
0, /* Reserved4 */
0 /* Reserved5 */
};
static const unsigned short IFace3_FormatStringOffsetTable[] =
{
(unsigned short) -1,
(unsigned short) -1,
(unsigned short) -1,
(unsigned short) -1,
0,
28
};
static const MIDL_SERVER_INFO IFace3_ServerInfo =
{
&Object_StubDesc,
0,
__MIDL_ProcFormatString.Format,
&IFace3_FormatStringOffsetTable[-3],
0,
0,
0,
0
};
static const MIDL_STUBLESS_PROXY_INFO IFace3_ProxyInfo =
{
&Object_StubDesc,
__MIDL_ProcFormatString.Format,
&IFace3_FormatStringOffsetTable[-3],
0,
0,
0
};
CINTERFACE_PROXY_VTABLE(9) _IFace3ProxyVtbl =
{
&IFace3_ProxyInfo,
&IID_IFace3,
IUnknown_QueryInterface_Proxy,
IUnknown_AddRef_Proxy,
IUnknown_Release_Proxy ,
0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
0 /* IDispatch_Invoke_Proxy */ ,
(void *)-1 /* IFace3::get_Face3Name */ ,
(void *)-1 /* IFace3::put_Face3Name */
};
static const PRPC_STUB_FUNCTION IFace3_table[] =
{
STUB_FORWARDING_FUNCTION,
STUB_FORWARDING_FUNCTION,
STUB_FORWARDING_FUNCTION,
STUB_FORWARDING_FUNCTION,
NdrStubCall2,
NdrStubCall2
};
CInterfaceStubVtbl _IFace3StubVtbl =
{
&IID_IFace3,
&IFace3_ServerInfo,
9,
&IFace3_table[-3],
CStdStubBuffer_DELEGATING_METHODS
};
#pragma data_seg(".rdata")
static const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[1] =
{
{
BSTR_UserSize
,BSTR_UserMarshal
,BSTR_UserUnmarshal
,BSTR_UserFree
}
};
#if !defined(__RPC_WIN32__)
#error Invalid build platform for this stub.
#endif
#if !(TARGET_IS_NT40_OR_LATER)
#error You need a Windows NT 4.0 or later to run this stub because it uses these features:
#error -Oif or -Oicf, [wire_marshal] or [user_marshal] attribute, more than 32 methods in the interface.
#error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
#error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
#endif
static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
{
0,
{
/* Procedure get_Face3Name */
/* Procedure get_Face2Nam */
/* Procedure get_Face1Name */
0x33, /* FC_AUTO_HANDLE */
0x6c, /* Old Flags: object, Oi2 */
/* 2 */ NdrFcLong( 0x0 ), /* 0 */
/* 6 */ NdrFcShort( 0x7 ), /* 7 */
#ifndef _ALPHA_
/* 8 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */
#else
NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
#endif
/* 10 */ NdrFcShort( 0x0 ), /* 0 */
/* 12 */ NdrFcShort( 0x8 ), /* 8 */
/* 14 */ 0x5, /* Oi2 Flags: srv must size, has return, */
0x2, /* 2 */
/* Parameter pVal */
/* Parameter pVal */
/* Parameter pVal */
/* 16 */ NdrFcShort( 0x2113 ), /* Flags: must size, must free, out, simple ref, srv alloc size=8 */
#ifndef _ALPHA_
/* 18 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */
#else
NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */
#endif
/* 20 */ NdrFcShort( 0x1e ), /* Type Offset=30 */
/* Return value */
/* Return value */
/* Return value */
/* 22 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */
#ifndef _ALPHA_
/* 24 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */
#else
NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
#endif
/* 26 */ 0x8, /* FC_LONG */
0x0, /* 0 */
/* Procedure put_Face3Name */
/* Procedure put_Face2Nam */
/* Procedure put_Face1Name */
/* 28 */ 0x33, /* FC_AUTO_HANDLE */
0x6c, /* Old Flags: object, Oi2 */
/* 30 */ NdrFcLong( 0x0 ), /* 0 */
/* 34 */ NdrFcShort( 0x8 ), /* 8 */
#ifndef _ALPHA_
/* 36 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */
#else
NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
#endif
/* 38 */ NdrFcShort( 0x0 ), /* 0 */
/* 40 */ NdrFcShort( 0x8 ), /* 8 */
/* 42 */ 0x6, /* Oi2 Flags: clt must size, has return, */
0x2, /* 2 */
/* Parameter newVal */
/* Parameter newVal */
/* Parameter newVal */
/* 44 */ NdrFcShort( 0x8b ), /* Flags: must size, must free, in, by val, */
#ifndef _ALPHA_
/* 46 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */
#else
NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */
#endif
/* 48 */ NdrFcShort( 0x2c ), /* Type Offset=44 */
/* Return value */
/* Return value */
/* Return value */
/* 50 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */
#ifndef _ALPHA_
/* 52 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */
#else
NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
#endif
/* 54 */ 0x8, /* FC_LONG */
0x0, /* 0 */
0x0
}
};
static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
{
0,
{
NdrFcShort( 0x0 ), /* 0 */
/* 2 */
0x11, 0x4, /* FC_RP [alloced_on_stack] */
/* 4 */ NdrFcShort( 0x1a ), /* Offset= 26 (30) */
/* 6 */
0x13, 0x0, /* FC_OP */
/* 8 */ NdrFcShort( 0xc ), /* Offset= 12 (20) */
/* 10 */
0x1b, /* FC_CARRAY */
0x1, /* 1 */
/* 12 */ NdrFcShort( 0x2 ), /* 2 */
/* 14 */ 0x9, /* Corr desc: FC_ULONG */
0x0, /* */
/* 16 */ NdrFcShort( 0xfffc ), /* -4 */
/* 18 */ 0x6, /* FC_SHORT */
0x5b, /* FC_END */
/* 20 */
0x17, /* FC_CSTRUCT */
0x3, /* 3 */
/* 22 */ NdrFcShort( 0x8 ), /* 8 */
/* 24 */ NdrFcShort( 0xfffffff2 ), /* Offset= -14 (10) */
/* 26 */ 0x8, /* FC_LONG */
0x8, /* FC_LONG */
/* 28 */ 0x5c, /* FC_PAD */
0x5b, /* FC_END */
/* 30 */ 0xb4, /* FC_USER_MARSHAL */
0x83, /* 131 */
/* 32 */ NdrFcShort( 0x0 ), /* 0 */
/* 34 */ NdrFcShort( 0x4 ), /* 4 */
/* 36 */ NdrFcShort( 0x0 ), /* 0 */
/* 38 */ NdrFcShort( 0xffffffe0 ), /* Offset= -32 (6) */
/* 40 */
0x12, 0x0, /* FC_UP */
/* 42 */ NdrFcShort( 0xffffffea ), /* Offset= -22 (20) */
/* 44 */ 0xb4, /* FC_USER_MARSHAL */
0x83, /* 131 */
/* 46 */ NdrFcShort( 0x0 ), /* 0 */
/* 48 */ NdrFcShort( 0x4 ), /* 4 */
/* 50 */ NdrFcShort( 0x0 ), /* 0 */
/* 52 */ NdrFcShort( 0xfffffff4 ), /* Offset= -12 (40) */
0x0
}
};
const CInterfaceProxyVtbl * _MultiFace_ProxyVtblList[] =
{
( CInterfaceProxyVtbl *) &_IFace1ProxyVtbl,
( CInterfaceProxyVtbl *) &_IFace2ProxyVtbl,
( CInterfaceProxyVtbl *) &_IFace3ProxyVtbl,
0
};
const CInterfaceStubVtbl * _MultiFace_StubVtblList[] =
{
( CInterfaceStubVtbl *) &_IFace1StubVtbl,
( CInterfaceStubVtbl *) &_IFace2StubVtbl,
( CInterfaceStubVtbl *) &_IFace3StubVtbl,
0
};
PCInterfaceName const _MultiFace_InterfaceNamesList[] =
{
"IFace1",
"IFace2",
"IFace3",
0
};
const IID * _MultiFace_BaseIIDList[] =
{
&IID_IDispatch,
&IID_IDispatch,
&IID_IDispatch,
0
};
#define _MultiFace_CHECK_IID(n) IID_GENERIC_CHECK_IID( _MultiFace, pIID, n)
int __stdcall _MultiFace_IID_Lookup( const IID * pIID, int * pIndex )
{
IID_BS_LOOKUP_SETUP
IID_BS_LOOKUP_INITIAL_TEST( _MultiFace, 3, 2 )
IID_BS_LOOKUP_NEXT_TEST( _MultiFace, 1 )
IID_BS_LOOKUP_RETURN_RESULT( _MultiFace, 3, *pIndex )
}
const ExtendedProxyFileInfo MultiFace_ProxyFileInfo =
{
(PCInterfaceProxyVtblList *) & _MultiFace_ProxyVtblList,
(PCInterfaceStubVtblList *) & _MultiFace_StubVtblList,
(const PCInterfaceName * ) & _MultiFace_InterfaceNamesList,
(const IID ** ) & _MultiFace_BaseIIDList,
& _MultiFace_IID_Lookup,
3,
2,
0, /* table of [async_uuid] interfaces */
0, /* Filler1 */
0, /* Filler2 */
0 /* Filler3 */
};

View File

@@ -1,11 +0,0 @@
LIBRARY "MultiFacePS"
DESCRIPTION 'Proxy/Stub DLL'
EXPORTS
DllGetClassObject @1 PRIVATE
DllCanUnloadNow @2 PRIVATE
GetProxyDllInfo @3 PRIVATE
DllRegisterServer @4 PRIVATE
DllUnregisterServer @5 PRIVATE

View File

@@ -1,16 +0,0 @@
MultiFaceps.dll: dlldata.obj MultiFace_p.obj MultiFace_i.obj
link /dll /out:MultiFaceps.dll /def:MultiFaceps.def /entry:DllMain dlldata.obj MultiFace_p.obj MultiFace_i.obj \
kernel32.lib rpcndr.lib rpcns4.lib rpcrt4.lib oleaut32.lib uuid.lib \
.c.obj:
cl /c /Ox /DWIN32 /D_WIN32_WINNT=0x0400 /DREGISTER_PROXY_DLL \
$<
clean:
@del MultiFaceps.dll
@del MultiFaceps.lib
@del MultiFaceps.exp
@del dlldata.obj
@del MultiFace_p.obj
@del MultiFace_i.obj

View File

@@ -1,12 +0,0 @@
// stdafx.cpp : source file that includes just the standard includes
// stdafx.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
#ifdef _ATL_STATIC_REGISTRY
#include <statreg.h>
#include <statreg.cpp>
#endif
#include <atlimpl.cpp>

View File

@@ -1,27 +0,0 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently
#if !defined(AFX_STDAFX_H__9BF24406_B2E0_11D4_A695_00104BFF3241__INCLUDED_)
#define AFX_STDAFX_H__9BF24406_B2E0_11D4_A695_00104BFF3241__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define STRICT
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400
#endif
#define _ATL_APARTMENT_THREADED
#include <atlbase.h>
//You may derive a class from CComModule and use it if you want to override
//something, but do not change the name of _Module
extern CComModule _Module;
#include <atlcom.h>
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__9BF24406_B2E0_11D4_A695_00104BFF3241__INCLUDED)

View File

@@ -1,38 +0,0 @@
/*********************************************************
DllData file -- generated by MIDL compiler
DO NOT ALTER THIS FILE
This file is regenerated by MIDL on every IDL file compile.
To completely reconstruct this file, delete it and rerun MIDL
on all the IDL files in this DLL, specifying this file for the
/dlldata command line option
*********************************************************/
#define PROXY_DELEGATION
#include <rpcproxy.h>
#ifdef __cplusplus
extern "C" {
#endif
EXTERN_PROXY_FILE( MultiFace )
PROXYFILE_LIST_START
/* Start of list */
REFERENCE_PROXY_FILE( MultiFace ),
/* End of list */
PROXYFILE_LIST_END
DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
#ifdef __cplusplus
} /*extern "C" */
#endif
/* end of generated dlldata file */

View File

@@ -1,18 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by MultiFace.rc
//
#define IDS_PROJNAME 100
#define IDS_FACE_DESC 101
#define IDR_Face 102
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 201
#define _APS_NEXT_COMMAND_VALUE 32768
#define _APS_NEXT_CONTROL_VALUE 201
#define _APS_NEXT_SYMED_VALUE 103
#endif
#endif

View File

@@ -1,46 +0,0 @@
package com.jacob.samples.atl;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
class MultiFaceTest {
/**
* standard main() test program
*
* @param args
* the command line arguments
*/
public static void main(String[] args) {
// this method has been deprecated as being unreliable.
// shutdown should be done through other means
// whoever wrote this example should explain what this was intended to
// do
// System.runFinalizersOnExit(true);
ActiveXComponent mf = new ActiveXComponent("MultiFace.Face");
try {
// I am now dealing with the default interface (IFace1)
Dispatch.put(mf, "Face1Name", new Variant("Hello Face1"));
System.out.println(Dispatch.get(mf, "Face1Name"));
// get to IFace2 through the IID
Dispatch f2 = mf
.QueryInterface("{9BF24410-B2E0-11D4-A695-00104BFF3241}");
// I am now dealing with IFace2
Dispatch.put(f2, "Face2Nam", new Variant("Hello Face2"));
System.out.println(Dispatch.get(f2, "Face2Nam"));
// get to IFace3 through the IID
Dispatch f3 = mf
.QueryInterface("{9BF24411-B2E0-11D4-A695-00104BFF3241}");
// I am now dealing with IFace3
Dispatch.put(f3, "Face3Name", new Variant("Hello Face3"));
System.out.println(Dispatch.get(f3, "Face3Name"));
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -1,14 +0,0 @@
This example demonstrates how to access multiple interfaces.
To run it, chdir to MultiFace\Debug and run:
regsvr32 MultiFace.dll
Then, run (in this dir):
java MultiFace
As you can see from MultiFace\MultiFace.idl - there are 3 interfaces.
By default JACOB attaches to the default interface.
The file MultiFace.java shows how to use the new Dispatch.QueryInterface
to get access to the other interfaces.

View File

@@ -1,52 +0,0 @@
package com.jacob.samples.office;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.ComThread;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
/**
* Sample test program snagged out of a question on the sun discussion area.
* <p>
* May need to run with some command line options (including from inside
* Eclipse). Look in the docs area at the Jacob usage document for command line
* options.
*/
public class ExcelDispatchTest {
/**
* main run loop for test program
*
* @param args
* standard command line arguments
*/
public static void main(String[] args) {
ComThread.InitSTA();
ActiveXComponent xl = new ActiveXComponent("Excel.Application");
try {
System.out.println("version=" + xl.getProperty("Version"));
System.out.println("version=" + Dispatch.get(xl, "Version"));
Dispatch.put(xl, "Visible", new Variant(true));
Dispatch workbooks = xl.getProperty("Workbooks").toDispatch();
Dispatch workbook = Dispatch.get(workbooks, "Add").toDispatch();
Dispatch sheet = Dispatch.get(workbook, "ActiveSheet").toDispatch();
Dispatch a1 = Dispatch.invoke(sheet, "Range", Dispatch.Get,
new Object[] { "A1" }, new int[1]).toDispatch();
Dispatch a2 = Dispatch.invoke(sheet, "Range", Dispatch.Get,
new Object[] { "A2" }, new int[1]).toDispatch();
Dispatch.put(a1, "Value", "123.456");
Dispatch.put(a2, "Formula", "=A1*2");
System.out.println("a1 from excel:" + Dispatch.get(a1, "Value"));
System.out.println("a2 from excel:" + Dispatch.get(a2, "Value"));
Variant f = new Variant(false);
Dispatch.call(workbook, "Close", f);
} catch (Exception e) {
e.printStackTrace();
} finally {
xl.invoke("Quit", new Variant[] {});
ComThread.Release();
}
}
}

View File

@@ -1,48 +0,0 @@
package com.jacob.samples.office;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.ComFailException;
import com.jacob.com.Dispatch;
/**
* Snippet to show Visio print dialog
* <p>
* Sample submitted by fatbuttlarry in SourceForge 1803140 as part of bug report
* <p>
* Tested with Java 6.0SE and MS Office 2003 ** Note: 1010 = VB's
* visCmdFilePrint constant
*/
public class VisioPrintTest {
/**
* Runs the print ant lets the user say ok or cancel. Note the funky Visio
* behavior if someone hits the cancel button
*
*/
public void testPrintDialog() {
ActiveXComponent oActiveX = new ActiveXComponent("Visio.Application");
Dispatch oDocuments = oActiveX.getProperty("Documents").toDispatch();
// create a blank document
Dispatch.call(oDocuments, "Add", "");
try {
Dispatch.call(oActiveX, "DoCmd", new Integer(1010)).getInt();
System.out.println("User hit the ok button.");
} catch (ComFailException e) {
System.out.println("User hit the cancel button: " + e);
} finally {
oActiveX.invoke("Quit");
}
return;
}
/**
* quick main() to test this
*
* @param args
* standard command line arguments
*/
public static void main(String[] args) {
VisioPrintTest testObject = new VisioPrintTest();
testObject.testPrintDialog();
}
}

View File

@@ -1,165 +0,0 @@
package com.jacob.samples.office;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.ComException;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
/**
* Submitted to the Jacob SourceForge web site as a sample 3/2005
*
* @author Date Created Description Jason Twist 04 Mar 2005 Code opens a locally
* stored Word document and extracts the Built In properties and Custom
* properties from it. This code just gives an intro to JACOB and there
* are sections that could be enhanced
*/
public class WordDocumentProperties {
// Declare word object
private ActiveXComponent objWord;
// Declare Word Properties
private Dispatch custDocprops;
private Dispatch builtInDocProps;
// the doucments object is important in any real app but this demo doesn't
// use it
// private Dispatch documents;
private Dispatch document;
private Dispatch wordObject;
/**
* Empty Constructor
*
*/
public WordDocumentProperties() {
}
/**
* Opens a document
*
* @param filename
*/
public void open(String filename) {
// Instantiate objWord
objWord = new ActiveXComponent("Word.Application");
// Assign a local word object
wordObject = objWord.getObject();
// Create a Dispatch Parameter to hide the document that is opened
Dispatch.put(wordObject, "Visible", new Variant(false));
// Instantiate the Documents Property
Dispatch documents = objWord.getProperty("Documents").toDispatch();
// Open a word document, Current Active Document
document = Dispatch.call(documents, "Open", filename).toDispatch();
}
/**
* Creates an instance of the VBA CustomDocumentProperties property
*
*/
public void selectCustomDocumentProperitiesMode() {
// Create CustomDocumentProperties and BuiltInDocumentProperties
// properties
custDocprops = Dispatch.get(document, "CustomDocumentProperties")
.toDispatch();
}
/**
* Creates an instance of the VBA BuiltInDocumentProperties property
*
*/
public void selectBuiltinPropertiesMode() {
// Create CustomDocumentProperties and BuiltInDocumentProperties
// properties
builtInDocProps = Dispatch.get(document, "BuiltInDocumentProperties")
.toDispatch();
}
/**
* Closes a document
*
*/
public void close() {
// Close object
Dispatch.call(document, "Close");
}
/**
* Custom Property Name is passed in
*
* @param cusPropName
* @return String - Custom property value
*/
public String getCustomProperty(String cusPropName) {
try {
cusPropName = Dispatch.call(custDocprops, "Item", cusPropName)
.toString();
} catch (ComException e) {
// Do nothing
cusPropName = null;
}
return cusPropName;
}
/**
* Built In Property Name is passed in
*
* @param builtInPropName
* @return String - Built in property value
*/
public String getBuiltInProperty(String builtInPropName) {
try {
builtInPropName = Dispatch.call(builtInDocProps, "Item",
builtInPropName).toString();
} catch (ComException e) {
// Do nothing
builtInPropName = null;
}
return builtInPropName;
}
/**
* simple main program that gets some properties and prints them out
*
* @param args
*/
public static void main(String[] args) {
try {
// Instantiate the class
WordDocumentProperties jacTest = new WordDocumentProperties();
// Open the word doc
jacTest.open("\\\\Saturn\\documentstorage\\s.doc");
// Set Custom Properties
jacTest.selectCustomDocumentProperitiesMode();
// Set Built In Properties
jacTest.selectBuiltinPropertiesMode();
// Get custom Property Value
String custValue = jacTest.getCustomProperty("Information Source");
// Get built in prroperty Property Value
String builtInValue = jacTest.getBuiltInProperty("Author");
// Close Word Doc
jacTest.close();
// Output data
System.out.println("Document Val One: " + custValue);
System.out.println("Document Author: " + builtInValue);
} catch (Exception e) {
System.out.println(e);
}
}
}

View File

@@ -1,80 +0,0 @@
package com.jacob.samples.outlook;
/**
* JACOB Outlook sample contributed by
* Christopher Brind <christopher.brind@morse.com>
*/
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
/**
* sample class to show simple outlook manipulation
*/
public class Outlook {
private static String pad(int i) {
StringBuffer sb = new StringBuffer();
while (sb.length() < i) {
sb.append(' ');
}
return sb.toString();
}
private static void recurseFolders(int iIndent, Dispatch o) {
if (o == null) {
return;
}
Dispatch oFolders = Dispatch.get(o, "Folders").toDispatch();
// System.out.println("oFolders=" + oFolders);
if (oFolders == null) {
return;
}
Dispatch oFolder = Dispatch.get(oFolders, "GetFirst").toDispatch();
do {
Object oFolderName = Dispatch.get(oFolder, "Name");
if (null == oFolderName) {
break;
}
System.out.println(pad(iIndent) + oFolderName);
recurseFolders(iIndent + 3, oFolder);
oFolder = Dispatch.get(oFolders, "GetNext").toDispatch();
} while (true);
}
/**
* standard run loop
*
* @param asArgs
* command line arguments
* @throws Exception
*/
public static void main(String asArgs[]) throws Exception {
System.out.println("Outlook: IN");
ActiveXComponent axOutlook = new ActiveXComponent("Outlook.Application");
try {
System.out.println("version=" + axOutlook.getProperty("Version"));
Dispatch oOutlook = axOutlook.getObject();
System.out.println("version=" + Dispatch.get(oOutlook, "Version"));
Dispatch oNameSpace = axOutlook.getProperty("Session").toDispatch();
System.out.println("oNameSpace=" + oNameSpace);
recurseFolders(0, oNameSpace);
} finally {
axOutlook.invoke("Quit", new Variant[] {});
}
}
}

View File

@@ -1,75 +0,0 @@
package com.jacob.samples.servlet;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import com.jacob.com.*;
import com.jacob.activeX.*;
public class JacobScript extends javax.servlet.http.HttpServlet
{
public void doGet(HttpServletRequest req,
HttpServletResponse res)
throws ServletException
{
PrintWriter out = null;
try
{
res.setContentType("text/html");
out = res.getWriter();
// display a form
out.println("<h1>Enter a VBScript Expression</h1>");
out.println("<form method=\"POST\" action=\"/JacobScript\">");
out.println("<input name=\"expr\" type=\"text\" width=64>");
out.println("<input type=\"submit\">");
out.println("</form>");
} catch (Exception e) {
e.printStackTrace();
out.println("<H2>Error:"+e+"</H2>");
}
}
public void doPost(HttpServletRequest req,
HttpServletResponse res)
throws ServletException
{
PrintWriter out = null;
try
{
res.setContentType("text/html");
out = res.getWriter();
// get what they typed in
String expr = (String)req.getParameter("expr");
// make sure we have a session
HttpSession session = req.getSession(true);
Dispatch sControl = null;
if (session.isNew())
{
// initialize the control and store it on the session
String lang = "VBScript";
ActiveXComponent sC = new ActiveXComponent("ScriptControl");
sControl = sC.getObject();
Dispatch.put(sControl, "Language", lang);
session.putValue("control", sControl);
}
else
{
sControl = (Dispatch)session.getValue("control");
}
Variant result = Dispatch.call(sControl, "Eval", expr);
// display a form
out.println("<h1>Enter a VBScript Expression</h1>");
out.println("<form method=\"POST\" action=\"/JacobScript\">");
out.println("<input name=\"expr\" type=\"text\" value=\""+expr+"\" width=64>");
out.println("<input type=\"submit\">");
out.println("</form>");
out.println("<H1>Jacob Response:</H1>");
out.println("<H2>"+result+"</H2>");
} catch (Exception e) {
e.printStackTrace();
out.println("<H2>Error:"+e+"</H2>");
}
}
}

View File

@@ -1,45 +0,0 @@
This sample runs in Weblogic 5.1 as a servlet.
0. Rename JacobScript.java_nocompile to JacobScript.java
1. Compile this file (make sure you have jdk1.2 installed or the
javax.servlet.* classes in your classpath).
2. Make sure the weblogic policy file allows native access. The easiest
way is to replace the contents with this:
grant codeBase "file:d:/weblogic/-" {
permission java.security.AllPermission;
};
grant codeBase "file:/c:/classes/-" {
permission java.security.AllPermission;
};
grant codeBase "file:${java.home}/lib/ext/-" {
permission java.security.AllPermission;
};
grant {
permission java.security.AllPermission;
};
3. Add the servlet to the weblogic.properties file:
weblogic.httpd.register.JacobScript=JacobScript
4. Either add your CLASSPATH to weblogic.classpath in startWebLogic.cmd
or copy the com directory into weblogic/myserver/servletclasses
5. Copy the jacob/samples/servlet/* into weblogic/myserver/servletclasses
6. Start weblogic
7. Type the url: http://localhost:7001/JacobScript into the browser
(If you run on port 7001)
8. Enter a VBScript expression like:
1+2
Now
"hello" & " world"
etc.
and watch the MS Script control (which you must have installed)
evaluate and return the result.

View File

@@ -1,152 +0,0 @@
package com.jacob.samples.system;
import java.text.DecimalFormat;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.ComThread;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
/**
* Example VB script that grabs hard drive properties.
* <p>
* Source Forge posting
* http://sourceforge.net/forum/forum.php?thread_id=1785936&forum_id=375946
* <p>
* Enhance by clay_shooter with info from
* http://msdn2.microsoft.com/en-us/library/d6dw7aeh.aspx
*
* @author qstephenson
*
*/
public class DiskUtils {
/** formatters aren't thread safe but the sample only has one thread */
private static DecimalFormat sizeFormatter = new DecimalFormat(
"###,###,###,###");
/** a pointer to the scripting file system object */
private ActiveXComponent fileSystemApp = null;
/** the dispatch that points at the drive this DiskUtil operates against */
private Dispatch myDrive = null;
/**
* Standard constructor
*
* @param drive
* the drive to run the test against.
*/
public DiskUtils(String drive) {
setUp(drive);
}
/**
* open the connection to the scripting object
*
* @param drive
* the drive to run the test against
*/
public void setUp(String drive) {
if (fileSystemApp == null) {
ComThread.InitSTA();
fileSystemApp = new ActiveXComponent("Scripting.FileSystemObject");
myDrive = Dispatch.call(fileSystemApp, "GetDrive", drive)
.toDispatch();
}
}
/**
* Do any needed cleanup
*/
public void tearDown() {
ComThread.Release();
}
/**
* convenience method
*
* @return driver serial number
*/
public int getSerialNumber() {
return Dispatch.get(myDrive, "SerialNumber").getInt();
}
/**
* Convenience method. We go through these formatting hoops so we can make
* the size string pretty. We wouldn't have to do that if we didn't mind
* long strings with Exxx at the end or the fact that the value returned can
* vary in size based on the size of the disk.
*
* @return driver total size of the disk
*/
public String getTotalSize() {
Variant returnValue = Dispatch.get(myDrive, "TotalSize");
if (returnValue.getvt() == Variant.VariantDouble) {
return sizeFormatter.format(returnValue.getDouble());
} else if (returnValue.getvt() == Variant.VariantInt) {
return sizeFormatter.format(returnValue.getInt());
} else {
return "Don't know type: " + returnValue.getvt();
}
}
/**
* Convenience method. We wouldn't have to do that if we didn't mind long
* strings with Exxx at the end or the fact that the value returned can vary
* in size based on the size of the disk.
*
* @return driver free size of the disk
*/
public String getFreeSpace() {
Variant returnValue = Dispatch.get(myDrive, "FreeSpace");
if (returnValue.getvt() == Variant.VariantDouble) {
return sizeFormatter.format(returnValue.getDouble());
} else if (returnValue.getvt() == Variant.VariantInt) {
return sizeFormatter.format(returnValue.getInt());
} else {
return "Don't know type: " + returnValue.getvt();
}
}
/**
*
* @return file system on the drive
*/
public String getFileSystemType() {
// figure ot the actual variant type
// Variant returnValue = Dispatch.get(myDrive, "FileSystem");
// System.out.println(returnValue.getvt());
return Dispatch.get(myDrive, "FileSystem").getString();
}
/**
*
* @return volume name
*/
public String getVolumeName() {
return Dispatch.get(myDrive, "VolumeName").getString();
}
/**
* Simple main program that creates a DiskUtils object and queries for the
* C: drive
*
* @param args
* standard command line arguments
*/
public static void main(String[] args) {
// DiskUtils utilConnection = new DiskUtils("F");
DiskUtils utilConnection = new DiskUtils("C");
System.out.println("Disk serial number is: "
+ utilConnection.getSerialNumber());
System.out.println("FileSystem is: "
+ utilConnection.getFileSystemType());
System.out.println("Volume Name is: " + utilConnection.getVolumeName());
System.out.println("Disk total size is: "
+ utilConnection.getTotalSize());
System.out.println("Disk free space is: "
+ utilConnection.getFreeSpace());
utilConnection.tearDown();
}
}

View File

@@ -1,75 +0,0 @@
package com.jacob.samples.system;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Dispatch;
import com.jacob.com.EnumVariant;
import com.jacob.com.Variant;
/**
* Sample program that shows how to talk to WMI on local machine.
*
* This test program was derived from SourceForge question
* http://sourceforge.net/forum/forum.php?thread_id=1831650&forum_id=375946
* fold, spindled and mutilated by clay_shooter
*
* @author chris_knowles
*
*/
public class SystemMonitor {
/**
* example run loop method called by main()
*/
public void runMonitor() {
ActiveXComponent wmi = null;
wmi = new ActiveXComponent("WbemScripting.SWbemLocator");
// no connection parameters means to connect to the local machine
Variant conRet = wmi.invoke("ConnectServer");
// the author liked the ActiveXComponent api style over the Dispatch
// style
ActiveXComponent wmiconnect = new ActiveXComponent(conRet.toDispatch());
// the WMI supports a query language.
String query = "select CategoryString, Message, TimeGenerated, User, Type "
+ "from Win32_NtLogEvent "
+ "where Logfile = 'Application' and TimeGenerated > '20070915000000.000000-***'";
Variant vCollection = wmiconnect
.invoke("ExecQuery", new Variant(query));
EnumVariant enumVariant = new EnumVariant(vCollection.toDispatch());
String resultString = "";
Dispatch item = null;
while (enumVariant.hasMoreElements()) {
resultString = "";
item = enumVariant.nextElement().toDispatch();
String categoryString = Dispatch.call(item, "CategoryString")
.toString();
String messageString = Dispatch.call(item, "Message").toString();
String timeGenerated = Dispatch.call(item, "TimeGenerated")
.toString();
String eventUser = Dispatch.call(item, "User").toString();
String eventType = Dispatch.call(item, "Type").toString();
resultString += "TimeGenerated: " + timeGenerated + " Category: "
+ categoryString + " User: " + eventUser + " EventType: "
+ eventType + " Message:" + messageString;
System.out.println(resultString);
}
}
/**
* sample's main program
*
* @param args
* command line arguments
*/
public static void main(String[] args) {
SystemMonitor utilConnection = new SystemMonitor();
utilConnection.runMonitor();
}
}

View File

@@ -1,121 +0,0 @@
package com.jacob.samples.visio;
import java.io.File;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.DispatchEvents;
import com.jacob.com.Variant;
/**
* Created as part of sourceforge 1386454 to demonstrate returning values in
* event handlers
*
* @author miles@rowansoftware.net
*
* This class represents the visio app itself
*/
public class VisioApp extends ActiveXComponent {
/**
* constructor that spins up Visio
*
* @throws VisioException
*/
public VisioApp() throws VisioException {
super("Visio.Application");
setVisible(false);
}
/**
* creates a DispatchEvents object to register o as a listener
*
* @param o
*/
public void addEventListener(VisioEventListener o) {
DispatchEvents events = new DispatchEvents(this, o);
if (events == null) {
System.out
.println("You should never get null back when creating a DispatchEvents object");
}
}
/**
* opens the passed in file in Visio
*
* @param f
* @throws VisioException
*/
public void open(File f) throws VisioException {
try {
ActiveXComponent documents = new ActiveXComponent(getProperty(
"Documents").toDispatch());
Variant[] args = new Variant[1];
args[0] = new Variant(f.getPath());
documents.invoke("Open", args);
} catch (Exception e) {
e.printStackTrace();
throw new VisioException(e);
}
}
/**
* tells Visio to save the drawing
*
* @throws VisioException
*/
public void save() throws VisioException {
try {
ActiveXComponent document = new ActiveXComponent(getProperty(
"ActiveDocument").toDispatch());
document.invoke("Save");
} catch (Exception e) {
e.printStackTrace();
throw new VisioException(e);
}
}
/**
* terminates Visio
*/
public void quit() {
System.out.println("Received quit()");
// there can't be any open documents for this to work
// you'll get a visio error if you don't close them
ActiveXComponent document = new ActiveXComponent(getProperty(
"ActiveDocument").toDispatch());
document.invoke("Close");
invoke("Quit");
}
/**
* runs the Visio export command
*
* @param f
* @throws VisioException
*/
public void export(File f) throws VisioException {
try {
ActiveXComponent document = new ActiveXComponent(getProperty(
"ActivePage").toDispatch());
Variant[] args = new Variant[1];
args[0] = new Variant(f.getPath());
document.invoke("Export", args);
} catch (Exception e) {
throw new VisioException(e);
}
}
/**
* makes Visio visible so the user can watch
*
* @param b
* @throws VisioException
*/
public void setVisible(boolean b) throws VisioException {
try {
setProperty("Visible", new Variant(b));
} catch (Exception e) {
throw new VisioException(e);
}
}
}

View File

@@ -1,180 +0,0 @@
package com.jacob.samples.visio;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
/**
* Created as part of sourceforge 1386454 to demonstrate returning values in
* event handlers
*
* @author miles@rowansoftware.net
*
* This singleton isolates the demo app from the Visio instance object so that
* you can't try and send messages to a dead Visio instance after quit() has
* been called. Direct consumption of VisioApp would mean you could quit but
* would still have a handle to the no longer connected application proxy
*
*/
public class VisioAppFacade {
private VisioApp app;
private static VisioAppFacade instance;
/** extension for image files */
public static final String IMAGE_EXT = ".jpg";
/** extension for visio files */
public static final String VISIO_EXT = ".vsd";
/** the buffer size when we want to read stuff in */
public static final int BUFFER_SIZE = 2048;
/**
* Wrapper around Visio
*
* @throws VisioException
*/
private VisioAppFacade() throws VisioException {
this.app = new VisioApp();
app.addEventListener(new VisioEventAdapter(app));
}
/**
* @return the singleton instance of Visio
* @throws VisioException
*/
public static VisioAppFacade getInstance() throws VisioException {
if (instance == null) {
instance = new VisioAppFacade();
}
return instance;
}
/**
* creates a preview in a temp file and returns the raw data.
*
* @param visioData
* @return raw preview data
* @throws VisioException
*/
public byte[] createPreview(byte[] visioData) throws VisioException {
byte[] preview;
File tmpFile;
try {
tmpFile = getTempVisioFile();
OutputStream out = new FileOutputStream(tmpFile);
out.write(visioData);
out.close();
} catch (IOException ioe) {
throw new VisioException(ioe);
}
preview = createPreview(tmpFile);
tmpFile.delete();
return preview;
}
/**
* reads a preview from a saved file
*
* @param visioFile
* @return raw preview data
* @throws VisioException
*/
public byte[] createPreview(File visioFile) throws VisioException {
try {
File imageFile;
imageFile = getTempImageFile();
app.open(visioFile);
app.export(imageFile);
ByteArrayOutputStream bout = new ByteArrayOutputStream();
FileInputStream fin = new FileInputStream(imageFile);
copy(fin, bout);
fin.close();
imageFile.delete();
bout.close();
return bout.toByteArray();
} catch (IOException ioe) {
throw new VisioException(ioe);
}
}
private void copy(InputStream in, OutputStream out) throws IOException {
byte[] buff = new byte[BUFFER_SIZE];
int read;
do {
read = in.read(buff);
if (read > 0) {
out.write(buff, 0, read);
}
} while (read > 0);
}
/**
* creates a preview from an input stream
*
* @param in
* @return byte contents of the preview stream
* @throws VisioException
*/
public byte[] createPreview(InputStream in) throws VisioException {
byte[] preview;
// byte[] buff = new byte[2048];
// int read = 0;
OutputStream out;
File tmpFile;
try {
tmpFile = getTempVisioFile();
out = new FileOutputStream(tmpFile);
copy(in, out);
out.close();
} catch (IOException ioe) {
throw new VisioException(ioe);
}
preview = createPreview(tmpFile);
tmpFile.delete();
return preview;
}
/**
* opens the file in Visio and makes the editor visible
*
* @param f
* the reference to the Visio file to be opened
* @throws VisioException
*/
public void editDiagram(File f) throws VisioException {
app.open(f);
app.setVisible(true);
}
/**
* creates a temporary viso file
*
* @return created visio temporary file
* @throws IOException
*/
private File getTempVisioFile() throws IOException {
return File.createTempFile("java", VISIO_EXT);
}
/**
* creates a temporary image file and returns the File object
*
* @return the created image file object
* @throws IOException
*/
private File getTempImageFile() throws IOException {
return File.createTempFile("java", IMAGE_EXT);
}
/** exit visio */
public void quit() {
app.quit();
instance = null;
}
}

View File

@@ -1,197 +0,0 @@
package com.jacob.samples.visio;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.io.File;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import javax.swing.filechooser.FileFilter;
import com.jacob.com.ComThread;
/**
* Created as part of sourceforge 1386454 to demonstrate returning values in
* event handlers
*
* @author miles@rowansoftware.net
* <p>
* This file contains the main() that runs the demo
* <p>
* Look in the docs area at the Jacob usage document for command line
* options.
*/
public class VisioDemo extends JFrame implements ActionListener, WindowListener {
/**
* Totally dummy value to make Eclipse quit complaining
*/
private static final long serialVersionUID = 1L;
JButton chooseButton;
JButton openButton;
JPanel buttons;
ImageIcon theImage;
JLabel theLabel; // the icon on the page is actually this button's icon
File selectedFile;
/** everyone should get this through getVisio() */
private VisioAppFacade visioProxy = null;
// put this up here so it remembers where we were on the last choose
JFileChooser chooser = null;
public class VisioFileFilter extends FileFilter {
public boolean accept(File f) {
if (f.isDirectory()) {
return true;
} else {
return (f.getName().toUpperCase().endsWith(".VSD"));
}
}
public String getDescription() {
return "Visio Drawings";
}
}
public VisioDemo() {
super("Visio in Swing POC");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
buttons = new JPanel();
getContentPane().setLayout(new BorderLayout());
chooseButton = new JButton("Choose file to display");
openButton = new JButton("Open file chosen file in Visio");
chooseButton.addActionListener(this);
openButton.addActionListener(this);
buttons.add(chooseButton);
buttons.add(openButton);
getContentPane().add(buttons, BorderLayout.SOUTH);
theLabel = new JLabel("");
getContentPane().add(theLabel, BorderLayout.CENTER);
addWindowListener(this);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
setSize(640, 480);
this.setVisible(true);
}
public static void main(String args[]) throws Exception {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
ComThread.InitSTA();
VisioDemo poc = new VisioDemo();
ComThread.Release();
if (poc == null) {
System.out.println("poc== null? That should never happen!");
}
}
});
}
public void actionPerformed(ActionEvent e) {
if (e.getSource() == chooseButton) {
pickFile();
} else if (e.getSource() == openButton) {
try {
openFile();
} catch (Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
} else {
System.out.println("Awesome!");
}
}
private void pickFile() {
try {
chooser = new JFileChooser();
// comment this out if you want it to always go to myDocuments
chooser
.setCurrentDirectory(new File(System
.getProperty("user.dir")));
chooser.setFileFilter(new VisioFileFilter());
int returnVal = chooser.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
selectedFile = chooser.getSelectedFile();
showSelectedFilePreview();
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* use this private method instead of initializing on boot up so that
* instance and all listeners are created in this thread (event thread)
* rather than root thread
*
* @return
*/
private VisioAppFacade getVisio() {
if (visioProxy == null) {
try {
visioProxy = VisioAppFacade.getInstance();
} catch (VisioException ve) {
System.out.println("ailed to openFile()");
ve.printStackTrace();
}
}
return visioProxy;
}
private void showSelectedFilePreview() throws VisioException {
if (selectedFile != null) {
byte[] image = getVisio().createPreview(selectedFile);
theImage = new ImageIcon(image);
theLabel.setIcon(theImage);
}
}
private void openFile() throws VisioException {
try {
getVisio().editDiagram(selectedFile);
showSelectedFilePreview();
} catch (VisioException ve) {
System.out.println("ailed to openFile()");
ve.printStackTrace();
}
}
public void windowActivated(WindowEvent e) {
}
public void windowClosed(WindowEvent e) {
System.out.println("WINDOW CLOSED");
if (visioProxy != null) {
visioProxy.quit();
}
}
public void windowClosing(WindowEvent e) {
}
public void windowDeactivated(WindowEvent e) {
}
public void windowDeiconified(WindowEvent e) {
}
public void windowIconified(WindowEvent e) {
System.out.println("Fooboo");
}
public void windowOpened(WindowEvent e) {
}
}

View File

@@ -1,68 +0,0 @@
package com.jacob.samples.visio;
import com.jacob.com.Variant;
/**
* Created as part of sourceforge 1386454 to demonstrate returning values in
* event handlers
*
* @author miles@rowansoftware.net
*
* You can subclass this class and only implement the methods you're interested
* in
*/
public class VisioEventAdapter implements VisioEventListener {
VisioApp app = null;
public VisioEventAdapter(VisioApp pApp) {
app = pApp;
System.out.println("Event listener constructed");
}
public void BeforeQuit(Variant[] args) {
}
public void DocumentChanged(Variant[] args) {
System.out.println("documentChanged()");
}
public void DocumentCloseCanceled(Variant[] args) {
}
public void DocumentCreated(Variant[] args) {
}
public void DocumentOpened(Variant[] args) {
System.out.println("DocumentOpened()");
}
public void DocumentSaved(Variant[] args) {
}
public void DocumentSavedAs(Variant[] args) {
}
public Variant QueryCancelDocumentClose(Variant[] args) {
System.out.println("QueryCancelDocumentClose()");
return new Variant(false);
}
/**
* we don't actually let it quit. We block it so that we don't have to
* relaunch when we look at a new document
*/
public Variant QueryCancelQuit(Variant[] args) {
// these may throw VisioException
System.out
.println("Saving document, hiding and telling visio not to quit");
try {
app.save();
app.setVisible(false);
} catch (VisioException ve) {
System.out.println("ailed to openFile()");
ve.printStackTrace();
}
return new Variant(true);
}
}

View File

@@ -1,33 +0,0 @@
package com.jacob.samples.visio;
import com.jacob.com.Variant;
/**
* Created as part of sourceforge 1386454 to demonstrate returning values in
* event handlers
*
* @author miles@rowansoftware.net
*
* There are many more Visio events available. See the Microsoft Office SDK
* documentation. To receive an event, add a method to this interface whose name
* matches the event name and has only one parameter, Variant[]. The JACOB
* library will use reflection to call that method when an event is received.
*/
public interface VisioEventListener {
public void BeforeQuit(Variant[] args);
public void DocumentChanged(Variant[] args);
public void DocumentCloseCanceled(Variant[] args);
public void DocumentCreated(Variant[] args);
public void DocumentOpened(Variant[] args);
public void DocumentSaved(Variant[] args);
public void DocumentSavedAs(Variant[] args);
public Variant QueryCancelQuit(Variant[] args);
}

View File

@@ -1,25 +0,0 @@
package com.jacob.samples.visio;
/**
* Created as part of sourceforge 1386454 to demonstrate returning values in
* event handlers
*
* @author miles@rowansoftware.net
*
* This extends runtime exception so that we can be sloppy and not put catch
* blocks everywhere
*/
public class VisioException extends Exception {
/**
* Totally dummy value to make Eclipse quit complaining
*/
private static final long serialVersionUID = 1L;
public VisioException(String msg) {
super(msg);
}
public VisioException(Throwable cause) {
super(cause);
}
}

Some files were not shown because too many files have changed in this diff Show More