HELP: Call other DLLs from a COM 
Author Message
 HELP: Call other DLLs from a COM

Hi,

I am writing a COM using VC.Net. I have to call some DLLs which were writen
in VC++ 6. When I call some functions in the DLLs, some run well but some
cannot. I always get the same error:

First-chance exception at 0x77e6d756 in VB_Test.exe: Microsoft C++

WSDATA has encountered a problem: Error loading library wsmsdata

I tried use the same routines in a console applaction, there is no problem.
The document of the DLLs has mentioned:
All of the functions are exported with the __stdcall calling convention

But in my console application, I just use the default setting: __cdecl and
it works very well. For the COM, no matter which setting cannot work.

What's wrong?

Thank you for any comment.

Jerry



Sat, 19 Nov 2005 21:08:35 GMT  
 HELP: Call other DLLs from a COM

Quote:
> I am writing a COM using VC.NET. I have to call some DLLs which were
writen
> in VC++ 6. When I call some functions in the DLLs, some run well but
some
> cannot. I always get the same error:

> First-chance exception at 0x77e6d756 in VB_Test.exe: Microsoft C++

> WSDATA has encountered a problem: Error loading library wsmsdata

The called DLL has thrown a C++ exception of the type
CEntryPointException. This is a user-defined exception type. Presumably,
it cannot find wsmsdata, whatever that might be. Apparently, you are
calling into WSDATA.dll which tries to load wsmsdata.dll, fails and
reports it by throwing an exception.

Are you running an application that works and the one that does not from
different directories? Even if wsdata.dll and wsmsdata.dll are in the
same directory, one may not find the other because LoadLibrary looks in
the directory of the EXE, not that of the DLL. Try running your
application from the directory containing both DLLs, or add their
directory to PATH.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken



Sat, 19 Nov 2005 22:24:05 GMT  
 HELP: Call other DLLs from a COM
Igor,

Thank you vrey much for your help. I fixed it. The reason is the COM client
cannot find the DLL. After I copied the DLLs to the directory of the client
application, it works well.

Thank you again.

Jerry


Quote:


> > I am writing a COM using VC.NET. I have to call some DLLs which were
> writen
> > in VC++ 6. When I call some functions in the DLLs, some run well but
> some
> > cannot. I always get the same error:

> > First-chance exception at 0x77e6d756 in VB_Test.exe: Microsoft C++

> > WSDATA has encountered a problem: Error loading library wsmsdata

> The called DLL has thrown a C++ exception of the type
> CEntryPointException. This is a user-defined exception type. Presumably,
> it cannot find wsmsdata, whatever that might be. Apparently, you are
> calling into WSDATA.dll which tries to load wsmsdata.dll, fails and
> reports it by throwing an exception.

> Are you running an application that works and the one that does not from
> different directories? Even if wsdata.dll and wsmsdata.dll are in the
> same directory, one may not find the other because LoadLibrary looks in
> the directory of the EXE, not that of the DLL. Try running your
> application from the directory containing both DLLs, or add their
> directory to PATH.
> --
> With best wishes,
>     Igor Tandetnik

> "For every complex problem, there is a solution that is simple, neat,
> and wrong." H.L. Mencken



Sun, 20 Nov 2005 08:43:43 GMT  
 
 [ 4 post ] 

 Relevant Pages 

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

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

3. HELP: Call other DLLs from a COM

4. Problem calling VB COM dll from VC++ multithreaded COM EXE client

5. How COM components developed for WebClasses are diff from others say used on Desktop

6. call a C# class from a VB 6 COM dll

7. Calling COM DLL from .c files

8. C DLL making calls to a COM object

9. Calling a COM object from a C dll

10. Calling "unmanaged" com dll from c#

11. calling a method in a J++ COM DLL from C++

12. Calling ATL COM Dll from Remote Machine

 

 
Powered by phpBB® Forum Software