Click here to Skip to main content
15,888,454 members
Home / Discussions / COM
   

COM

 
GeneralProbably dumb question: passing IUnknown** to VB/MCPP/C# Pin
Florian Storck18-May-05 3:34
Florian Storck18-May-05 3:34 
GeneralRe: Probably dumb question: passing IUnknown** to VB/MCPP/C# Pin
hanofee27-May-05 4:28
hanofee27-May-05 4:28 
GeneralRe: Probably dumb question: passing IUnknown** to VB/MCPP/C# Pin
Florian Storck27-May-05 4:43
Florian Storck27-May-05 4:43 
GeneralRe: Probably dumb question: passing IUnknown** to VB/MCPP/C# Pin
Florian Storck1-Jun-05 23:06
Florian Storck1-Jun-05 23:06 
GeneralOk. The dumbest 2 questions Pin
CherezZaboro16-May-05 4:53
CherezZaboro16-May-05 4:53 
GeneralRe: Ok. The dumbest 2 questions Pin
rwestgraham16-May-05 10:55
rwestgraham16-May-05 10:55 
GeneralRe: Ok. The dumbest 2 questions Pin
CherezZaboro16-May-05 11:01
CherezZaboro16-May-05 11:01 
GeneralRe: Ok. The dumbest 2 questions Pin
rwestgraham16-May-05 11:37
rwestgraham16-May-05 11:37 
OK, without seeing the code, it is hard to know exactly what he is doing.

Trying to copy a pointer into another process by simply moving the rvalue will result in an invalid call, because the rvalue is an address in another process.

If it works what he is doing is marshalling the pointer into process A. This is a valid COM operation. What happens when you marshall a pointer between two processes is COM is creating a proxy behind the scenes in A that allows A to call B and request a function call on C. The reason this is slower is because A is still not calling the C DLL directly (this is not possible under any circumstances). Instead it is calling a proxy that forwards the request to B, which then forwards the request to C on behalf of A. The behind the scenes proxy call from A to B is out-of-process, so it runs more slowly than a in-process DLL function call.

There are scenarios when an "A->B->C" style call arrangement is appropriate - usually if the C DLL maintains any state that both A and B either require access to, or that must be maintained by C across both A nd B function calls - i.e. A calls a function in C that results in setting some state variables. B then calls another function in C that also depends upon the state set by the previous function call from A).

In this case you would design your DLL to be loaded by whichever process - A or B - is anticipated to make the most calls to the DLL to minimize the performance hit.

If the rationale for an "A->B->C" style call is not based on a shared state requirement, then the performance hit is probably not worth it. For exampole, suppose you want to load only one instance of C to reduce memory consumption. When A and B are created they run on separate threads, each of which is allocated a pretty big chunk of memory at startup. Calling C from A via B is probably causing a pointless performance hit because A may not be using memory it already has allocated. Unless your C DLL is really huge, you might as well load the C DLL in both processes and eliminate the proxy.

Robert


GeneralRe: Ok. The dumbest 2 questions Pin
User 21559721-May-05 0:38
User 21559721-May-05 0:38 
GeneralDCOM and C# Pin
Millzy14-May-05 10:22
Millzy14-May-05 10:22 
GeneralSharing enums between COM objects Pin
Sir Garence12-May-05 23:52
sussSir Garence12-May-05 23:52 
GeneralRe: Sharing enums between COM objects Pin
User 21559719-May-05 21:45
User 21559719-May-05 21:45 
GeneralRe: Sharing enums between COM objects Pin
Hariharan.T19-May-05 23:14
Hariharan.T19-May-05 23:14 
GeneralGetting SafeArray** in C++ from VB COM Pin
hanofee12-May-05 22:59
hanofee12-May-05 22:59 
GeneralConverting interface pointers Pin
Mikke_x12-May-05 19:20
Mikke_x12-May-05 19:20 
GeneralRe: Converting interface pointers Pin
ursus zeta15-May-05 9:48
ursus zeta15-May-05 9:48 
GeneralStrange behavior of BSTRs in DCOM Pin
morenz12-May-05 3:01
morenz12-May-05 3:01 
GeneralRe: Strange behavior of BSTRs in DCOM Pin
Indagro12-May-05 20:54
Indagro12-May-05 20:54 
GeneralRe: Strange behavior of BSTRs in DCOM Pin
morenz16-May-05 5:19
morenz16-May-05 5:19 
GeneralRe: Strange behavior of BSTRs in DCOM Pin
Indagro18-May-05 23:35
Indagro18-May-05 23:35 
GeneralRe: Strange behavior of BSTRs in DCOM Pin
morenz20-May-05 13:08
morenz20-May-05 13:08 
GeneralRe: Strange behavior of BSTRs in DCOM Pin
Vi212-May-05 21:08
Vi212-May-05 21:08 
GeneralRe: Strange behavior of BSTRs in DCOM Pin
morenz16-May-05 2:52
morenz16-May-05 2:52 
GeneralMS Excel 10.0 object library Pin
Member 164882912-May-05 0:55
Member 164882912-May-05 0:55 
GeneralNeed help in NetMeeting Desktop Sharing Pin
shainisnair12-May-05 0:46
shainisnair12-May-05 0:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.