Re: Queries about DLL Exports

Tech-Archive recommends: Speed Up your PC by fixing your registry



"Mohammad Omer" <momer114@xxxxxxxxx> wrote in message
news:1164289961.023137.46060@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
is it possible to export variable and classes with using def file?

I believe you can export a global variable the same way you export a
function: just mention its name in DEF file.

It's impractical to export a class via DEF file. Linker doesn't know
anything about classes: exporting a class really means exporting every
method of the class, under its mangled name. If you are curious, perform
an experiment: create a DLL project export a class with a few methods
via __declspec(dllexport), then use Dependency Walker
(www.dependencywalker.com) on the resulting DLL to see the names that
actually got exported. These are the names you would have had to list in
DEF file, and update every time your class definition changes.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: DLL: .def file versus __declspec(dllexport)
    ... of just "Func" that I get when exporting with .def file. ... Historically .DEF files precede __declspecspecifier. ... name decoration. ...
    (microsoft.public.vc.language)
  • exporting classes in a DLL
    ... I am familiar with creating lean and mean WIN32 DLLS and exporting C functions via a DEF file (or cconv decorators), but I am wndering how I ...
    (microsoft.public.dotnet.languages.vc)
  • Visual Studio .NET 2003 creating DLL: problems with exports
    ... problem is that Visual Studio 6 used to create a DEF file or templates ... construct) for exporting functions, ... decided to try exporting by manually creating a .DEF file in the ... this DLL is intended for use by another, commercial, ...
    (microsoft.public.vstudio.development)
  • Visual Studio .NET 2003 creating DLL: problems with exports
    ... problem is that Visual Studio 6 used to create a DEF file or templates ... construct) for exporting functions, ... decided to try exporting by manually creating a .DEF file in the ... this DLL is intended for use by another, commercial, ...
    (microsoft.public.vstudio.general)
  • Re: another COM-Question: how to inject a type-lib into a dll?
    ... DLL project. ... a propos def file: when compiling the ... ... linker complains about the ... knowing how to serialize this. ...
    (microsoft.public.vc.atl)