How can i create a DLL in C++ (any complier) and use it in both C++/assembler
How to create a dll that can "export" structures?

say i write this struct in C++


struct str1 {
int Var1;
int Var2;
};


how can i use it in assembler?

How can i use this function in my dll without using "LoadLibrary" and "GetProcAdress" ?
like with the WinAPI functions?

hope you understand anything of this :tongue:
Posted on 2003-12-27 15:01:52 by bj1500
You can't really export a structure, because a structure does not really exist - its just a definition for the compiler. Remember that a structure does not produce any data, it just describes the way data is arranged. You'll need to define them again, so anyway to answer your question, if u wanna use the same structure in asm,
struct str1 {
int Var1;
int Var2;
};

becomes

str1 struct
Var1 DWORD ?
Var2 DWORD ?
str1 ends

(since an integer is merely a DWORD)

As for using DLL functions from asm, please use the search facility on this board.
Theres NO difference, asm can call DLL functions written in c++, and vice versa, the only time things get more complicated is when the DLL isnt really a DLL but a COM object, they are very common in VB.
Have a nice day :)
Posted on 2003-12-27 15:11:20 by Homer
bj1500,

If you want to create a DLL supporting asm code, be carefull with the function naming conventions.
Posted on 2003-12-28 03:23:52 by Vortex