Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MFC dll export question

Status
Not open for further replies.

Wings

Programmer
Feb 14, 2002
247
US
Hello,
I'm having a difficult time implementing an MFC dll I have created.
When I attempt to use the dll in another application, I get an unresolved external linker error when I am declaring a instantiation of a new object of the dll type.

//the code is below
CSerialControl *SC = new CSerialControl();
//end code

do I need to export the constructor of the class in the dll? what about the InitInstance function?

Any help to point me in the right direction is appreciated.

Thanks.
 
Ok, I solved this problem to. Kind of. I can build the application fine now, but whenever the code executes, I get an exception.

//This is the code
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CSerialControl SC;
/////

I get an exception on this line of code in the MFC class Afxtls.cpp

ASSERT(m_pSlotData[nSlot].dwFlags & SLOT_USED);

If I just put my dll code in a class and include the class, it works fine but as soon as it goes into a dll I get problems.

Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top