Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Jvm is always crashed when I get the property of a activex using swt.
Jvm is always crashed when I get the property of a activex using swt. [message #448935] Sat, 15 January 2005 08:37 Go to next message
Eclipse UserFriend
Originally posted by: agile.java.gmail.com

I'm working on activex supported by swt,and when I run the test application
jvm is always crashed.:(
Who can help me,tks.

The idl which I used is:
HRESULT
Match_MntStr( BSTR pStr1, BSTR pStr2,
double *pVal);


Here is my application:

public class ActivexTest {
public static void main(String[] args){
Display display = new Display();
Shell shell = new Shell(display);
OleFrame frame = new OleFrame(shell, SWT.NONE);
OleControlSite controlSite =
new OleControlSite(frame, SWT.NONE, "DFZJDev.ObjCtrlDev.1");
OleAutomation automation = new OleAutomation(controlSite);

int[] rgdispid =
automation.getIDsOfNames(new String[] { "Match_MntStr"});
int dispIdMember = rgdispid[0];


char[] str = ("test"+"\0").toCharArray();
char[] str2 = ("test2"+"\0").toCharArray();

int ptr = COM.SysAllocString(str);
int ptr2 = COM.SysAllocString(str2);

short byRefType = OLE.VT_BSTR | OLE.VT_BYREF;
Variant test = new Variant(ptr,byRefType);
Variant test2 = new Variant(ptr2,byRefType);

Variant result = automation.getProperty(dispIdMember,new
Variant[]{test,test2});
System.out.println(result.getString());
display.dispose();
}
}

This is the jvm log:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_IN_PAGE_ERROR (0xc0000006) occurred at
PC=0x1854B9BA
Function=Java_org_eclipse_swt_internal_win32_OS_SendMessageW __II_3I_3I+0x17D
B
Library=E:\eclipse3.1m4\eclipse\plugins\org.eclipse.swt.win3 2_3.1.0\os\win32
\x86\swt-win32-3116.dll

Current Java thread:
at org.eclipse.swt.internal.win32.OS.WaitMessage(Native Method)
at org.eclipse.swt.widgets.Display.sleep(Display.java:3108)
at
org.eclipse.ui.application.WorkbenchAdvisor.eventLoopIdle(Wo rkbenchAdvisor.j
ava:346)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1570)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1540)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:285)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:144)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:102)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.
java:220)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
at org.eclipse.core.launcher.Main.run(Main.java:710)
at org.eclipse.core.launcher.Main.main(Main.java:694)

