Click here to Skip to main content
15,901,283 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: XP-Style selection-rectangle Pin
Luy24-Jun-05 8:46
Luy24-Jun-05 8:46 
GeneralRe: XP-Style selection-rectangle Pin
Blake Miller24-Jun-05 10:19
Blake Miller24-Jun-05 10:19 
GeneralRe: XP-Style selection-rectangle Pin
Luy25-Jun-05 1:56
Luy25-Jun-05 1:56 
GeneralRe: XP-Style selection-rectangle Pin
Blake Miller27-Jun-05 4:17
Blake Miller27-Jun-05 4:17 
GeneralRe: XP-Style selection-rectangle Pin
Luy27-Jun-05 6:15
Luy27-Jun-05 6:15 
GeneralProblem with mixed code of C and C++ Pin
prgr24-Jun-05 3:41
prgr24-Jun-05 3:41 
GeneralRe: Problem with mixed code of C and C++ Pin
Chris Losinger24-Jun-05 5:10
professionalChris Losinger24-Jun-05 5:10 
GeneralRe: Problem with mixed code of C and C++ Pin
Jose Lamas Rios24-Jun-05 9:04
Jose Lamas Rios24-Jun-05 9:04 
prgr wrote:
Can anyone gimme an idea,how to deal with this?

You need to use extern to Specify Linkage[^]

Here's an example:

////////////////////////////////////
// cFunctions.h
 
#ifdef __cplusplus
extern "C" {
#endif
 
// Functions declared here can be used both
// in C and C++ code
 
int c_func_in_c_file(int someParm);
int c_func_in_c_file2();
 
#ifdef __cplusplus
}
#endif
 
 
////////////////////////////////////
// cFunctions.c
 
#include "cFunctions.h"
#include "cppFunctions.h"
 
int c_func_in_c_file(int someParm)
{
   return someParm + c_func_in_cpp_file();
}
 
int c_func_in_c_file2()
{
   return 42;
}
 
 
/////////////////////////////////////
// cppFunctions.h
 
#ifdef __cplusplus
extern "C"
{
#endif
 
// Functions declared here can be used both
// in C and C++ code
 
int c_func_in_cpp_file();
 
#ifdef __cplusplus
}
 
// Functions declared here can only be used
// in C++ code
 
int cpp_func_in_cpp_file();
 
#endif
 
 
/////////////////////////////////////
// cppFunctions.cpp
 
#include "cppFunctions.h"
#include "cFunctions.h"
 
extern "C" int c_func_in_cpp_file()
{
   return cpp_func_in_cpp_file() + c_func_in_c_file2();
}
 
int cpp_func_in_cpp_file()
{
   return c_func_in_c_file2();
}


--
jlr
http://jlamas.blogspot.com/[^]
GeneralData Scaling Pin
sweep12324-Jun-05 3:36
sweep12324-Jun-05 3:36 
GeneralRe: Data Scaling Pin
Budric B.24-Jun-05 5:35
Budric B.24-Jun-05 5:35 
GeneralRe: Data Scaling Pin
Grahamfff24-Jun-05 9:11
Grahamfff24-Jun-05 9:11 
GeneralRe: Data Scaling Pin
liquid_24-Jun-05 9:12
liquid_24-Jun-05 9:12 
GeneralRe: Data Scaling Pin
Grahamfff25-Jun-05 0:03
Grahamfff25-Jun-05 0:03 
GeneralRe: Data Scaling Pin
liquid_26-Jun-05 9:55
liquid_26-Jun-05 9:55 
Generalcasync socket Pin
_tasleem24-Jun-05 3:25
_tasleem24-Jun-05 3:25 
GeneralRe: casync socket Pin
Ravi Bhavnani24-Jun-05 4:44
professionalRavi Bhavnani24-Jun-05 4:44 
GeneralRe: casync socket Pin
Alexander M.,24-Jun-05 10:33
Alexander M.,24-Jun-05 10:33 
GeneralUnique number generation Pin
Hmmkk24-Jun-05 3:13
Hmmkk24-Jun-05 3:13 
GeneralRe: Unique number generation Pin
David Crow24-Jun-05 3:51
David Crow24-Jun-05 3:51 
GeneralRe: Unique number generation Pin
Hmmkk24-Jun-05 4:04
Hmmkk24-Jun-05 4:04 
QuestionMFC and Internet ?? Pin
Rookieee24-Jun-05 3:09
sussRookieee24-Jun-05 3:09 
AnswerRe: MFC and Internet ?? Pin
David Crow24-Jun-05 3:25
David Crow24-Jun-05 3:25 
AnswerRe: MFC and Internet ?? Pin
Ravi Bhavnani24-Jun-05 4:49
professionalRavi Bhavnani24-Jun-05 4:49 
GeneralRe: MFC and Internet ?? Pin
Eytukan24-Jun-05 5:29
Eytukan24-Jun-05 5:29 
GeneralRe: MFC and Internet ?? Pin
Smith#24-Jun-05 5:38
Smith#24-Jun-05 5:38 

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.