Re: calling DLL



OK here it is from dumpbin:

Dump of file rnavandrpop.dll

File Type: DLL

Section contains the following exports for RNAVandRPOP.dll

0 characteristics
428CED7C time date stamp Thu May 19 15:48:12 2005
0.00 version
1 ordinal base
3 number of functions
3 number of names

ordinal hint RVA
name

1
0 0001A78A Relnav_Exec
2
1 0001A131 fnRNAVandRPOP
3
2 000585F4 nRNAVandRPOP

I am trying to call Relnav_exec. In the dll project it is declared this way:

__declspec(dllexport) void Relnav_Exec(
RNAV_Initial *init,
RNAV_Inputs *inputs,
RNAV_stateOutput *state,
RNAV_TelemetryOutputs *telem);


In the dll project that is try to call it it is declared this way:

__declspec(dllimport) void Relnav_Exec(
RNAV_Initial *init,
RNAV_Inputs *inputs,
RNAV_stateOutput *state,
RNAV_TelemetryOutputs *telem);

Both dll projects use the option "Compile as C code". The error message from
the linker is the following:

TEES error LNK2019: unresolved external symbol __imp__Relnav_Exec referenced
in function _WrapRelnavExec

Actually I just noticed that even though I deleted the reference to the
directory that contains the .dll and .lib I get the same error message. This
implies to me that somehow the DLL is not being located as opposed to the
function declaration being incorrect. As I mentioned in my first post I
placed the path for the DLL in the "Additional libraries directories". Help...


Bill

"William DePalo [MVP VC++]" wrote:

> "Bill Grigg" <Bill Grigg@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:86CA4570-13AA-4A39-918E-3FDE3CA5DD16@xxxxxxxxxxxxxxxx
> >I have been successfully calling DLL's using VC++ 6.0 and also using
> >VC++7.1
> > (.NET). I only mention this because I have never felt comfortable with the
> > process, but nonetheless it did work. Recently I started calling an
> > unmanaged
> > DLL from a .NET app. It worked fine. Now I have the situation where I am
> > trying to call a function in one DLL from another DLL. Both are unmanaged
> > and
> > are built with VC++7.1. In the calling DLL I set the property
> > page/linker/general/additional library directories to point to the
> > directory
> > that contains MyDll.lib and MyDll.dll. The entry point is NOT being found.
> > I
> > am sure that the signature is correct and that the DLL import/export
> > modifiers are correct. Everything is being compiled as C (instead of C++).
> > Any suggestions would be most welcome.
>
> It may be an issue of compiler name decoration (aka mangling).
>
> For the DLL that contains the function you are trying to call do this:
>
> dumpbin /exports YourDllNameGoesHere.dll
>
> Find the name of the exported function that most closely matches the one
> that you are trying to call. Post that here. Then also show the declaration
> of that function in the module that makes the call and state whether the
> caller is written in C or C++. Chances are someone will spot the error.
>
> Regards,
> Will
>
>
>
.



Relevant Pages

  • Re: dumping sfcfiles.dll
    ... > File Type: DLL ... > Section contains the following exports for sfcfiles.dll ... Ordinals - but that doesn't mean one doesn't exist. ...
    (microsoft.public.vb.general.discussion)
  • Re: Convert C-Builder program to Delphi?
    ... > quite separate from the function declaration itself. ... >this DLL ... >way the only place anything needs to be changed is in the #define macro. ... Exports SomeDLL_Open Name 'SomeDLL_Open'; ...
    (comp.lang.pascal.delphi.misc)
  • Re: Convert C-Builder program to Delphi?
    ... > quite separate from the function declaration itself. ... >this DLL ... >way the only place anything needs to be changed is in the #define macro. ... Exports SomeDLL_Open Name 'SomeDLL_Open'; ...
    (comp.lang.cpp)
  • Re: Access crashes when calling DLL function.
    ... Change the declaration of UNZ_CHECKADDRESS to make all the LineX ... arguments "As String" instead of using the implicit $ suffix. ... I then built a simple input form (in the same mdb) that calls the ... functions from a DLL they provide. ...
    (microsoft.public.access.modulesdaovba)
  • Re: how to transfer/place a dll into the emulator
    ... File Type: DLL ... Section contains the following exports for DECOMPRESS.dll ... > Senior Engineer ...
    (microsoft.public.pocketpc.developer)