Re: calling DLL

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Bill Grigg" <BillGrigg@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:97C78AAC-2D9A-4CAF-82FF-55F242DE4BEE@xxxxxxxxxxxxxxxx
> OK here it is from dumpbin:
>
> Dump of file rnavandrpop.dll
> ...
> 0 0001A78A Relnav_Exec
> ...
> 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);
>
Oh boy. With the exception of what looks like a typo in the lower case 'e'
in 'exec' above, the names look OK.

> 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...

Then maybe the problem is not so much name mangling as DLL Hell. You should
place the import library (.lib file) created by the linker at the time that
the DLL was built in the libraries directory. Make sure you have only one
copy of the DLL on your system. Then if you are debugging the executable,
you can put the DLL in the same directory as the executable. You didn't
earlier place the DLL in one of the other directories along the PATH did
you?

Alternatively, if you are debugging the DLL, you can go to your project's
Debug property settings. Then in the box labelled "Command" enter the name
of the executable that implicitly loads the DLL. You can also enter any
optional parameters as well as the startup directory.

Regards,
Will


.



Relevant Pages

  • 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: problems calling a function contained in a dll
    ... I'm having difficulties loading a dll in Microsoft Visual Studio 2003, ... If the actual compiler or system is relevant, ... junk.c:19: warning: implicit declaration of function `LoadLibraryA' ...
    (comp.lang.c)
  • Re: Need to split EXE into EXE and DLL
    ... If the object is declared in the EXE, would it be accessible to classes declared in the DLLs? ... if the class in a DLL has this ... ie would the SysSettings object be accessible to the Class when teh Class resides in a different assembly to where SysSettings is declared. ... You'll have to move the global declaration to the classlibrary aswell. ...
    (microsoft.public.dotnet.framework.windowsforms)