Click here to Skip to main content
15,909,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Calling global function causing linking error. Pin
Comp_Users10-Feb-09 3:40
Comp_Users10-Feb-09 3:40 
AnswerRe: Calling global function causing linking error. Pin
prasad_som10-Feb-09 3:41
prasad_som10-Feb-09 3:41 
GeneralRe: Calling global function causing linking error. Pin
Comp_Users10-Feb-09 3:54
Comp_Users10-Feb-09 3:54 
GeneralRe: Calling global function causing linking error. Pin
Cedric Moonen10-Feb-09 4:11
Cedric Moonen10-Feb-09 4:11 
GeneralRe: Calling global function causing linking error. Pin
CPallini10-Feb-09 3:49
mveCPallini10-Feb-09 3:49 
GeneralRe: Calling global function causing linking error. Pin
Comp_Users10-Feb-09 3:55
Comp_Users10-Feb-09 3:55 
GeneralRe: Calling global function causing linking error. Pin
David Crow10-Feb-09 5:03
David Crow10-Feb-09 5:03 
AnswerRe: Calling global function causing linking error. Pin
Iain Clarke, Warrior Programmer10-Feb-09 5:54
Iain Clarke, Warrior Programmer10-Feb-09 5:54 
Others have beaten you over the head with it, so I'll join in. You DON'T include cpp files - you include headers.

Try:
// TrimMyString.h
extern CString TrimMyString (CString s);    // this will be included everywhere you need it. Note the extern.

// TrimMyString.cpp
#include "stdafx.h"  // I assume you're using VC++, in which you'll likely need this
#include "TrimMyString.h"

CString TrimMyString (CString s)
{
   do stuff with the string...
   return s;
}

// somefile.cpp
#include "stdafx.h"  // I assume you're using VC++, in which you'll likely need this
#include <some.h>
#include "Other.h"
#include "TrimMyString.h"  // <-- the important one!

BOOL SomeFunction ()
{
   s = "    Hello   ";
   s = TrimMyString (s);
   return TRUE;
}
</some.h>


I hope that made a little sense,

Iain.

Codeproject MVP for C++, I can't believe it's for my lounge posts...

GeneralRe: Calling global function causing linking error. Pin
Comp_Users10-Feb-09 18:25
Comp_Users10-Feb-09 18:25 
GeneralRe: Calling global function causing linking error. Pin
Comp_Users10-Feb-09 18:36
Comp_Users10-Feb-09 18:36 
QuestionCalling C# DLL into core C++ Console application [modified] Pin
PankajB10-Feb-09 2:09
PankajB10-Feb-09 2:09 
AnswerRe: Calling C# DLL into core C++ Console application Pin
led mike10-Feb-09 4:30
led mike10-Feb-09 4:30 
AnswerRe: Calling C# DLL into core C++ Console application Pin
Eytukan10-Feb-09 8:43
Eytukan10-Feb-09 8:43 
QuestionHow to update single view Pin
KASR110-Feb-09 2:04
KASR110-Feb-09 2:04 
AnswerRe: How to update single view Pin
Maximilien10-Feb-09 2:43
Maximilien10-Feb-09 2:43 
AnswerRe: How to update single view Pin
David Crow10-Feb-09 3:00
David Crow10-Feb-09 3:00 
QuestionWinAPI Service StartServiceCtrlDispatcher gives Error-Code "1063" Pin
Harry_D10-Feb-09 0:37
Harry_D10-Feb-09 0:37 
AnswerRe: WinAPI Service StartServiceCtrlDispatcher gives Error-Code "1063" [modified] Pin
_AnsHUMAN_ 10-Feb-09 0:48
_AnsHUMAN_ 10-Feb-09 0:48 
GeneralRe: WinAPI Service StartServiceCtrlDispatcher gives Error-Code "1063" Pin
Harry_D10-Feb-09 6:21
Harry_D10-Feb-09 6:21 
AnswerRe: WinAPI Service StartServiceCtrlDispatcher gives Error-Code "1063" Pin
BukeMan6-Jul-11 0:08
BukeMan6-Jul-11 0:08 
QuestionHow to add and retrive the LPARAM value from CTreeCtrl? Pin
mikert_20089-Feb-09 23:22
mikert_20089-Feb-09 23:22 
AnswerRe: How to add and retrive the LPARAM value from CTreeCtrl? Pin
CPallini9-Feb-09 23:44
mveCPallini9-Feb-09 23:44 
GeneralRe: How to add and retrive the LPARAM value from CTreeCtrl? Pin
mikert_200810-Feb-09 0:01
mikert_200810-Feb-09 0:01 
GeneralRe: How to add and retrive the LPARAM value from CTreeCtrl? Pin
CPallini10-Feb-09 0:37
mveCPallini10-Feb-09 0:37 
AnswerRe: How to add and retrive the LPARAM value from CTreeCtrl? Pin
Code-o-mat10-Feb-09 0:37
Code-o-mat10-Feb-09 0:37 

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.