Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > C++ DLL and C main program

Reply
Thread Tools

C++ DLL and C main program

 
 
Toondalis
Guest
Posts: n/a
 
      11-14-2003
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
 
Reply With Quote
 
 
 
 
Ekkehard Morgenstern
Guest
Posts: n/a
 
      11-14-2003
Hi Seewan,

"Toondalis" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed) 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
the initialization of the main program and its loading DLL blackbiscuit C++ 4 11-12-2008 03:10 PM
Why does Ruby use both tcl83.dll and tk83.dll (instead of just tk83.dll)? H. Simpson Ruby 4 08-03-2004 04:45 PM
Mix C++ DLL with C main program Toondalis C Programming 1 11-14-2003 06:36 PM
msvcrt.dll, msvcirt.dll, msvcrt20.dll and msvcrt40.dll, explanation please! Snoopy NZ Computing 16 08-25-2003 12:34 PM



Advertisments