Correct. I definitely agree. :D ;) :thumb:Quote:
Originally Posted by RoboTact
Printable View
Correct. I definitely agree. :D ;) :thumb:Quote:
Originally Posted by RoboTact
I may be completly wrong but i think you have to write DLL's in C? no?
Rich
no. :)Quote:
Originally Posted by Rich2189
Because there is value in combining data and functions together into "objects". And some of the simpler concepts from OOP, like inheritance and polymorphism, can be implemented in assembly and other languages quite easily, and is just as beneficial as it is in a C++ project. But if the project requires more advanced OOP techniques like multiple inheritance or exception stack unwinding, then of course C++ is clearly a better choice.Quote:
Originally Posted by PadexArt
Some target systems, like an embedded microcontroller, may only have a C compiler available for it, and not a C++ compiler.Quote:
Originally Posted by NMTop40
about time someone wrote a C++ compiler for it then.Quote:
Originally Posted by microcode
I have a question related to C programming:
I'm using Actionscript to create swf animition and I need to create dll files to be accessed by swf files. C is the only language supported by Macromedia Flash as they say. Are C dlls similar to C++ dlls? I mean do programs access them in the same way and they do not know which is which? Thanks
In my opinion...
Programming in ANSI C in an OOP approach shouldn't automatically mean that the wrong language was chosen.
OOP is a better methodology in order to keep the code organized and generally make the programming much easier, but it doesn't automatically mean that you should be using a language that is designed for OOP.
In my experience, ANSI C is more portable across platforms than C++. Especially when your requirements include supporting several platforms (UNIX, Macintosh, Windows, Mainframe) and several versions of those platforms (Linux on Intel, Linux on Sparc, AIX OS circa 1993 and AIX OS circa 2002)
My primary job responsibilities include supporting, updating and improving a library of code that runs with just such requirements. ANSI C has proven to be the best solution. While there are some areas where code had to be specialized for a specific platform, in those cases it is just a few lines.
Sincerely,
Kendall Russell
Quote:
Originally Posted by PadexArt
The interface is often in C because C++ will mangle the function names.
Are you sure about this? I believe that Flash is talking about a 'C' exported interface, where the function signature of the exported DLL is a 'C' interface (no mangling). The internals of the DLL function can be written in any language, including C++.Quote:
Originally Posted by Fadel_Saraireh
Regards,
Paul McKenzie
It may also be for the mere reason that a target library is written in object oriented C, and he wants to adapt that style (which sounds like a good idea to me).
Gtk+ is perhaps the most popular example for an object oriented sofware written in a non-OO language. I prefer gtkmm though.
Paul,Quote:
Originally Posted by Paul McKenzie
These lines are taken from Macromedia Flash 8 help file:
"Advanced users can use the C-level extensibility mechanism to implement Flash extensibility files using a combination of JavaScript and custom C code. You define functions using C, bundle them in a dynamic linked library (DLL) or a shared library".
Thanks
The program that loads the DLL knows nothing about the language used to create the DLL's. If Flash loads the DLL's dynamically, then there is no way for Flash to know what language created the DLL. I should know, I've been creating DLL's for many years now that can be used by any language.Quote:
Originally Posted by Fadel_Saraireh
The only thing that may be required is that the exported function signature should be 'C' compatible, and possibly the calling convention must be either stdcall or cdecl, one or the other. After that, the internal DLL functions can be implemented in any language -- C, C++, assembler, any language that provides a 'C' exported function interface and stdcall/cdecl calling convention.
It may be easier to do it in 'C', since there are no tricks necessary to generate a 'C' function signature (for C++, you have to use the extern "C" approach, and other languages use other approaches). Probably for this reason alone, ease of setting up the DLL, is why Flash mentions 'C' and not other languages (including C++).
Regards,
Paul McKenzie
That could be a nuisance if you use the DLL through delayed loading. Otherwise you don't even feel the name mangling performed by C++.Quote:
Originally Posted by kenrus