Link to home
Start Free TrialLog in
Avatar of jhattingh
jhattingh

asked on

MFC DLL Primer

Having created an (shared) MFC DLL Project using MSVC++ app wizard, I now want to implement a function that takes a string argument.

This dll will be called from a VB app, so I am also unsure as to whether the function declaration should be using VARIANTS...
ASKER CERTIFIED SOLUTION
Avatar of inpras
inpras

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jhattingh
jhattingh

ASKER

It looks useful, but may I ask why the function is notmadeamember of the C...App class created by AppWizard?
Hi !!!
   Yes inpras is right.
If u want to export the class itself then u can make it member function of App class and export the class itself or just export the required function.
Hi
Make it a member function no problem
like
CDllStaticTextApp::ExportedFunction(LPSTR str)
{
}

in .h file declaration
      __declspec(dllexport) ExportedFunction(LPSTR str);

Hope this helps
Regards