|
-
May 5th, 2002, 12:01 PM
#1
Mixing C and C++
I want to write a Macromedia Dreamweaver extension dll. Name mangling requires me to have parts of the source in a plain C module. I need access to C++ functions from there. How would I go about it?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
May 5th, 2002, 12:13 PM
#2
Ok, I found out. I can write C stubs in the cpp files by preceding them with extern "C".
Weird, I always thought this works only for declarations...
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
May 5th, 2002, 12:27 PM
#3
Monday Morning Lunatic
extern "C" works for everything, since a C++ compiler understands both C and C++ linking methods.
As a result, you could have an overloaded function called in two different ways from an exported C function
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 5th, 2002, 12:29 PM
#4
I would discard the C module if there wasn't for this big macro that expands to a complete function...
Did you know that even variable names (at least of globals) are mangled?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
May 5th, 2002, 12:30 PM
#5
Monday Morning Lunatic
I was under the impression that everything that resolved to a linker symbol got mangled 
Not so sure why variable names are mangled, but I suppose there was a good reason for it at the time...
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|