By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,804 Members | 1,634 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,804 IT Pros & Developers. It's quick & easy.

C++ DLL and C main program

P: n/a
I am now extending a Program that is written in C thru DLL. The Main
program will call functions in my DLL . The problem is that i wanted
to write my extenstion in C++ instead of C , How can it be done?

thanks

seewan
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Seewan,

"Toondalis" <se****@surreal.com.sg> schrieb im Newsbeitrag
news:49**************************@posting.google.c om...
I am now extending a Program that is written in C thru DLL. The Main
program will call functions in my DLL . The problem is that i wanted
to write my extenstion in C++ instead of C , How can it be done?


That's simple. You just encapsulate the block with API functions in an "
extern "C" { ... } " block. :-)

Or declare only the APIs as having C linkage:

extern "C" void __declspec(dllexport) MyGreatAPIFunction( void*
argument ) {
// do C++ stuff
}

I hope that helps! :-)

regards,
Ekkehard Morgenstern.
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.