Dynamic libraries:
0x00400000 - 0x00407000 C:\WINNT\system32\javaw.exe
0x77F80000 - 0x77FFB000 C:\WINNT\system32\ntdll.dll
0x796D0000 - 0x79732000 C:\WINNT\system32\ADVAPI32.dll
0x77E60000 - 0x77F38000 C:\WINNT\system32\KERNEL32.DLL
0x786F0000 - 0x7875E000 C:\WINNT\system32\RPCRT4.DLL
0x77DF0000 - 0x77E55000 C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7C000 C:\WINNT\system32\GDI32.DLL
0x78000000 - 0x78045000 C:\WINNT\system32\MSVCRT.dll
0x75E00000 - 0x75E1A000 C:\WINNT\system32\IMM32.DLL
0x6C330000 - 0x6C338000 C:\WINNT\system32\LPK.DLL
0x65D20000 - 0x65D74000 C:\WINNT\system32\USP10.dll
0x08000000 - 0x08138000 C:\Program
Files\Java\j2re1.4.2_03\bin\client\jvm.dll
0x77530000 - 0x77560000 C:\WINNT\system32\WINMM.dll
0x10000000 - 0x10007000 C:\Program Files\Java\j2re1.4.2_03\bin\hpi.dll
0x007F0000 - 0x007FE000 C:\Program Files\Java\j2re1.4.2_03\bin\verify.dll
0x00800000 - 0x00819000 C:\Program Files\Java\j2re1.4.2_03\bin\java.dll
0x00820000 - 0x0082D000 C:\Program Files\Java\j2re1.4.2_03\bin\zip.dll
0x18500000 - 0x1850F000 C:\Program Files\Java\j2re1.4.2_03\bin\net.dll
0x74FB0000 - 0x74FC4000 C:\WINNT\system32\WS2_32.dll
0x74FA0000 - 0x74FA8000 C:\WINNT\system32\WS2HELP.DLL
0x18510000 - 0x18518000 C:\Program Files\Java\j2re1.4.2_03\bin\nio.dll
0x18530000 - 0x1857F000
E:\eclipse3.1m4\eclipse\plugins\org.eclipse.swt.win32_3.1.0\ os\win32\x86\swt
-win32-3116.dll
0x77A30000 - 0x77B1C000 C:\WINNT\system32\ole32.dll
0x71710000 - 0x71794000 C:\WINNT\system32\COMCTL32.dll
0x76AF0000 - 0x76B2E000 C:\WINNT\system32\comdlg32.dll
0x63180000 - 0x631E5000 C:\WINNT\system32\SHLWAPI.DLL
0x78F90000 - 0x791D8000 C:\WINNT\system32\SHELL32.DLL
0x77990000 - 0x77A2B000 C:\WINNT\system32\OLEAUT32.dll
0x6DD30000 - 0x6DD36000 C:\WINNT\system32\INDICDLL.dll
0x18ED0000 - 0x18ED8000
E:\eclipse3.1m4\eclipse\plugins\org.eclipse.core.resources.w in32_3.0.0\os\wi
n32\x86\core_3_1_0.dll
0x68EF0000 - 0x68F0F000 C:\WINNT\system32\oleacc.dll
0x77800000 - 0x7780C000 C:\WINNT\System32\rnr20.dll
0x77960000 - 0x77984000 C:\WINNT\system32\DNSAPI.DLL
0x74FD0000 - 0x74FDA000 C:\WINNT\system32\WSOCK32.DLL
0x77300000 - 0x77313000 C:\WINNT\system32\iphlpapi.dll
0x774E0000 - 0x774E5000 C:\WINNT\system32\ICMP.DLL
0x772E0000 - 0x772F7000 C:\WINNT\system32\MPRAPI.DLL
0x750E0000 - 0x750EF000 C:\WINNT\system32\SAMLIB.DLL
0x75100000 - 0x7514F000 C:\WINNT\system32\NETAPI32.DLL
0x797B0000 - 0x797BF000 C:\WINNT\system32\SECUR32.DLL
0x75150000 - 0x75156000 C:\WINNT\system32\NETRAP.DLL
0x77930000 - 0x7795A000 C:\WINNT\system32\WLDAP32.DLL
0x77370000 - 0x7739F000 C:\WINNT\system32\ACTIVEDS.DLL
0x77340000 - 0x77363000 C:\WINNT\system32\ADSLDPC.DLL
0x777F0000 - 0x777FE000 C:\WINNT\system32\RTUTILS.DLL
0x6D990000 - 0x6DA3C000 C:\WINNT\system32\SETUPAPI.DLL
0x794D0000 - 0x79532000 C:\WINNT\system32\USERENV.DLL
0x774A0000 - 0x774D3000 C:\WINNT\system32\RASAPI32.DLL
0x77480000 - 0x77491000 C:\WINNT\system32\RASMAN.DLL
0x774F0000 - 0x77512000 C:\WINNT\system32\TAPI32.DLL
0x77320000 - 0x77339000 C:\WINNT\system32\DHCPCSVC.DLL
0x777A0000 - 0x777A8000 C:\WINNT\System32\winrnr.dll
0x777B0000 - 0x777B5000 C:\WINNT\system32\rasadhlp.dll
0x72C50000 - 0x72CD6000 C:\WINNT\system32\CLBCATQ.DLL
0x70440000 - 0x704CF000 C:\WINNT\System32\mlang.dll
0x777E0000 - 0x777E7000 C:\WINNT\system32\VERSION.dll
0x75950000 - 0x75956000 C:\WINNT\system32\LZ32.DLL
0x6AB70000 - 0x6AB75000 C:\WINNT\system32\msimg32.dll
0x19EF0000 - 0x19FFF000 C:\Program Files\Java\j2re1.4.2_03\bin\awt.dll
0x777C0000 - 0x777DE000 C:\WINNT\system32\WINSPOOL.DRV
0x79A90000 - 0x79AA1000 C:\WINNT\system32\MPR.DLL
0x43000000 - 0x43005000 C:\Program Files\Google\Google Desktop
Search\GoogleDesktopNetwork1.dll
0x74F50000 - 0x74F6E000 C:\WINNT\system32\msafd.dll
0x74F90000 - 0x74F97000 C:\WINNT\System32\wshtcpip.dll
0x77900000 - 0x77923000 C:\WINNT\system32\imagehlp.dll
0x72960000 - 0x7298D000 C:\WINNT\system32\DBGHELP.dll
0x687E0000 - 0x687EB000 C:\WINNT\system32\PSAPI.DLL

