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

COM

 
GeneralWMI and COM Pin
macakd24-May-05 12:54
macakd24-May-05 12:54 
GeneralRe: WMI and COM Pin
Member 19404227-Jun-05 3:55
Member 19404227-Jun-05 3:55 
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 
inner wrote:
Question 1:

I have:
1. exe COM client A.
2. exe outofproc COM server B which is also a client to:
3. dll inproc COM server C.

So B creates an instance of C. And passes the pointer to it to A. Can A actualy call C which is in B process space?


No. Although there is nothing to prevent you from writing this sort of code, the pointer that A receives to C is invalid. You can only call a function in a DLL loaded in an executables own process space.


inner wrote:
Question 2:
I have:
1. A is an exe COM client .
2. B is an exe outofproc COM server.

When A releases all instances of B, B unloads. Good! That's what I need. BUT! If:
2. B is a dll inproc COM server.

Then When A releases all instances of B, dll B still is loaded by A process for a while.
Is there a way to force it to unload?


This is a more complicated question. The actual reference counting for a DLL can become more complex than what you think it should be because COM may create references behind the scenes to additional interfaces such as proxies.

It also depends to at least some degree on the platform you are using to create the COM objects (i.e. VB is a little different from C++).

If you are using C++ a call to CoFreeUnusedLibraries() should unload the DLL.

If you are using VB, most of the COM implementation is hidden from you, and the safest thing to do is just allow the runtime to clean up after itself.

Robert
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 
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 

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.