Home : Early Binding (VTable) vs Late Binding (IDispatch)
Q30967 - INFO: Early Binding (VTable) vs Late Binding (IDispatch)

Early Binding (VTable) vs Late Binding (IDispatch)

 

By default, J-Integra calls COM methods using early binding (i.e. calling methods via vtable pointers). This is the case for both DCOM mode and native mode. In DCOM mode, J-Integra makes vtable and IDispatch:Invoke calls by talking the DCOM wire protocol (using pure Java) over TCP/IP. In native mode, J-Integra makes vtable and IDispatch:Invoke calls by using native code located in DLLs on Windows machines. There are only two situations where J-Integra uses late binding instead (i.e. calling methods via IDispatch:Invoke).

1. When a dispinterface is being accessed (a DISPINTERFACE is an interface that is not dual).

A dispinterface contains a set of properties and methods on which you can call IDispatch::Invoke, whereas a dual interface exposes properties and methods through IDispatch and directly through the VTable. From the IDL file of a COM component, you can find out whether an interface is defined as dispinterface or dual. Because J-Integra makes COM methods called via vtable invocation by default, you must select the Only generate IDispatch option of com2java tool to access a dispinterface from Java. Otherwise you may get this error:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred

2. When the Only generate IDispatch option is selected before generating proxies for the COM object using the com2java tool, J-Integra uses IDispatch:Invoke to access both dispinterface and dual interfaces. For example, if a COM event is a dispinterface, then you must select the Only generate IDispatch option. Otherwise you may get AutomationException: 0x80040202 from the Java client.
Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 6/23/2006.
Last Modified on 7/11/2006.
Last Modified by No Author Name Available!.
Article has been viewed 8624 times.
Rated 5 out of 10 based on 8 votes.
Print Article
Email Article