Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3042

ATL and MFC mixture and linker errors

$
0
0
Hello I hope someone here can help me. I have to update an old test tool with CPPUnit which includes some classes that are rewritten. The new classes use the ATL Libary so CStrings are in real CAtlStrings. The old Test classes use MFC. In the most cases I managed to find a way to make it work togeter but now I got to a problem where I don't know how to solve it.

In the new class, which shall be tested, I have a method like this:
Code:

void CMyProtocolItem::SetSystemID (CString strSystemID)
The used CString in this class is from ATL and defined with:
Code:

typedef CAtlString CString;
I'm not allowed to change anything in this class.

Then I have my test class which uses this class. This Testclass is defined with:

Code:

class MyTestClass : CWinThread
{

}

It has a message map and everything and in one method is is calling SetSystemID from CMyProtocolItem.

Now I have the problem, since this TestClass is from CWinThread it has all the MFC includes so CString is not the same CString like in CMyProtocolItem which caused the linker error 2019.

I thought I just could create a variable from type CAtlString in MyTestClass and give this one to SetSystemID when I call it but I still get a linker error 2019 unresolved external symbol.

What could I do wrong?

Viewing all articles
Browse latest Browse all 3042

Trending Articles