Problem calling VB COM dll from VC++ multithreaded COM EXE client 
Author Message
 Problem calling VB COM dll from VC++ multithreaded COM EXE client

Hi,

I am having transient problems with calling a Visual Basic developed COM
server dll from a Visual C++ developed multithreaded COM EXE client.  The
platform I am using is Visual Studio v6.0 SP5 running on NT 4.0W SP6.

When I run the client under the Visual C++ de{*filter*}, sometimes I get no
errors, other times I get several first chance exceptions when making calls
to the VB COM server dll.  These exceptions include access violations, float
inexact results, and c++ exceptions in my client application, ntdll.dll,
kernel32.dll, oleaut32.dll, and others.  Other times I get the first chance
exceptions and the program halts execution with a access violation dialog
box in ntdll.dll.

The client has 3 threads all running as apartment
threaded(CoInitialize(NULL)).  The main thread creates the other 2.  The
main thread creates objects from the VB COM server dll that are accessed by
the other two threads through an interface on an object in the main thread
apartment that is marshaled through the GIT.  The main thread in the client
also fires events from windows messages sent by the other 2 threads using
PostThreadMessage.

According to MSDN, I have checked the Unattended Execution and Retained In
Memory check boxes in the VB COM server dll project and also created a type
library for calls that VB dll makes to the OS API.  I have no idea why I am
still getting these errors, but I believe that the VB "VM" is still
unloading the dll while that client app is still accessing it.  Is this
assumption correct?  Any other ideas?  Any help would be greatly
appreciated.

Thanks in advance,

Tim



Sun, 19 Dec 2004 03:21:35 GMT  
 Problem calling VB COM dll from VC++ multithreaded COM EXE client
Are the variables that are passed to the VB Com marked as ByValue?
Since the VB component is MAST are you syncronizing the use of the component
in the various threads? (MUTEX, Semiphore, ...)
As you stated it could be being unloaded before all the threads are done
with it.  WIthout seeing the code it is hard to say what is going on.



Quote:
> Hi,

> I am having transient problems with calling a Visual Basic developed COM
> server dll from a Visual C++ developed multithreaded COM EXE client.  The
> platform I am using is Visual Studio v6.0 SP5 running on NT 4.0W SP6.

> When I run the client under the Visual C++ de{*filter*}, sometimes I get no
> errors, other times I get several first chance exceptions when making
calls
> to the VB COM server dll.  These exceptions include access violations,
float
> inexact results, and c++ exceptions in my client application, ntdll.dll,
> kernel32.dll, oleaut32.dll, and others.  Other times I get the first
chance
> exceptions and the program halts execution with a access violation dialog
> box in ntdll.dll.

> The client has 3 threads all running as apartment
> threaded(CoInitialize(NULL)).  The main thread creates the other 2.  The
> main thread creates objects from the VB COM server dll that are accessed
by
> the other two threads through an interface on an object in the main thread
> apartment that is marshaled through the GIT.  The main thread in the
client
> also fires events from windows messages sent by the other 2 threads using
> PostThreadMessage.

> According to MSDN, I have checked the Unattended Execution and Retained In
> Memory check boxes in the VB COM server dll project and also created a
type
> library for calls that VB dll makes to the OS API.  I have no idea why I
am
> still getting these errors, but I believe that the VB "VM" is still
> unloading the dll while that client app is still accessing it.  Is this
> assumption correct?  Any other ideas?  Any help would be greatly
> appreciated.

> Thanks in advance,

> Tim



Mon, 20 Dec 2004 01:33:16 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. problems passing ADO Recordset from VB-COM client to VC-COM-Server dll

2. call a VB COM dll thru a C++ COM dll from a C program

3. call a VB COM dll thru a C++ COM dll from a C program

4. Problems using a ATL COM EXE Server with VB Client

5. VC ATL DLL crashin with VB COM client

6. COM DLL TO COM EXE problem!

7. Calling VB COM DLL from VC++

8. VC calling a VB COM dll

9. Problem with scripting context when using VB com object inside VC com object

10. Debugging C++ COM EXE from VB client

11. Enable COM clients call methods inside COM events

12. COM client crashes calling COM method

 

 
Powered by phpBB® Forum Software