Heap at VM Abort:
Heap
def new generation total 2240K, used 1391K [0x10010000, 0x10270000,
0x104f0000)
eden space 2048K, 67% used [0x10010000, 0x10167ff0, 0x10210000)
from space 192K, 8% used [0x10210000, 0x10213e68, 0x10240000)
to space 192K, 0% used [0x10240000, 0x10240000, 0x10270000)
tenured generation total 27888K, used 18047K [0x104f0000, 0x1202c000,
0x14010000)
the space 27888K, 64% used [0x104f0000, 0x1168fdd8, 0x1168fe00,
0x1202c000)
compacting perm gen total 29184K, used 29111K [0x14010000, 0x15c90000,
0x18010000)
the space 29184K, 99% used [0x14010000, 0x15c7df50, 0x15c7e000,
0x15c90000)

Local Time = Mon Dec 27 15:54:31 2004
Elapsed Time = 397
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode)
#

BTW:The document of activex supported by swt is too few,I can't find the
right way to program.Are there any document about it?
Re: Jvm is always crashed when I get the property of a activex using swt. [message #448998 is a reply to message #448935] Mon, 17 January 2005 15:52 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
The arguments pStr1 and pStr2 are just BSTR variants, therefore you create
them as new Variant("test"+"\0"). If the typedef was for (VT_BSTR |
VT_BYREF) it would be BSTR*.

You also need to pass in the third argument pVal. This is a double by ref
so you must allocate some memory for it.

short type = COM.VT_BYREF | COM.VT_R8;
int ptr = OS.GlobalAlloc(OS.GMEM_FIXED | OS.GMEM_ZEROINIT, 8);
Variant pVal = new Variant(ptr, type);


"agile" <agile.java@gmail.com> wrote in message
news:csakld$bes$1@www.eclipse.org...
> I'm working on activex supported by swt,and when I run the test
> application
> jvm is always crashed.:(
> Who can help me,tks.
>
> The idl which I used is:
> HRESULT
> Match_MntStr( BSTR pStr1, BSTR pStr2,
> double *pVal);
>
>
> Here is my application:
>
> public class ActivexTest {
> public static void main(String[] args){
> Display display = new Display();
> Shell shell = new Shell(display);
> OleFrame frame = new OleFrame(shell, SWT.NONE);
> OleControlSite controlSite =
> new OleControlSite(frame, SWT.NONE, "DFZJDev.ObjCtrlDev.1");
> OleAutomation automation = new OleAutomation(controlSite);
>
> int[] rgdispid =
> automation.getIDsOfNames(new String[] { "Match_MntStr"});
> int dispIdMember = rgdispid[0];
>
>
> char[] str = ("test"+"\0").toCharArray();
> char[] str2 = ("test2"+"\0").toCharArray();
>
> int ptr = COM.SysAllocString(str);
> int ptr2 = COM.SysAllocString(str2);
>
> short byRefType = OLE.VT_BSTR | OLE.VT_BYREF;
> Variant test = new Variant(ptr,byRefType);
> Variant test2 = new Variant(ptr2,byRefType);
>
> Variant result = automation.getProperty(dispIdMember,new
> Variant[]{test,test2});
> System.out.println(result.getString());
> display.dispose();
> }
> }
>
> This is the jvm log:
>
> An unexpected exception has been detected in native code outside the VM.
> Unexpected Signal : EXCEPTION_IN_PAGE_ERROR (0xc0000006) occurred at
> PC=0x1854B9BA
> Function=Java_org_eclipse_swt_internal_win32_OS_SendMessageW __II_3I_3I+0x17D
> B
> Library=E:\eclipse3.1m4\eclipse\plugins\org.eclipse.swt.win3 2_3.1.0\os\win32
> \x86\swt-win32-3116.dll
>
> Current Java thread:
> at org.eclipse.swt.internal.win32.OS.WaitMessage(Native Method)
> at org.eclipse.swt.widgets.Display.sleep(Display.java:3108)
> at
> org.eclipse.ui.application.WorkbenchAdvisor.eventLoopIdle(Wo rkbenchAdvisor.j
> ava:346)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1570)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1540)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:285)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:144)
> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:102)
> at
> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.
> java:220)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
> at org.eclipse.core.launcher.Main.run(Main.java:710)
> at org.eclipse.core.launcher.Main.main(Main.java:694)
>
> Dynamic libraries:
> 0x00400000 - 0x00407000 C:\WINNT\system32\javaw.exe
> 0x77F80000 - 0x77FFB000 C:\WINNT\system32\ntdll.dll
> 0x796D0000 - 0x79732000 C:\WINNT\system32\ADVAPI32.dll
> 0x77E60000 - 0x77F38000 C:\WINNT\system32\KERNEL32.DLL
> 0x786F0000 - 0x7875E000 C:\WINNT\system32\RPCRT4.DLL
> 0x77DF0000 - 0x77E55000 C:\WINNT\system32\USER32.dll
> 0x77F40000 - 0x77F7C000 C:\WINNT\system32\GDI32.DLL
> 0x78000000 - 0x78045000 C:\WINNT\system32\MSVCRT.dll
> 0x75E00000 - 0x75E1A000 C:\WINNT\system32\IMM32.DLL
> 0x6C330000 - 0x6C338000 C:\WINNT\system32\LPK.DLL
> 0x65D20000 - 0x65D74000 C:\WINNT\system32\USP10.dll
> 0x08000000 - 0x08138000 C:\Program
> Files\Java\j2re1.4.2_03\bin\client\jvm.dll
> 0x77530000 - 0x77560000 C:\WINNT\system32\WINMM.dll
> 0x10000000 - 0x10007000 C:\Program Files\Java\j2re1.4.2_03\bin\hpi.dll
> 0x007F0000 - 0x007FE000 C:\Program Files\Java\j2re1.4.2_03\bin\verify.dll
> 0x00800000 - 0x00819000 C:\Program Files\Java\j2re1.4.2_03\bin\java.dll
> 0x00820000 - 0x0082D000 C:\Program Files\Java\j2re1.4.2_03\bin\zip.dll
> 0x18500000 - 0x1850F000 C:\Program Files\Java\j2re1.4.2_03\bin\net.dll
> 0x74FB0000 - 0x74FC4000 C:\WINNT\system32\WS2_32.dll
> 0x74FA0000 - 0x74FA8000 C:\WINNT\system32\WS2HELP.DLL
> 0x18510000 - 0x18518000 C:\Program Files\Java\j2re1.4.2_03\bin\nio.dll
> 0x18530000 - 0x1857F000
> E:\eclipse3.1m4\eclipse\plugins\org.eclipse.swt.win32_3.1.0\ os\win32\x86\swt
> -win32-3116.dll
> 0x77A30000 - 0x77B1C000 C:\WINNT\system32\ole32.dll
> 0x71710000 - 0x71794000 C:\WINNT\system32\COMCTL32.dll
> 0x76AF0000 - 0x76B2E000 C:\WINNT\system32\comdlg32.dll
> 0x63180000 - 0x631E5000 C:\WINNT\system32\SHLWAPI.DLL
> 0x78F90000 - 0x791D8000 C:\WINNT\system32\SHELL32.DLL
> 0x77990000 - 0x77A2B000 C:\WINNT\system32\OLEAUT32.dll
> 0x6DD30000 - 0x6DD36000 C:\WINNT\system32\INDICDLL.dll
> 0x18ED0000 - 0x18ED8000
> E:\eclipse3.1m4\eclipse\plugins\org.eclipse.core.resources.w in32_3.0.0\os\wi
> n32\x86\core_3_1_0.dll
> 0x68EF0000 - 0x68F0F000 C:\WINNT\system32\oleacc.dll
> 0x77800000 - 0x7780C000 C:\WINNT\System32\rnr20.dll
> 0x77960000 - 0x77984000 C:\WINNT\system32\DNSAPI.DLL
> 0x74FD0000 - 0x74FDA000 C:\WINNT\system32\WSOCK32.DLL
> 0x77300000 - 0x77313000 C:\WINNT\system32\iphlpapi.dll
> 0x774E0000 - 0x774E5000 C:\WINNT\system32\ICMP.DLL
> 0x772E0000 - 0x772F7000 C:\WINNT\system32\MPRAPI.DLL
> 0x750E0000 - 0x750EF000 C:\WINNT\system32\SAMLIB.DLL
> 0x75100000 - 0x7514F000 C:\WINNT\system32\NETAPI32.DLL
> 0x797B0000 - 0x797BF000 C:\WINNT\system32\SECUR32.DLL
> 0x75150000 - 0x75156000 C:\WINNT\system32\NETRAP.DLL
> 0x77930000 - 0x7795A000 C:\WINNT\system32\WLDAP32.DLL
> 0x77370000 - 0x7739F000 C:\WINNT\system32\ACTIVEDS.DLL
> 0x77340000 - 0x77363000 C:\WINNT\system32\ADSLDPC.DLL
> 0x777F0000 - 0x777FE000 C:\WINNT\system32\RTUTILS.DLL
> 0x6D990000 - 0x6DA3C000 C:\WINNT\system32\SETUPAPI.DLL
> 0x794D0000 - 0x79532000 C:\WINNT\system32\USERENV.DLL
> 0x774A0000 - 0x774D3000 C:\WINNT\system32\RASAPI32.DLL
> 0x77480000 - 0x77491000 C:\WINNT\system32\RASMAN.DLL
> 0x774F0000 - 0x77512000 C:\WINNT\system32\TAPI32.DLL
> 0x77320000 - 0x77339000 C:\WINNT\system32\DHCPCSVC.DLL
> 0x777A0000 - 0x777A8000 C:\WINNT\System32\winrnr.dll
> 0x777B0000 - 0x777B5000 C:\WINNT\system32\rasadhlp.dll
> 0x72C50000 - 0x72CD6000 C:\WINNT\system32\CLBCATQ.DLL
> 0x70440000 - 0x704CF000 C:\WINNT\System32\mlang.dll
> 0x777E0000 - 0x777E7000 C:\WINNT\system32\VERSION.dll
> 0x75950000 - 0x75956000 C:\WINNT\system32\LZ32.DLL
> 0x6AB70000 - 0x6AB75000 C:\WINNT\system32\msimg32.dll
> 0x19EF0000 - 0x19FFF000 C:\Program Files\Java\j2re1.4.2_03\bin\awt.dll
> 0x777C0000 - 0x777DE000 C:\WINNT\system32\WINSPOOL.DRV
> 0x79A90000 - 0x79AA1000 C:\WINNT\system32\MPR.DLL
> 0x43000000 - 0x43005000 C:\Program Files\Google\Google Desktop
> Search\GoogleDesktopNetwork1.dll
> 0x74F50000 - 0x74F6E000 C:\WINNT\system32\msafd.dll
> 0x74F90000 - 0x74F97000 C:\WINNT\System32\wshtcpip.dll
> 0x77900000 - 0x77923000 C:\WINNT\system32\imagehlp.dll
> 0x72960000 - 0x7298D000 C:\WINNT\system32\DBGHELP.dll
> 0x687E0000 - 0x687EB000 C:\WINNT\system32\PSAPI.DLL
>
> Heap at VM Abort:
> Heap
> def new generation total 2240K, used 1391K [0x10010000, 0x10270000,
> 0x104f0000)
> eden space 2048K, 67% used [0x10010000, 0x10167ff0, 0x10210000)
> from space 192K, 8% used [0x10210000, 0x10213e68, 0x10240000)
> to space 192K, 0% used [0x10240000, 0x10240000, 0x10270000)
> tenured generation total 27888K, used 18047K [0x104f0000, 0x1202c000,
> 0x14010000)
> the space 27888K, 64% used [0x104f0000, 0x1168fdd8, 0x1168fe00,
> 0x1202c000)
> compacting perm gen total 29184K, used 29111K [0x14010000, 0x15c90000,
> 0x18010000)
> the space 29184K, 99% used [0x14010000, 0x15c7df50, 0x15c7e000,
> 0x15c90000)
>
> Local Time = Mon Dec 27 15:54:31 2004
> Elapsed Time = 397
> #
> # The exception above was detected in native code outside the VM
> #
> # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode)
> #
>
> BTW:The document of activex supported by swt is too few,I can't find the
> right way to program.Are there any document about it?
>
>
>
>
Re: Jvm is always crashed when I get the property of a activex using swt. [message #449085 is a reply to message #448998] Tue, 18 January 2005 03:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: agile.java.gmail.com

Thanks Very Much:)

