Article ID: 196894
Article Last Modified on 8/25/2005
[
uuid(D544BFC0-BC81-11d0-A982-00AA00C0177B),
helpstring("javaLib Type Library 1.2a"),
version(1.2)
]
library javaLib
{
importlib("stdole32.tlb");
[
object,
dual,
uuid(D544BFC1-BC81-11d0-A982-00AA00C0177B),
helpstring("Itest Interface")
]
interface Itest : IDispatch
{
[id(1), helpstring("method TestLong")] HRESULT TestLong([in]
long parm1, [out,retval] long *ret);
[id(2), helpstring("method TestString")] HRESULT
TestString([in] BSTR str, [out,retval] BSTR *ret);
}
[
uuid(D544BFC2-BC81-11d0-A982-00AA00C0177B),
helpstring("test Object")
]
coclass test
{
[default] interface Itest;
};
};
midl javaLib.idl
throw new com.ms.com.ComFailException(0x80004001); // E_NOTIMPL
/** @com.register(clsid=D544BFC2-BC81-11D0-A982-00AA00C0177B,
typelib=D544BFC0-BC81-11D0-A982-00AA00C0177B, version="1.2",
description="test Object")*/
public class test implements
IUnknown,com.ms.com.NoAutoScripting,javalib.ItestDefault
{
public int TestLong(int parm1) {
// throw new com.ms.com.ComFailException(0x80004001); // E_NOTIMPL
return parm1;
}
public String TestString(String str) {
//throw new com.ms.com.ComFailException(0x80004001);
return str;// E_NOTIMPL
}
private void button1_click(Object source, Event e)
{
// Javacom is the package name, and test is the co-class name.
javacom.Itest t = (javacom.Itest) new javacom.test();
int i = t.TestLong(100);
String str = t.TestString("Hello");
System.out.println(i);
System.out.println(str);
}
Additional query words: dual
Keywords: kbhowto kbinetdev kbfaq kbjavafaq KB196894