Re: dll problems in VC++

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Norman Bullen (norm_at_BlackKittenAssociates.com.INVALID)
Date: 02/11/05


Date: Fri, 11 Feb 2005 03:44:18 GMT

Severian wrote:
>
       < snipped >
>
> Q: I know it is possible to create a .lib file for an .exe file. Is it
> possible to link that .lib with the DLL and access any exported
> functions?
>
> I've not tried this (I pass a list of callback function pointers to
> the DLL myself.)
>
> --
> Sev

There are three ways to cause the linker to create an (export) .LIB
file. So far as I know, any will work when you link either a .DLL or a .EXE.

These are:
    __declspec(dllexport)
    EXPORTS directive in a .DEF file
    /EXPORT linker command line option

I have only used the first with a .EXE file but it does work. Any .DLL
modules loaded by the .EXE can reference those symbols in the .EXE.

Norm

-- 
--
To reply, change domain to an adult feline.


Relevant Pages

  • Re: Editors
    ... some strip them on exe files by default. ... "preferred base address" and, yup, relocations are completely ... DLL files, though, aren't loaded into their own address space but are ... EXE's "entry-point", though, is not "special" in that it's just an ...
    (alt.lang.asm)
  • Re: Forwarding DLL
    ... Note that I use the same header file in my lib/dll/app project as in the lib. ... in particular not the exports. ... lib when I make the dll. ... But, during compilation of the dll, the class should be exported because FORWARDDLL_API is not an empty macro anymore, is __declspec. ...
    (microsoft.public.vc.language)
  • Re: Linking model VS2005
    ... Dynamic Library (.dll) and Static Library. ... The EXE is also having a dependency on many LIB, ...
    (microsoft.public.vstudio.development)
  • Re: Command Line Build Using DEVENV Does Not Honor Dependencies
    ... EXE depends on the LIB, which, in turns, depends on the DLL (yes, I ... depends on the .LIB project, ...
    (microsoft.public.vstudio.general)
  • Re: DLL pass vector by value crash
    ... The prototype for testfunc is a by-value copy, so it has to make a copy of the value. ... Are you using static linking for either the .exe (if so, it probably won't work correctly, ... clearly using the shared CRT DLL for the DLL you are constructing. ... no crash occurs in either config. ...
    (microsoft.public.vc.mfc)