When I modified the application using your method,the jvm is not crashed:)
but it don't return the correct value:(

The following codes do not get the correct value,and value is always
zero. In my test case,the value of value shoule be 1.0.
Variant request = new Variant(requestMark);
Variant orgianl = new Variant(origianlMark);

short type = COM.VT_BYREF | COM.VT_R8;
int ptr = OS.GlobalAlloc(OS.GMEM_FIXED | OS.GMEM_ZEROINIT, 8);
Variant pVal = new Variant(ptr, type);

automation.getProperty(
dispIdMember,
new Variant[] { request, orgianl,pVal});

double[] value = new double;
OS.MoveMemory(value,pVal.getByRef(),8);
OS.GlobalFree(ptr);
System.out.println(value);

And this code got right result:
Variant request = new Variant(requestMark);
Variant orgianl = new Variant(origianlMark);

Variant p = automation.getProperty(
dispIdMember,
new Variant[] { request, orgianl});

double[] value = new double;
value = p.getFloat();
System.out.println(value);

Why?

"Veronika Irvine" <veronika_irvine@oti.com> д
Re: Jvm is always crashed when I get the property of a activex using swt. [message #449138 is a reply to message #449085] Tue, 18 January 2005 18:52 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Sorry, I was thinking of invoke rather than getProperty. You are right..


"agile" <agile.java@gmail.com> wrote in message
news:cshu1i$qcq$1@www.eclipse.org...
> Thanks Very Much:)
>
> When I modified the application using your method,the jvm is not crashed:)
> but it don't return the correct value:(
>
> The following codes do not get the correct value,and value is always
> zero. In my test case,the value of value shoule be 1.0.
> Variant request = new Variant(requestMark);
> Variant orgianl = new Variant(origianlMark);
>
> short type = COM.VT_BYREF | COM.VT_R8;
> int ptr = OS.GlobalAlloc(OS.GMEM_FIXED | OS.GMEM_ZEROINIT, 8);
> Variant pVal = new Variant(ptr, type);
>
> automation.getProperty(
> dispIdMember,
> new Variant[] { request, orgianl,pVal});
>
> double[] value = new double;
> OS.MoveMemory(value,pVal.getByRef(),8);
> OS.GlobalFree(ptr);
> System.out.println(value);
>
> And this code got right result:
> Variant request = new Variant(requestMark);
> Variant orgianl = new Variant(origianlMark);
>
> Variant p = automation.getProperty(
> dispIdMember,
> new Variant[] { request, orgianl});
>
> double[] value = new double;
> value = p.getFloat();
> System.out.println(value);
>
> Why?
>
> "Veronika Irvine" <veronika_irvine@oti.com> д
Re: Jvm is always crashed when I get the property of a activex using swt. [message #449276 is a reply to message #449138] Thu, 20 January 2005 01:40 Go to previous message
Eclipse UserFriend
Originally posted by: agile.java.gmail.com

Oh,that's right,thanks very much:)
Previous Topic:Standalone SWT/JFace application packaging, essential jars
Next Topic:How to get parent window's location in new popup window?
Goto Forum:
  


Current Time: Thu Nov 14 21:13:55 GMT 2019

Powered by FUDForum. Page generated in 0.04000 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top