Initial commit
This commit is contained in:
89
samples/test/Access.java
Normal file
89
samples/test/Access.java
Normal file
@@ -0,0 +1,89 @@
|
||||
package samples.test;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
class Access
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
ComThread.InitSTA();
|
||||
ActiveXComponent ax = new ActiveXComponent("DAO.PrivateDBEngine");
|
||||
// this only works for access files pre-access-2000
|
||||
Dispatch db = open(ax, ".\\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(result.toSafeArray());
|
||||
close(db);
|
||||
ComThread.Release();
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a database
|
||||
*/
|
||||
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
|
||||
*/
|
||||
public static void close(Dispatch openDB)
|
||||
{
|
||||
Dispatch.call(openDB, "Close");
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract the values from the recordset
|
||||
*/
|
||||
public static Variant getValues(Dispatch recset)
|
||||
{
|
||||
Dispatch.callSub(recset,"moveFirst");
|
||||
Variant vi = new Variant(4096);
|
||||
Variant v = Dispatch.call(recset,"GetRows", vi);
|
||||
return v;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public static String[] getColumns(Dispatch recset)
|
||||
{
|
||||
Dispatch flds = Dispatch.get(recset, "Fields").toDispatch();
|
||||
int n_flds = Dispatch.get(flds, "Count").toInt();
|
||||
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;
|
||||
}
|
||||
}
|
||||
40
samples/test/DispatchTest.java
Normal file
40
samples/test/DispatchTest.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package samples.test;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
class DispatchTest
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
ComThread.InitSTA();
|
||||
|
||||
ActiveXComponent xl = new ActiveXComponent("Excel.Application");
|
||||
Object xlo = xl.getObject();
|
||||
try {
|
||||
System.out.println("version="+xl.getProperty("Version"));
|
||||
System.out.println("version="+Dispatch.get(xlo, "Version"));
|
||||
Dispatch.put(xlo, "Visible", new Variant(true));
|
||||
Object workbooks = xl.getProperty("Workbooks").toDispatch();
|
||||
Object workbook = Dispatch.get(workbooks,"Add").toDispatch();
|
||||
Object sheet = Dispatch.get(workbook,"ActiveSheet").toDispatch();
|
||||
Object a1 = Dispatch.invoke(sheet, "Range", Dispatch.Get,
|
||||
new Object[] {"A1"},
|
||||
new int[1]).toDispatch();
|
||||
Object 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
115
samples/test/IETest.java
Normal file
115
samples/test/IETest.java
Normal file
@@ -0,0 +1,115 @@
|
||||
package samples.test;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
/*
|
||||
* This demonstrates the new event handling code in jacob 1.7
|
||||
* This example will open up IE and print out some of the events
|
||||
* it listens to as it havigates to web sites.
|
||||
* contributed by Niels Olof Bouvin mailto:n.o.bouvin@daimi.au.dk
|
||||
* and Henning Jae jehoej@daimi.au.dk
|
||||
*/
|
||||
|
||||
class IETest
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
ActiveXComponent ie = new ActiveXComponent("clsid:0002DF01-0000-0000-C000-000000000046");
|
||||
Object ieo = ie.getObject();
|
||||
try {
|
||||
Dispatch.put(ieo, "Visible", new Variant(true));
|
||||
Dispatch.put(ieo, "AddressBar", new Variant(true));
|
||||
System.out.println(Dispatch.get(ieo, "Path"));
|
||||
Dispatch.put(ieo, "StatusText", new Variant("My Status Text"));
|
||||
|
||||
IEEvents ieE = new IEEvents();
|
||||
DispatchEvents de = new DispatchEvents((Dispatch) ieo, ieE,"InternetExplorer.Application.1");
|
||||
Variant optional = new Variant();
|
||||
optional.noParam();
|
||||
|
||||
Dispatch.call(ieo, "Navigate", new Variant("http://www.danadler.com/jacob"));
|
||||
try { Thread.sleep(5000); } catch (Exception e) {}
|
||||
Dispatch.call(ieo, "Navigate", new Variant("http://groups.yahoo.com/group/jacob-project"));
|
||||
try { Thread.sleep(5000); } catch (Exception e) {}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
ie.invoke("Quit", new Variant[] {});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class IEEvents
|
||||
{
|
||||
public void BeforeNavigate2(Variant[] args) {
|
||||
System.out.println("BeforeNavigate2");
|
||||
}
|
||||
|
||||
public void CommandStateChanged(Variant[] args) {
|
||||
System.out.println("CommandStateChanged");
|
||||
}
|
||||
|
||||
public void DocumentComplete(Variant[] args) {
|
||||
System.out.println("DocumentComplete");
|
||||
}
|
||||
|
||||
public void DownloadBegin(Variant[] args) {
|
||||
System.out.println("DownloadBegin");
|
||||
}
|
||||
|
||||
public void DownloadComplete(Variant[] args) {
|
||||
System.out.println("DownloadComplete");
|
||||
}
|
||||
|
||||
public void NavigateComplete2(Variant[] args) {
|
||||
System.out.println("NavigateComplete2");
|
||||
}
|
||||
|
||||
public void NewWindow2(Variant[] args) {
|
||||
System.out.println("NewWindow2");
|
||||
}
|
||||
|
||||
public void OnFullScreen(Variant[] args) {
|
||||
System.out.println("OnFullScreen");
|
||||
}
|
||||
|
||||
public void OnMenuBar(Variant[] args) {
|
||||
System.out.println("OnMenuBar");
|
||||
}
|
||||
|
||||
public void OnQuit(Variant[] args) {
|
||||
System.out.println("OnQuit");
|
||||
}
|
||||
|
||||
public void OnStatusBar(Variant[] args) {
|
||||
System.out.println("OnStatusBar");
|
||||
}
|
||||
|
||||
public void OnTheaterMode(Variant[] args) {
|
||||
System.out.println("OnTheaterMode");
|
||||
}
|
||||
|
||||
public void OnToolBar(Variant[] args) {
|
||||
System.out.println("OnToolBar");
|
||||
}
|
||||
|
||||
public void OnVisible(Variant[] args) {
|
||||
System.out.println("OnVisible");
|
||||
}
|
||||
|
||||
public void ProgressChange(Variant[] args) {
|
||||
System.out.println("ProgressChange");
|
||||
}
|
||||
|
||||
public void PropertyChange(Variant[] args) {
|
||||
System.out.println("PropertyChange");
|
||||
}
|
||||
|
||||
public void StatusTextChange(Variant[] args) {
|
||||
System.out.println("StatusTextChange");
|
||||
}
|
||||
|
||||
public void TitleChange(Variant[] args) {
|
||||
System.out.println("TitleChange");
|
||||
}
|
||||
}
|
||||
37
samples/test/MathProj/Math.cls
Normal file
37
samples/test/MathProj/Math.cls
Normal file
@@ -0,0 +1,37 @@
|
||||
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
|
||||
|
||||
BIN
samples/test/MathProj/MathTest.dll
Normal file
BIN
samples/test/MathProj/MathTest.dll
Normal file
Binary file not shown.
BIN
samples/test/MathProj/MathTest.exp
Normal file
BIN
samples/test/MathProj/MathTest.exp
Normal file
Binary file not shown.
BIN
samples/test/MathProj/MathTest.lib
Normal file
BIN
samples/test/MathProj/MathTest.lib
Normal file
Binary file not shown.
35
samples/test/MathProj/MathTest.vbp
Normal file
35
samples/test/MathProj/MathTest.vbp
Normal file
@@ -0,0 +1,35 @@
|
||||
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
|
||||
1
samples/test/MathProj/MathTest.vbw
Normal file
1
samples/test/MathProj/MathTest.vbw
Normal file
@@ -0,0 +1 @@
|
||||
Math = 75, 13, 656, 554,
|
||||
1
samples/test/MathProj/README
Normal file
1
samples/test/MathProj/README
Normal file
@@ -0,0 +1 @@
|
||||
A Simple VB COM DLL that exposes two methods and raises events.
|
||||
69
samples/test/Outlook.java
Normal file
69
samples/test/Outlook.java
Normal file
@@ -0,0 +1,69 @@
|
||||
package samples.test;
|
||||
|
||||
/**
|
||||
* JACOB Outlook sample contributed by
|
||||
* Christopher Brind <christopher.brind@morse.com>
|
||||
*/
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
|
||||
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, Object o) {
|
||||
|
||||
if (o == null) return;
|
||||
Object oFolders = Dispatch.get(o, "Folders").toDispatch();
|
||||
// System.out.println("oFolders=" + oFolders);
|
||||
if (oFolders == null) return;
|
||||
|
||||
Object 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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
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"));
|
||||
|
||||
Object oOutlook = axOutlook.getObject();
|
||||
System.out.println("version="+Dispatch.get(oOutlook, "Version"));
|
||||
|
||||
Object oNameSpace = axOutlook.getProperty("Session").toDispatch();
|
||||
System.out.println("oNameSpace=" + oNameSpace);
|
||||
|
||||
recurseFolders(0, oNameSpace);
|
||||
|
||||
} finally {
|
||||
axOutlook.invoke("Quit", new Variant[] {});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
2
samples/test/ScriptTest.bat
Normal file
2
samples/test/ScriptTest.bat
Normal file
@@ -0,0 +1,2 @@
|
||||
java ScriptTest "1+2"
|
||||
java ScriptTest "()1+2"
|
||||
57
samples/test/ScriptTest.java
Normal file
57
samples/test/ScriptTest.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package samples.test;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
/**
|
||||
* In this case the component is created and used in the same thread
|
||||
* and it's an Apartment Threaded component, so we call InitSTA.
|
||||
*/
|
||||
class ScriptTest
|
||||
{
|
||||
public static void main(String args[]) throws Exception
|
||||
{
|
||||
ComThread.InitSTA(true);
|
||||
DispatchEvents de = null;
|
||||
Dispatch sControl = null;
|
||||
|
||||
try {
|
||||
String lang = "VBScript";
|
||||
ActiveXComponent sC = new ActiveXComponent("ScriptControl");
|
||||
sControl = (Dispatch)sC.getObject();
|
||||
Dispatch.put(sControl, "Language", lang);
|
||||
errEvents te = new errEvents();
|
||||
de = new DispatchEvents(sControl, te);
|
||||
Variant result = Dispatch.call(sControl, "Eval", args[0]);
|
||||
// call it twice to see the objects reused
|
||||
result = Dispatch.call(sControl, "Eval", args[0]);
|
||||
// call it 3 times to see the objects reused
|
||||
result = Dispatch.call(sControl, "Eval", args[0]);
|
||||
System.out.println("eval("+args[0]+") = "+ result);
|
||||
} catch (ComException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
finally
|
||||
{
|
||||
Integer I = null;
|
||||
for(int i=1;i<1000000;i++)
|
||||
{
|
||||
I = new Integer(i);
|
||||
}
|
||||
System.out.println(I);
|
||||
ComThread.Release();
|
||||
ComThread.quitMainSTA();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class errEvents {
|
||||
public void Error(Variant[] args)
|
||||
{
|
||||
System.out.println("java callback for error!");
|
||||
}
|
||||
public void Timeout(Variant[] args)
|
||||
{
|
||||
System.out.println("java callback for error!");
|
||||
}
|
||||
}
|
||||
98
samples/test/ScriptTest2.java
Normal file
98
samples/test/ScriptTest2.java
Normal file
@@ -0,0 +1,98 @@
|
||||
package samples.test;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
/**
|
||||
* This example demonstrates how to make calls between
|
||||
* two different STA's.
|
||||
* First, to create an STA, you need to extend the STA class
|
||||
* and override its OnInit() method. This method will be called
|
||||
* in the STA's thread so you can use it to create your COM
|
||||
* components that will run in that STA.
|
||||
* If you then try to call methods on those components from other
|
||||
* threads (STA or MTA) - this will fail.
|
||||
* You cannot create a component in an STA and call its methods
|
||||
* from another thread.
|
||||
* You can use the DispatchProxy to get a proxy to any Dispatch
|
||||
* that lives in another STA. This object has to be created in the
|
||||
* STA that houses the Dispatch (in this case it's created in the
|
||||
* OnInit method). Then, another thread can call the toDispatch()
|
||||
* method of DispatchProxy to get a local proxy. At most ONE (!)
|
||||
* 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.
|
||||
*/
|
||||
class ScriptTest2 extends STA
|
||||
{
|
||||
public static ActiveXComponent sC;
|
||||
public static DispatchEvents de = null;
|
||||
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);
|
||||
errEvents te = new errEvents();
|
||||
de = new DispatchEvents(sControl, te);
|
||||
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
|
||||
{
|
||||
Integer I = null;
|
||||
for(int i=1;i<1000000;i++)
|
||||
{
|
||||
I = new Integer(i);
|
||||
}
|
||||
System.out.println(I);
|
||||
ComThread.Release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
68
samples/test/ScriptTest3.java
Normal file
68
samples/test/ScriptTest3.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package samples.test;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
/**
|
||||
* Here we create the ScriptControl component in a separate MTA thread
|
||||
* and then call the Eval method from the main thread. The main thread
|
||||
* must also be an MTA thread. If you try to create it as an STA
|
||||
* then you will not be able to make calls into a component running
|
||||
* in another thread.
|
||||
*/
|
||||
class ScriptTest3 extends Thread
|
||||
{
|
||||
public static ActiveXComponent sC;
|
||||
public static DispatchEvents de = null;
|
||||
public static Dispatch sControl = null;
|
||||
public static boolean quit = false;
|
||||
|
||||
public void run()
|
||||
{
|
||||
try
|
||||
{
|
||||
ComThread.InitMTA();
|
||||
System.out.println("OnInit");
|
||||
String lang = "VBScript";
|
||||
sC = new ActiveXComponent("ScriptControl");
|
||||
sControl = (Dispatch)sC.getObject();
|
||||
Dispatch.put(sControl, "Language", lang);
|
||||
errEvents te = new errEvents();
|
||||
de = new DispatchEvents(sControl, te);
|
||||
System.out.println("sControl="+sControl);
|
||||
while (!quit) sleep(100);
|
||||
ComThread.Release();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.out.println("worker thread exits");
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws Exception
|
||||
{
|
||||
try {
|
||||
ComThread.InitMTA();
|
||||
ScriptTest3 script = new ScriptTest3();
|
||||
script.start();
|
||||
Thread.sleep(1000);
|
||||
|
||||
Variant result = Dispatch.call(sControl, "Eval", args[0]);
|
||||
System.out.println("eval("+args[0]+") = "+ result);
|
||||
System.out.println("setting quit");
|
||||
script.quit = true;
|
||||
} catch (ComException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.out.println("main done");
|
||||
ComThread.Release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
32
samples/test/atl/MultiFace.java
Normal file
32
samples/test/atl/MultiFace.java
Normal file
@@ -0,0 +1,32 @@
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
class MultiFace
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
67
samples/test/atl/MultiFace/Face.cpp
Normal file
67
samples/test/atl/MultiFace/Face.cpp
Normal file
@@ -0,0 +1,67 @@
|
||||
// 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;
|
||||
}
|
||||
63
samples/test/atl/MultiFace/Face.h
Normal file
63
samples/test/atl/MultiFace/Face.h
Normal file
@@ -0,0 +1,63 @@
|
||||
// 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_)
|
||||
23
samples/test/atl/MultiFace/Face.rgs
Normal file
23
samples/test/atl/MultiFace/Face.rgs
Normal file
@@ -0,0 +1,23 @@
|
||||
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'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
samples/test/atl/MultiFace/MultiFace.aps
Normal file
BIN
samples/test/atl/MultiFace/MultiFace.aps
Normal file
Binary file not shown.
72
samples/test/atl/MultiFace/MultiFace.cpp
Normal file
72
samples/test/atl/MultiFace/MultiFace.cpp
Normal file
@@ -0,0 +1,72 @@
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
||||
9
samples/test/atl/MultiFace/MultiFace.def
Normal file
9
samples/test/atl/MultiFace/MultiFace.def
Normal file
@@ -0,0 +1,9 @@
|
||||
; MultiFace.def : Declares the module parameters.
|
||||
|
||||
LIBRARY "MultiFace.DLL"
|
||||
|
||||
EXPORTS
|
||||
DllCanUnloadNow @1 PRIVATE
|
||||
DllGetClassObject @2 PRIVATE
|
||||
DllRegisterServer @3 PRIVATE
|
||||
DllUnregisterServer @4 PRIVATE
|
||||
323
samples/test/atl/MultiFace/MultiFace.dsp
Normal file
323
samples/test/atl/MultiFace/MultiFace.dsp
Normal file
@@ -0,0 +1,323 @@
|
||||
# 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
|
||||
29
samples/test/atl/MultiFace/MultiFace.dsw
Normal file
29
samples/test/atl/MultiFace/MultiFace.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
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>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
571
samples/test/atl/MultiFace/MultiFace.h
Normal file
571
samples/test/atl/MultiFace/MultiFace.h
Normal file
@@ -0,0 +1,571 @@
|
||||
/* 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
|
||||
70
samples/test/atl/MultiFace/MultiFace.idl
Normal file
70
samples/test/atl/MultiFace/MultiFace.idl
Normal file
@@ -0,0 +1,70 @@
|
||||
// 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;
|
||||
};
|
||||
};
|
||||
BIN
samples/test/atl/MultiFace/MultiFace.ncb
Normal file
BIN
samples/test/atl/MultiFace/MultiFace.ncb
Normal file
Binary file not shown.
BIN
samples/test/atl/MultiFace/MultiFace.opt
Normal file
BIN
samples/test/atl/MultiFace/MultiFace.opt
Normal file
Binary file not shown.
48
samples/test/atl/MultiFace/MultiFace.plg
Normal file
48
samples/test/atl/MultiFace/MultiFace.plg
Normal file
@@ -0,0 +1,48 @@
|
||||
<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>
|
||||
125
samples/test/atl/MultiFace/MultiFace.rc
Normal file
125
samples/test/atl/MultiFace/MultiFace.rc
Normal file
@@ -0,0 +1,125 @@
|
||||
//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
|
||||
|
||||
BIN
samples/test/atl/MultiFace/MultiFace.tlb
Normal file
BIN
samples/test/atl/MultiFace/MultiFace.tlb
Normal file
Binary file not shown.
56
samples/test/atl/MultiFace/MultiFace_i.c
Normal file
56
samples/test/atl/MultiFace/MultiFace_i.c
Normal file
@@ -0,0 +1,56 @@
|
||||
/* 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
|
||||
|
||||
570
samples/test/atl/MultiFace/MultiFace_p.c
Normal file
570
samples/test/atl/MultiFace/MultiFace_p.c
Normal file
@@ -0,0 +1,570 @@
|
||||
/* 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 */
|
||||
};
|
||||
11
samples/test/atl/MultiFace/MultiFaceps.def
Normal file
11
samples/test/atl/MultiFace/MultiFaceps.def
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
LIBRARY "MultiFacePS"
|
||||
|
||||
DESCRIPTION 'Proxy/Stub DLL'
|
||||
|
||||
EXPORTS
|
||||
DllGetClassObject @1 PRIVATE
|
||||
DllCanUnloadNow @2 PRIVATE
|
||||
GetProxyDllInfo @3 PRIVATE
|
||||
DllRegisterServer @4 PRIVATE
|
||||
DllUnregisterServer @5 PRIVATE
|
||||
16
samples/test/atl/MultiFace/MultiFaceps.mk
Normal file
16
samples/test/atl/MultiFace/MultiFaceps.mk
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
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
|
||||
12
samples/test/atl/MultiFace/StdAfx.cpp
Normal file
12
samples/test/atl/MultiFace/StdAfx.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
// 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>
|
||||
27
samples/test/atl/MultiFace/StdAfx.h
Normal file
27
samples/test/atl/MultiFace/StdAfx.h
Normal file
@@ -0,0 +1,27 @@
|
||||
// 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)
|
||||
38
samples/test/atl/MultiFace/dlldata.c
Normal file
38
samples/test/atl/MultiFace/dlldata.c
Normal file
@@ -0,0 +1,38 @@
|
||||
/*********************************************************
|
||||
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 */
|
||||
18
samples/test/atl/MultiFace/resource.h
Normal file
18
samples/test/atl/MultiFace/resource.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//{{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
|
||||
14
samples/test/atl/readme.txt
Normal file
14
samples/test/atl/readme.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
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.
|
||||
BIN
samples/test/foo.foo
Normal file
BIN
samples/test/foo.foo
Normal file
Binary file not shown.
BIN
samples/test/foo.ser
Normal file
BIN
samples/test/foo.ser
Normal file
Binary file not shown.
BIN
samples/test/jacobtest.xls
Normal file
BIN
samples/test/jacobtest.xls
Normal file
Binary file not shown.
38
samples/test/math.java
Normal file
38
samples/test/math.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package samples.test;
|
||||
|
||||
import com.jacob.com.*;
|
||||
|
||||
/*
|
||||
* This example uses the MathTest sample VB COM DLL under
|
||||
* the MathProj directory
|
||||
*/
|
||||
class math
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
System.runFinalizersOnExit(true);
|
||||
Dispatch test = new Dispatch("MathTest.Math");
|
||||
testEvents te = new testEvents();
|
||||
DispatchEvents de = new DispatchEvents(test, te);
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
class testEvents {
|
||||
public void DoneAdd(Variant[] args)
|
||||
{
|
||||
System.out.println("DoneAdd called in java");
|
||||
}
|
||||
public void DoneMult(Variant[] args)
|
||||
{
|
||||
System.out.println("DoneMult called in java");
|
||||
}
|
||||
}
|
||||
41
samples/test/sa_dispatch.java
Normal file
41
samples/test/sa_dispatch.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package samples.test;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
class sa_dispatch
|
||||
{
|
||||
public static void main(String args[])
|
||||
{
|
||||
System.runFinalizersOnExit(true);
|
||||
|
||||
try {
|
||||
String lang = "VBScript";
|
||||
ActiveXComponent sC = new ActiveXComponent("ScriptControl");
|
||||
Dispatch sControl = (Dispatch)sC.getObject();
|
||||
Dispatch.put(sControl, "Language", lang);
|
||||
|
||||
Variant result = Dispatch.call(sControl, "Eval", args[0]);
|
||||
System.out.println("eval("+args[0]+") = "+ result);
|
||||
|
||||
// wrap the script control in a variant
|
||||
Variant v = new Variant(sControl);
|
||||
|
||||
// create a safe array of type dispatch
|
||||
SafeArray sa = new SafeArray(Variant.VariantDispatch, 1);
|
||||
|
||||
// put the variant in the array
|
||||
sa.setVariant(0, v);
|
||||
|
||||
// take it back out
|
||||
Variant v2 = sa.getVariant(0);
|
||||
Dispatch d = v2.toDispatch();
|
||||
|
||||
// make sure you can call eval on it
|
||||
result = Dispatch.call(d, "Eval", args[0]);
|
||||
System.out.println("eval("+args[0]+") = "+ result);
|
||||
} catch (ComException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
58
samples/test/sa_test.java
Normal file
58
samples/test/sa_test.java
Normal file
@@ -0,0 +1,58 @@
|
||||
package samples.test;
|
||||
|
||||
import com.jacob.com.*;
|
||||
|
||||
class sa_test
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
System.runFinalizersOnExit(true);
|
||||
SafeArray sa = new SafeArray(Variant.VariantVariant, 3);
|
||||
|
||||
sa.fromShortArray(new short[] {1,2,3});
|
||||
System.out.println("sa short="+sa);
|
||||
int[] ai = sa.toIntArray();
|
||||
for(int i=0;i<ai.length;i++) {
|
||||
System.out.println("toInt="+ai[i]);
|
||||
}
|
||||
double[] ad = sa.toDoubleArray();
|
||||
for(int i=0;i<ad.length;i++) {
|
||||
System.out.println("toDouble="+ad[i]);
|
||||
}
|
||||
sa.fromIntArray(new int[] {100000,200000,300000});
|
||||
System.out.println("sa int="+sa);
|
||||
ai = sa.toIntArray();
|
||||
for(int i=0;i<ai.length;i++) {
|
||||
System.out.println("toInt="+ai[i]);
|
||||
}
|
||||
ad = sa.toDoubleArray();
|
||||
for(int i=0;i<ad.length;i++) {
|
||||
System.out.println("toDouble="+ad[i]);
|
||||
}
|
||||
Variant av[] = sa.toVariantArray();
|
||||
for(int i=0;i<av.length;i++) {
|
||||
System.out.println("toVariant="+av[i]);
|
||||
}
|
||||
sa.fromDoubleArray(new double[] {1.5,2.5,3.5});
|
||||
System.out.println("sa double="+sa);
|
||||
sa.fromFloatArray(new float[] {1.5F,2.5F,3.5F});
|
||||
System.out.println("sa float="+sa);
|
||||
sa.fromBooleanArray(new boolean[] {true, false, true, false});
|
||||
System.out.println("sa bool="+sa);
|
||||
av = sa.toVariantArray();
|
||||
for(int i=0;i<av.length;i++) {
|
||||
System.out.println("toVariant="+av[i]);
|
||||
}
|
||||
sa.fromCharArray(new char[] {'a','b','c','d'});
|
||||
System.out.println("sa char="+sa);
|
||||
sa.fromStringArray(new String[] {"hello", "from", "java", "com"});
|
||||
System.out.println("sa string="+sa);
|
||||
av = sa.toVariantArray();
|
||||
for(int i=0;i<av.length;i++) {
|
||||
System.out.println("toVariant="+av[i]);
|
||||
}
|
||||
sa.fromVariantArray(new Variant[] {
|
||||
new Variant(1), new Variant(2.3), new Variant("hi")});
|
||||
System.out.println("sa variant="+sa);
|
||||
}
|
||||
}
|
||||
61
samples/test/safearray.java
Normal file
61
samples/test/safearray.java
Normal file
@@ -0,0 +1,61 @@
|
||||
package samples.test;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
public class safearray
|
||||
{
|
||||
public static void main(java.lang.String[] args)
|
||||
{
|
||||
System.runFinalizersOnExit(true);
|
||||
|
||||
ActiveXComponent xl = new ActiveXComponent("Excel.Application");
|
||||
try {
|
||||
Object cell;
|
||||
Object cellstart;
|
||||
Object cellstop;
|
||||
SafeArray sAProdText;
|
||||
Object workbooks = xl.getProperty("Workbooks").toDispatch();
|
||||
System.out.println("have workbooks");
|
||||
Object workbook = Dispatch.call(workbooks, "Open", "d:\\jacob_15\\samples\\test\\jacobtest.xls").toDispatch();
|
||||
System.out.println("Opened File - jacobtest.xls\n");
|
||||
Object sheet = Dispatch.get(workbook,"ActiveSheet").toDispatch();
|
||||
cell = Dispatch.invoke(sheet,"Range",Dispatch.Get,new Object[] {"A1:D1000"},new int[1]).toDispatch();
|
||||
System.out.println("have cell:"+cell);
|
||||
sAProdText = Dispatch.get(cell,"Value").toSafeArray();
|
||||
System.out.println("sa: dim="+sAProdText.getNumDim());
|
||||
System.out.println("sa: start row="+sAProdText.getLBound(1));
|
||||
System.out.println("sa: start col="+sAProdText.getLBound(2));
|
||||
System.out.println("sa: end row="+sAProdText.getUBound(1));
|
||||
System.out.println("sa: end col="+sAProdText.getUBound(2));
|
||||
int i;
|
||||
int lineNumber=1;
|
||||
boolean stringFound = true;
|
||||
int n = 0;
|
||||
for(lineNumber=1; lineNumber < 1000; lineNumber++)
|
||||
{
|
||||
for (i = 1 ; i < 4 ; i++ ) {
|
||||
System.out.println((n++) + " " + lineNumber+" "+i+" " +sAProdText.getString(lineNumber,i));
|
||||
/*
|
||||
if (sAProdText.getString(lineNumber,i).compareTo("aaaa") != 0 ) {
|
||||
System.out.println("Invalid String in line " + lineNumber + " Cell " + i + " Value = " + sAProdText.getString(lineNumber,i));
|
||||
stringFound = false;
|
||||
}
|
||||
}
|
||||
if (stringFound) {
|
||||
System.out.println("Valid Strings in line " + lineNumber);
|
||||
lineNumber++;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
Dispatch.call(workbook, "Close");
|
||||
System.out.println("Closed File\n");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
xl.invoke("Quit", new Variant[] {});
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
samples/test/sample2.mdb
Normal file
BIN
samples/test/sample2.mdb
Normal file
Binary file not shown.
18
samples/test/speed.java
Normal file
18
samples/test/speed.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package samples.test;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
class speed
|
||||
{
|
||||
public static void main(String args[])
|
||||
{
|
||||
String lang = "VBScript";
|
||||
ActiveXComponent sC = new ActiveXComponent("ScriptControl");
|
||||
Object sControl = sC.getObject();
|
||||
Dispatch.put(sControl, "Language", lang);
|
||||
for(int i=0;i<10000;i++) {
|
||||
Dispatch.call(sControl, "Eval", "1+1");
|
||||
}
|
||||
}
|
||||
}
|
||||
276
samples/test/test.java
Normal file
276
samples/test/test.java
Normal file
@@ -0,0 +1,276 @@
|
||||
package samples.test;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
class test
|
||||
{
|
||||
|
||||
public static void printArray(boolean a[])
|
||||
{
|
||||
System.out.print("[");
|
||||
for(int i=0;i<a.length;i++) {
|
||||
System.out.print(" " + a[i] + " ");
|
||||
}
|
||||
System.out.println("]");
|
||||
}
|
||||
|
||||
public static void printArray(int a[])
|
||||
{
|
||||
System.out.print("[");
|
||||
for(int i=0;i<a.length;i++) {
|
||||
System.out.print(" " + a[i] + " ");
|
||||
}
|
||||
System.out.println("]");
|
||||
}
|
||||
|
||||
public static void printArray(short a[])
|
||||
{
|
||||
System.out.print("[");
|
||||
for(int i=0;i<a.length;i++) {
|
||||
System.out.print(" " + a[i] + " ");
|
||||
}
|
||||
System.out.println("]");
|
||||
}
|
||||
|
||||
public static void printArray(byte a[])
|
||||
{
|
||||
System.out.print("[");
|
||||
for(int i=0;i<a.length;i++) {
|
||||
System.out.print(" " + a[i] + " ");
|
||||
}
|
||||
System.out.println("]");
|
||||
}
|
||||
|
||||
public static void printArray(double a[])
|
||||
{
|
||||
System.out.print("[");
|
||||
for(int i=0;i<a.length;i++) {
|
||||
System.out.print(" " + a[i] + " ");
|
||||
}
|
||||
System.out.println("]");
|
||||
}
|
||||
|
||||
public static void printArray(float a[])
|
||||
{
|
||||
System.out.print("[");
|
||||
for(int i=0;i<a.length;i++) {
|
||||
System.out.print(" " + a[i] + " ");
|
||||
}
|
||||
System.out.println("]");
|
||||
}
|
||||
|
||||
public static void printArray(String a[])
|
||||
{
|
||||
System.out.print("[");
|
||||
for(int i=0;i<a.length;i++) {
|
||||
System.out.print(" " + a[i] + " ");
|
||||
}
|
||||
System.out.println("]");
|
||||
}
|
||||
|
||||
public static void printArray(Variant a[])
|
||||
{
|
||||
System.out.print("[");
|
||||
for(int i=0;i<a.length;i++) {
|
||||
System.out.print(" " + a[i] + " ");
|
||||
}
|
||||
System.out.println("]");
|
||||
}
|
||||
|
||||
public static void printArray(char a[])
|
||||
{
|
||||
System.out.print("[");
|
||||
for(int i=0;i<a.length;i++) {
|
||||
System.out.print(" " + a[i] + " ");
|
||||
}
|
||||
System.out.println("]");
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// int
|
||||
System.out.println("Int");
|
||||
SafeArray ia = new SafeArray(Variant.VariantInt,4);
|
||||
System.out.println("elem size:"+ia.getElemSize());
|
||||
int iack[] = new int[] {100000,200000,300000,400000};
|
||||
printArray(iack);
|
||||
ia.fromIntArray(iack);
|
||||
iack = ia.toIntArray();
|
||||
printArray(iack);
|
||||
|
||||
int i4[] = new int[4];
|
||||
ia.getInts(0, 4, i4, 0);
|
||||
printArray(i4);
|
||||
|
||||
SafeArray ia2 = new SafeArray(Variant.VariantInt,4);
|
||||
ia2.setInts(0, 4, i4, 0);
|
||||
iack = ia2.toIntArray();
|
||||
printArray(iack);
|
||||
|
||||
// double
|
||||
System.out.println("Double");
|
||||
SafeArray da = new SafeArray(Variant.VariantDouble,4);
|
||||
System.out.println("elem size:"+da.getElemSize());
|
||||
double dack[] = new double[] {123.456,456.123,1234567.89,12.3456789};
|
||||
printArray(dack);
|
||||
da.fromDoubleArray(dack);
|
||||
dack = da.toDoubleArray();
|
||||
printArray(dack);
|
||||
|
||||
double d4[] = new double[4];
|
||||
da.getDoubles(0, 4, d4, 0);
|
||||
printArray(d4);
|
||||
|
||||
SafeArray da2 = new SafeArray(Variant.VariantDouble,4);
|
||||
da2.setDoubles(0, 4, d4, 0);
|
||||
dack = da2.toDoubleArray();
|
||||
printArray(dack);
|
||||
|
||||
// float
|
||||
System.out.println("Float");
|
||||
SafeArray fa = new SafeArray(Variant.VariantFloat,4);
|
||||
System.out.println("elem size:"+fa.getElemSize());
|
||||
float fack[] = new float[] {123.456F,456.123F,1234567.89F,12.3456789F};
|
||||
printArray(fack);
|
||||
fa.fromFloatArray(fack);
|
||||
fack = fa.toFloatArray();
|
||||
printArray(fack);
|
||||
|
||||
float f4[] = new float[4];
|
||||
fa.getFloats(0, 4, f4, 0);
|
||||
printArray(f4);
|
||||
|
||||
SafeArray fa2 = new SafeArray(Variant.VariantFloat,4);
|
||||
fa2.setFloats(0, 4, f4, 0);
|
||||
fack = fa2.toFloatArray();
|
||||
printArray(fack);
|
||||
|
||||
// boolean
|
||||
System.out.println("Boolean");
|
||||
SafeArray ba = new SafeArray(Variant.VariantBoolean,4);
|
||||
System.out.println("elem size:"+ba.getElemSize());
|
||||
boolean back[] = new boolean[] {true, false, true, false};
|
||||
printArray(back);
|
||||
ba.fromBooleanArray(back);
|
||||
back = ba.toBooleanArray();
|
||||
printArray(back);
|
||||
|
||||
boolean b4[] = new boolean[4];
|
||||
ba.getBooleans(0, 4, b4, 0);
|
||||
printArray(b4);
|
||||
|
||||
SafeArray ba2 = new SafeArray(Variant.VariantBoolean,4);
|
||||
ba2.setBooleans(0, 4, b4, 0);
|
||||
back = ba2.toBooleanArray();
|
||||
printArray(back);
|
||||
|
||||
// char
|
||||
System.out.println("Char");
|
||||
SafeArray ca = new SafeArray(Variant.VariantShort,4);
|
||||
System.out.println("elem size:"+ca.getElemSize());
|
||||
char cack[] = new char[] {'a','b','c','d'};
|
||||
printArray(cack);
|
||||
ca.fromCharArray(cack);
|
||||
cack = ca.toCharArray();
|
||||
printArray(cack);
|
||||
|
||||
char c4[] = new char[4];
|
||||
ca.getChars(0, 4, c4, 0);
|
||||
printArray(c4);
|
||||
|
||||
SafeArray ca2 = new SafeArray(Variant.VariantShort,4);
|
||||
ca2.setChars(0, 4, c4, 0);
|
||||
cack = ca2.toCharArray();
|
||||
printArray(cack);
|
||||
|
||||
// short
|
||||
System.out.println("Short");
|
||||
SafeArray sha = new SafeArray(Variant.VariantShort,4);
|
||||
System.out.println("elem size:"+sha.getElemSize());
|
||||
short shack[] = new short[] {1000,2000,3000,4000};
|
||||
printArray(shack);
|
||||
sha.fromShortArray(shack);
|
||||
shack = sha.toShortArray();
|
||||
printArray(shack);
|
||||
|
||||
short sh4[] = new short[4];
|
||||
sha.getShorts(0, 4, sh4, 0);
|
||||
printArray(sh4);
|
||||
|
||||
SafeArray sha2 = new SafeArray(Variant.VariantShort,4);
|
||||
sha2.setShorts(0, 4, sh4, 0);
|
||||
shack = sha2.toShortArray();
|
||||
printArray(shack);
|
||||
|
||||
// string
|
||||
System.out.println("String");
|
||||
SafeArray sa = new SafeArray(Variant.VariantString,4);
|
||||
System.out.println("elem size:"+sa.getElemSize());
|
||||
String sack[] = new String[] {"aa","bb","cc","dd"};
|
||||
printArray(sack);
|
||||
sa.fromStringArray(sack);
|
||||
sack = sa.toStringArray();
|
||||
printArray(sack);
|
||||
|
||||
String s4[] = new String[4];
|
||||
sa.getStrings(0, 4, s4, 0);
|
||||
printArray(s4);
|
||||
|
||||
SafeArray sa2 = new SafeArray(Variant.VariantString,4);
|
||||
sa2.setStrings(0, 4, s4, 0);
|
||||
sack = sa2.toStringArray();
|
||||
printArray(sack);
|
||||
|
||||
// variant
|
||||
System.out.println("Variant");
|
||||
SafeArray va = new SafeArray(Variant.VariantVariant,4);
|
||||
System.out.println("elem size:"+va.getElemSize());
|
||||
Variant vack[] = new Variant[]
|
||||
{
|
||||
new Variant(1),
|
||||
new Variant(2.3),
|
||||
new Variant(true),
|
||||
new Variant("four"),
|
||||
};
|
||||
printArray(vack);
|
||||
va.fromVariantArray(vack);
|
||||
vack = va.toVariantArray();
|
||||
printArray(vack);
|
||||
|
||||
Variant v4[] = new Variant[4];
|
||||
va.getVariants(0, 4, v4, 0);
|
||||
printArray(v4);
|
||||
|
||||
SafeArray va2 = new SafeArray(Variant.VariantVariant,4);
|
||||
va2.setVariants(0, 4, v4, 0);
|
||||
vack = va2.toVariantArray();
|
||||
printArray(vack);
|
||||
|
||||
// byte
|
||||
System.out.println("Byte");
|
||||
SafeArray bba = new SafeArray(Variant.VariantByte,4);
|
||||
System.out.println("elem size:"+bba.getElemSize());
|
||||
byte bback[] = new byte[] {0x1,0x2,0x3,0x4};
|
||||
printArray(bback);
|
||||
bba.fromByteArray(bback);
|
||||
bback = bba.toByteArray();
|
||||
printArray(bback);
|
||||
|
||||
byte bb4[] = new byte[4];
|
||||
bba.getBytes(0, 4, bb4, 0);
|
||||
printArray(bb4);
|
||||
|
||||
SafeArray bba2 = new SafeArray(Variant.VariantByte,4);
|
||||
bba2.setBytes(0, 4, bb4, 0);
|
||||
bback = bba2.toByteArray();
|
||||
printArray(bback);
|
||||
|
||||
try {
|
||||
// this should throw ComFailException
|
||||
bba2.fromCharArray(new char[] {'a'});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
50
samples/test/varSerTest.java
Normal file
50
samples/test/varSerTest.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package samples.test;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
import java.io.*;
|
||||
|
||||
class varSerTest
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
Variant vs1 = new Variant("hi");
|
||||
Variant vs2 = new Variant(123.456);
|
||||
|
||||
FileOutputStream fos = new FileOutputStream("foo.foo");
|
||||
vs1.Save(fos);
|
||||
vs2.Save(fos);
|
||||
fos.close();
|
||||
|
||||
Variant vl1 = new Variant();
|
||||
Variant vl2 = new Variant();
|
||||
FileInputStream fis = new FileInputStream("foo.foo");
|
||||
vl1.Load(fis);
|
||||
vl2.Load(fis);
|
||||
System.out.println(vl1);
|
||||
System.out.println(vl2);
|
||||
|
||||
// same thing with serialization
|
||||
|
||||
fos = new FileOutputStream("foo.ser");
|
||||
ObjectOutputStream oos = new ObjectOutputStream(fos);
|
||||
oos.writeObject(vs1);
|
||||
oos.writeObject(vs2);
|
||||
oos.close();
|
||||
fos.close();
|
||||
|
||||
|
||||
fis = new FileInputStream("foo.ser");
|
||||
ObjectInputStream ois = new ObjectInputStream(fis);
|
||||
|
||||
Variant vss1, vss2;
|
||||
|
||||
vss1 = (Variant)ois.readObject();
|
||||
vss2 = (Variant)ois.readObject();
|
||||
ois.close();
|
||||
fis.close();
|
||||
|
||||
System.out.println(vss1);
|
||||
System.out.println(vss2);
|
||||
}
|
||||
}
|
||||
23
samples/test/variant_test.java
Normal file
23
samples/test/variant_test.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package samples.test;
|
||||
import com.jacob.com.*;
|
||||
|
||||
class variant_test
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
System.runFinalizersOnExit(true);
|
||||
Variant v = new Variant();
|
||||
v.putInt(10);
|
||||
System.out.println("got="+v.toInt());
|
||||
v.putInt(10);
|
||||
System.out.println("got="+v.toDouble());
|
||||
v.putString("1234.567");
|
||||
System.out.println("got="+v.toString());
|
||||
v.putBoolean(true);
|
||||
System.out.println("got="+v.toBoolean());
|
||||
v.putBoolean(false);
|
||||
System.out.println("got="+v.toBoolean());
|
||||
v.putCurrency(123456789123456789L);
|
||||
System.out.println("got="+v.toCurrency());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user