Re: DLL API Calling Issue




"Wyne" <Wyne@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C390E72D-4475-4839-B3C8-2BFD531D74E3@xxxxxxxxxxxxxxxx
<snipped>


OK, here's my guess... <g>

Note this define...
#define CPLUSPLUS
Normally one doesn't do this as the compiler being used will define it.
Anyway this forces the exports to be C++ unless a DEF file is used. But we
have no way of knowing. That is why the dumpbin results would have been very
useful. Did you get that working yet?

I suspect however, that since the intermediate dll can 'see' xxxxx.dll just
fine, and VB can not, then a DEF was not used and the functions were not
exported as extern C, and thus unuseable from VB. Your intermediate is
likely exporting its API/Interface correctly.

If I am correct then the /Exports section would have shown some squirrelly
names.

To use this DLL from VB (again IF I am correct) you have only two choices:
1) Create an ActiveX component wrapper around the dll.
ATL would be the simplest and easiest way to implement it.
VB loves ActiveX components, plus you would confine all your 'translations',
massages, etc. to one component.
It makes it easier to export all those structs and enums so you don't have
to write and debug VB equivalents.
But may or may not have a slight performance penality.

Or 2) Just use your intermediate dll. Hey if it works, it works. <g>

Using the dll directly will not be an option.

-ralph


.



Relevant Pages

  • Re: import library not being created when dll is built
    ... > I used dumpbin to check the exports and you guessed right - it dosen't ... the projet does not come with a .def file. ... > This is a C++ DLL, ... That a look at the header file that defines the interface to the DLL (i.e., ...
    (microsoft.public.vc.language)
  • Re: Mapping .DEF entries in Visual Studio 2005
    ... You need to use EXPORTS, ... the project has no .DEF file for the DLL ... The linker reports that: "exports statement not supported for the target ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Creating DLL Entry Point
    ... I have a .def file with EXPORTS then DllMain is ... image headers, it is automatically called when the DLL is attached/detached, and ...
    (microsoft.public.vc.language)
  • Re: Trouble Exporting from a Dll
    ... my understanding is that this would modify the exported symbol. ... > Try assigning an export ordinal to the function in your def file. ... >> I am writing a DLL that exports a function that is to be loaded ...
    (microsoft.public.vc.mfc)
  • Re: Class export by regular DLL (vc++) be used in vb
    ... Use the Declare Function directive to declare them in your VB code, ... Create a typelib for the DLL and reference that in your app. ... ActiveX component. ...
    (microsoft.public.vb.general.discussion)