Click here to Skip to main content
15,910,277 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to access Cell Phone (ie: Nokia) via Irda from PC ? Pin
cofst26-Dec-03 16:17
cofst26-Dec-03 16:17 
GeneralRe: How to access Cell Phone (ie: Nokia) via Irda from PC ? Pin
cofst28-Dec-03 20:50
cofst28-Dec-03 20:50 
GeneralRe: How to access Cell Phone (ie: Nokia) via Irda from PC ? Pin
Peter Molnar29-Dec-03 9:52
Peter Molnar29-Dec-03 9:52 
GeneralRe: How to access Cell Phone (ie: Nokia) via Irda from PC ? Pin
cofst4-Jan-04 16:14
cofst4-Jan-04 16:14 
GeneralRe: How to access Cell Phone (ie: Nokia) via Irda from PC ? Pin
Peter Molnar4-Jan-04 18:41
Peter Molnar4-Jan-04 18:41 
GeneralCalling C++ code from C Pin
peterchen16-Dec-03 22:04
peterchen16-Dec-03 22:04 
GeneralRe: Calling C++ code from C Pin
Prakash Nadar16-Dec-03 23:49
Prakash Nadar16-Dec-03 23:49 
GeneralRe: Calling C++ code from C Pin
peterchen17-Dec-03 8:12
peterchen17-Dec-03 8:12 
Sorry for the late reply - I got it working.
Error was function not found at linkage.

Found out that in a .cpp file, you can call CPP stuff even in an funciton that is declared extern "C"

So things look like this:
// .h -------
// C++ declarations
#ifdef __cplusplus
class CFoo { ... };

#endif

// C Declarations
#ifdef __cplusplus
extern "C" {
#endif
void * FooCreate();
int FoFoo(void *);
#ifdef __cplusplus
} // extern "C"
#endif

// ---- .cpp ----------
CFoo * CFoo::CreateInstance() { ... };
int CFoo::Foo() { ... }

extern "C" void * FooCreate() { return (void *) CFoo::CreateInstance(); }
extern "C" int FooFoo(void * f) { return ((CFoo *)f)->Foo(); }


Cool!

I'm not sure if this is a VC6 only thing - but that shouldn't hurt me much


Flirt harder, I'm a coder.

mlog || Agile Programming | doxygen

GeneralRe: Calling C++ code from C Pin
Anthony_Yio17-Dec-03 0:39
Anthony_Yio17-Dec-03 0:39 
GeneralRe: Calling C++ code from C Pin
John M. Drescher17-Dec-03 4:21
John M. Drescher17-Dec-03 4:21 
GeneralRe: Calling C++ code from C Pin
Prakash Nadar17-Dec-03 16:03
Prakash Nadar17-Dec-03 16:03 
GeneralRe: Calling C++ code from C Pin
Dinesh Ahuja17-Dec-03 16:45
Dinesh Ahuja17-Dec-03 16:45 
Generalid3 tag for wma file Pin
qdping16-Dec-03 22:01
qdping16-Dec-03 22:01 
GeneralDerived CFrameWnd and attaching a View with it. Pin
Dinesh Ahuja16-Dec-03 21:59
Dinesh Ahuja16-Dec-03 21:59 
GeneralI really need help here! guru plz help Pin
YaronNir16-Dec-03 21:48
YaronNir16-Dec-03 21:48 
GeneralRe: I really need help here! guru plz help Pin
sam India16-Dec-03 22:06
sam India16-Dec-03 22:06 
GeneralRe: I really need help here! guru plz help Pin
YaronNir16-Dec-03 22:13
YaronNir16-Dec-03 22:13 
GeneralRe: I really need help here! guru plz help Pin
sam India16-Dec-03 22:48
sam India16-Dec-03 22:48 
GeneralRe: I really need help here! guru plz help Pin
YaronNir16-Dec-03 22:54
YaronNir16-Dec-03 22:54 
GeneralRe: I really need help here! guru plz help Pin
sam India16-Dec-03 23:58
sam India16-Dec-03 23:58 
GeneralRe: I really need help here! guru plz help Pin
YaronNir17-Dec-03 1:10
YaronNir17-Dec-03 1:10 
GeneralProblems recompiling under VC.Net Pin
James Spibey16-Dec-03 21:32
James Spibey16-Dec-03 21:32 
GeneralRe: Problems recompiling under VC.Net Pin
Prakash Nadar16-Dec-03 21:42
Prakash Nadar16-Dec-03 21:42 
Generalmany if else if Pin
Jerome Conus16-Dec-03 21:23
Jerome Conus16-Dec-03 21:23 
GeneralRe: many if else if Pin
jhwurmbach16-Dec-03 21:32
jhwurmbach16-Dec-03 21:32 

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.