Click here to Skip to main content
15,908,013 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalcan you give me a demo? Pin
sun_shb24-Jan-08 19:34
sun_shb24-Jan-08 19:34 
GeneralRe: can you give me a demo? Pin
Naveen24-Jan-08 20:00
Naveen24-Jan-08 20:00 
GeneralLink Errors from Imports/Exports with C++ prog importing C exports Pin
ForNow24-Jan-08 13:01
ForNow24-Jan-08 13:01 
QuestionRe: Link Errors from Imports/Exports with C++ prog importing C exports Pin
Mark Salsbery24-Jan-08 13:37
Mark Salsbery24-Jan-08 13:37 
GeneralRe: Link Errors from Imports/Exports with C++ prog importing C exports Pin
ForNow24-Jan-08 15:43
ForNow24-Jan-08 15:43 
GeneralRe: Link Errors from Imports/Exports with C++ prog importing C exports Pin
CPallini24-Jan-08 21:37
mveCPallini24-Jan-08 21:37 
GeneralRe: Link Errors from Imports/Exports with C++ prog importing C exports Pin
ForNow25-Jan-08 10:55
ForNow25-Jan-08 10:55 
GeneralRe: Link Errors from Imports/Exports with C++ prog importing C exports Pin
Mark Salsbery25-Jan-08 5:58
Mark Salsbery25-Jan-08 5:58 
ForNow wrote:
However part of the problem is that I am including the same Headers in both the C/C++


That's what you should be doing IMO. Then you only make changes in one place.
How are you handling the dllimport/dllexport difference depending on the type
of module being built...with a macro?

You should be able to form your shared header something like this:
// Define MY_DLL_BUILD when building the C DLL
//     (using Project settings/Preprocessor Definitions or compiler /D[macro] switch)

#ifdef MY_DLL_BUILD
   #define MY_IMPORTEXPORT __declspec(dllexport)
#else
   #define MY_IMPORTEXPORT __declspec(dllimport)
#endif


#ifdef __cplusplus
extern "C" {
#endif

// Declare an imported/exported function
MY_IMPORTEXPORT void SomeFunction();

#ifdef __cplusplus
}
#endif

Note that's a simplified solution. You may need more for certain
types of builds.

Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Link Errors from Imports/Exports with C++ prog importing C exports Pin
ForNow25-Jan-08 10:53
ForNow25-Jan-08 10:53 
GeneralGDI+ RectF constructor Pin
bob1697224-Jan-08 9:34
bob1697224-Jan-08 9:34 
GeneralRe: GDI+ RectF constructor Pin
Mark Salsbery24-Jan-08 9:41
Mark Salsbery24-Jan-08 9:41 
GeneralRe: GDI+ RectF constructor Pin
bob1697224-Jan-08 9:57
bob1697224-Jan-08 9:57 
GeneralRe: GDI+ RectF constructor Pin
bob1697224-Jan-08 9:59
bob1697224-Jan-08 9:59 
GeneralRe: GDI+ RectF constructor Pin
Mark Salsbery24-Jan-08 10:01
Mark Salsbery24-Jan-08 10:01 
GeneralRe: GDI+ RectF constructor Pin
bob1697224-Jan-08 10:08
bob1697224-Jan-08 10:08 
QuestionAFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
Wes Jones24-Jan-08 9:09
Wes Jones24-Jan-08 9:09 
AnswerRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
David Crow24-Jan-08 9:22
David Crow24-Jan-08 9:22 
GeneralRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
Wes Jones24-Jan-08 9:41
Wes Jones24-Jan-08 9:41 
GeneralRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
David Crow24-Jan-08 9:45
David Crow24-Jan-08 9:45 
GeneralRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
Wes Jones24-Jan-08 11:05
Wes Jones24-Jan-08 11:05 
AnswerRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
Mark Salsbery24-Jan-08 9:52
Mark Salsbery24-Jan-08 9:52 
GeneralRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
led mike24-Jan-08 10:19
led mike24-Jan-08 10:19 
GeneralRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
Mark Salsbery24-Jan-08 10:26
Mark Salsbery24-Jan-08 10:26 
GeneralRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
led mike24-Jan-08 10:52
led mike24-Jan-08 10:52 
GeneralRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
Mark Salsbery24-Jan-08 11:01
Mark Salsbery24-Jan-08 11:01 

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.