Click here to Skip to main content
16,007,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: check if external app is already running Pin
Blake Miller23-Dec-05 10:55
Blake Miller23-Dec-05 10:55 
GeneralRe: check if external app is already running Pin
ThatsAlok25-Dec-05 21:09
ThatsAlok25-Dec-05 21:09 
AnswerRe: check if external app is already running Pin
ThatsAlok25-Dec-05 22:47
ThatsAlok25-Dec-05 22:47 
GeneralRe: check if external app is already running Pin
elephantstar27-Dec-05 11:49
elephantstar27-Dec-05 11:49 
GeneralRe: check if external app is already running Pin
ThatsAlok27-Dec-05 22:23
ThatsAlok27-Dec-05 22:23 
GeneralRe: check if external app is already running Pin
ThatsAlok27-Dec-05 23:36
ThatsAlok27-Dec-05 23:36 
GeneralRe: check if external app is already running Pin
ThatsAlok27-Dec-05 23:38
ThatsAlok27-Dec-05 23:38 
QuestionVisual Studio 2005: Problems with Dynamic Library using CString Pin
Mr. Accident23-Dec-05 8:41
Mr. Accident23-Dec-05 8:41 
I'm using Visual Studio 2005. I'm trying to create a dynamic library for my MFC application. This library uses MFC via shared DLL and exports a class that contains functions using CString objects.

For example, I constructed a simplified library like so:

<code>#ifdef TEST_EXPORTS
#define TEST_API __declspec(dllexport)
#else
#define TEST_API __declspec(dllimport)
#endif

// This class is exported from Test.dll
class TEST_API CTest {
public:
	CString DoStuff()
	{
		return _T("This is only a test.");
	}
};


Simple enough, right? But whenever I try to link my application to this library and use the CString-related function, I get linker errors like the following:

error LNK2019: unresolved external symbol "__declspec(dllimport) public: class ATL::CStringT<unsigned short,class ATL::StrTraitATL<unsigned short,class ATL::ChTraitsCRT<unsigned short> > > __thiscall CTestClass::DoStuff(void)" (__imp_?DoStuff@CTestClass@@QAE?AV?$CStringT@GV?$StrTraitATL@GV?$ChTraitsCRT@G@ATL@@@ATL@@@ATL@@XZ) referenced in function ....


I came across this article on Codeproject, wherein Nick Pirocanac recommends using CAtlString in the library instead of CString, but it was writen for Visual C++ 7, and it seemed to be addressing problems with ATL-based libraries and applications. I tried Nick's methods anyway, and they didn't seem to work.

I just recently migrated to Visual Studio 2005 from version 6, and of course this library worked just fine back then, before CString was template-ized. Now, the strange thing is that this problem doesn't seem to occur when I do a Release build. I scanned through the configurations, but I'm fairly new to VS8 and I couldn't find any difference between the configurations that would cause this.

Has anyone had similar problems, and more importantly, does anyone know how to fix this? I get the feeling it's something simple and obvious that will make me feel very stupid when it's explained, but I just have no clue right now. Any help would be most appreciated. Smile | :)

[Insert witty and relevant signature here]
AnswerWhy yes, I DO feel stupid today. Pin
Mr. Accident23-Dec-05 14:40
Mr. Accident23-Dec-05 14:40 
GeneralRe: Why yes, I DO feel stupid today. Pin
Gary R. Wheeler24-Dec-05 2:44
Gary R. Wheeler24-Dec-05 2:44 
GeneralRe: Why yes, I DO feel stupid today. Pin
Owner drawn26-Dec-05 17:30
Owner drawn26-Dec-05 17:30 
QuestionHow to use Win API: CreateProcess ? Pin
df669923-Dec-05 5:52
df669923-Dec-05 5:52 
AnswerRe: How to use Win API: CreateProcess ? Pin
Office Lineman23-Dec-05 7:18
Office Lineman23-Dec-05 7:18 
AnswerRe: How to use Win API: CreateProcess ? Pin
ThatsAlok26-Dec-05 17:46
ThatsAlok26-Dec-05 17:46 
QuestionHelp Connecting a unconnected Network-Drve Pin
meinhard_risch23-Dec-05 5:36
meinhard_risch23-Dec-05 5:36 
QuestionDrop from Shell Dll - Strategy Question Pin
depotdog23-Dec-05 5:24
depotdog23-Dec-05 5:24 
QuestionRunning a console app hidden, no window Pin
Gunn31723-Dec-05 4:43
Gunn31723-Dec-05 4:43 
AnswerRe: Running a console app hidden, no window Pin
PJ Arends23-Dec-05 10:21
professionalPJ Arends23-Dec-05 10:21 
AnswerRe: Running a console app hidden, no window Pin
Michael Dunn23-Dec-05 20:28
sitebuilderMichael Dunn23-Dec-05 20:28 
GeneralRe: Running a console app hidden, no window Pin
Gunn3174-Jan-06 3:45
Gunn3174-Jan-06 3:45 
AnswerRe: Running a console app hidden, no window Pin
vipinasda24-Dec-05 7:16
vipinasda24-Dec-05 7:16 
AnswerRe: Running a console app hidden, no window Pin
Owner drawn26-Dec-05 17:27
Owner drawn26-Dec-05 17:27 
QuestionAnalyze sound volume? Pin
Matrim Cauthon23-Dec-05 3:03
Matrim Cauthon23-Dec-05 3:03 
Questionadd colors to buttons Pin
Manmohan_198323-Dec-05 2:58
Manmohan_198323-Dec-05 2:58 
AnswerRe: add colors to buttons Pin
FarPointer23-Dec-05 3:57
FarPointer23-Dec-05 3:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.