Ok imagine this situation
your favorite language is ofcourse asm :D
you would like to include some kewl things into your program, like XP menu, but you dont feel like spending 2 additional weeks for learning how to do that, and esspecially if you have that peace of code encapsulated in some foregin language like c++ with some foregin technology like MFC

so what are your experiences in using code created in other languages, is it possible to use code created with c++/Delphi (MFC/VCL/etc...) into asm projects. I already succeed in implementing C functions in form of .lib file into asm project, but I am thinking of C code and procedures like almost same and straighforward as asm procedures (little more bloated though :)) sequence of instructions simple as that, now when it comes to C++ with classes I just can't create picture in my mind how could I use that code within asm
Posted on 2003-04-28 18:44:28 by Mikky
Mikky,

it usually has to do with the module format of OBJ file as to what you can use from one language to another. I am too out of date with Borland TASM but with Microsoft C, as long as the names are not mangled, you can call functions written in C from MASM with no problems.

Now I guess if you want to use the C++ capacity, if you can make the access point in C without mangled names, it should work OK. You will have to ask one of the C guys on this one as I am too out of date in that area.

Regards,

hutch@movsd.com
Posted on 2003-04-28 23:57:54 by hutch--
Maybe I am wrong, but I don't think it is possible to use MFC functions from assembly directly...

Imagine a Office XP style menu thingy : the MFC will want to handle with a CMenu class or something like this, and I don't think it will accept a typical win32 HMENU handle...

If there is some ways, to do it, I would be happy to know how to do (one could put interesting MFC functions, especially in UI, into a DLL statically linked against the MFC lib, and use it like a "typical" DLL).
Posted on 2003-04-29 01:17:27 by JCP
I already succeed in implementing C functions in form of .lib file into asm project, but I am thinking of C code and procedures like almost same and straighforward as asm procedures (little more bloated though :) ) sequence of instructions simple as that, now when it comes to C++ with classes I just can't create picture in my mind how could I use that code within asm

Inline C? I doubt your idea will turn up well with c++. Not too sure about how classes are compiled. I remember reading somewhere on the forums mentioned that the ecx stores teh function address. Maybe Thomas would give you a better information on that topic.
Posted on 2003-04-30 23:57:15 by roticv
Mikky, it's "some work" to use C++ from asm. Your best bet would be creating a plain C wrapper (with `extern "C" { ... }' wrapping) around the C++, and call the C stuff from your assembly. Alternately, make the C/C++ call your own asm stuff.

As for delphi... dunno. It all comes down to name mangling, calling convention, and what parameters the delphi VCL takes. I'd guess it's hard to get something working properly, though you may be able to wrape the VCL with plain pascal.
Posted on 2003-05-01 03:08:28 by f0dder