
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