Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

DLL Member Functions

BhavikattiBhavikatti Member Posts: 1
Hi Group

I have a dll having a MFC class and class member functions.I have created a interface function which will create the object of the class and return the pointer to the object.This interface function is called from client application (Another MFC App exe project)using loadlibrary and getproc address and then to cretae the required object of the class on the client side.So far so good.

But How can I access the member functions of the object ,,,,if I try to access the member functions ,I get a Linker error error LNK2001...

The code running on clent side is something like this


/* Call to load the XML library */
xLibraryHandle=LoadLibrary("StandAloneDll.dll");
// If the load failed //
if(xLibraryHandle == NULL)
{
temp = false;
}
ptr = (fncptr)GetProcAddress(xLibraryHandle,"GetInstance");

if (ptr == NULL)
{
temp = false;
}

obj = static_cast< XML_PARSER* >(ptr());


/* The below line generates link error */
temp = obj->Load_XML_Document(strt);
/* ERROR */

I have added GetInstance and Load_XML_Document as export functions on dll code side.

I dont want load the function "Load_XML_Document" using getproc.

Please suggest me some method to invoke the class's object functions from client code...

Anand
Sign In or Register to comment.