Click to See Complete Forum and Search --> : How do I list class member function exports in the def file ?


Mike Pliam
June 11th, 2009, 02:50 PM
Truely great summary.

How do I list class member function exports in the def file ?

CMyClass:: DoThis @1

or

DoThis @1

:wave:

ovidiucucu
June 12th, 2009, 04:36 AM
Please clarify what do you want to do.

[ Moved thread ]

Mike Pliam
June 12th, 2009, 12:21 PM
Is there a need to define class member functions in a DLL def file? If so, what is the proper syntax. Say I wish to export 2 'C' functions, void func1() and void func2(), and a class, MyClass, with 2 functions, say int MyClass ::get(), and void MyClass:: put(int n);

in the def file, how am I supposed to list the EXPORT s

EXPORT
func1 @1
func2 @2
get @3
put @4

or simply omit the exported class definitions ?

Also, I have noticed that one cannot list EXPORT(s) of 'C' functions that have the same name as non-exported class functions. ??
What's with that ?

hoxsiew
June 13th, 2009, 01:08 PM
You probably don't want to bother with a DEF file for exported classes. Just use the "dllexport" keyword in your header file:



//Class exports
class __declspec( dllexport )MyClass
{
public:
MyClass();
~MyClass(void);
func1();
func2();
};

//non-class exports
extern "C" __declspec( dllexport ) int func1();
extern "C" __declspec( dllexport ) int func2();

wigga
June 13th, 2009, 03:29 PM
i dont know about def files. but u can read get the exports from PE headers