Hi,

I define a CObject derived class called CMyClass, as follows:

class CMyClass : public CObject
{
..
}

Then I define two DLLs, DLL1.dll and DLL2.dll

DLL1.dll contains an export function called CreateMyClass, as follows:

CMyClass *CreateMyClass()
{
CMyClass *pMyClass;

pMyClass = new CMyClass;

return pMyClass;
}

DLL2.dll contains an export function called UseMyClass, as follows:

void UseMyClass(CMyClass *pMyClass)
{
if (pMyClass != NULL)
{
// Statements to use pMyClass
}
}

Then I want to build a third MFC application called MyApp.exe that will contain the following statements:

CMyClass *pMyClass;

// Invoke CreateMyClass in DLL1.dll to create a new instance of CMyClass
pMyClass = CreateMyClass();

// Invoke UseMyClass to use pMyClass
UseMyClass(pMyClass);

For MyApp.exe, DLL1.dll and DLL2.dll, I want to statically link the MFC library. Is that possible? Also are there any special requirements or attention need to pay when create and build these three projects?

Thanks