D - sharing objects between dlls
- Vathix (4/4) Jun 24 2003 I would like my program to pass a class object to a function in a D dll,...
- Walter (7/11) Jun 24 2003 the
- Vathix (14/25) Jun 24 2003 I
- Patrick Down (7/12) Jun 24 2003 You don't have to compile the class code into the exe you just need to i...
- Walter (4/9) Jul 02 2003 able
I would like my program to pass a class object to a function in a D dll, I have the address of the function but I don't know how to interface it in the dll. I think it has to do with exporting the class from my exe, but I don't know how that works either. Please help, thanks.
Jun 24 2003
"Vathix" <Vathix dprogramming.com> wrote in message news:bd9q40$1kt7$1 digitaldaemon.com...I would like my program to pass a class object to a function in a D dll, I have the address of the function but I don't know how to interface it inthedll. I think it has to do with exporting the class from my exe, but Idon'tknow how that works either. Please help, thanks.Richter's book on NT programming from www.digitalmars.com/bibliography.html is essential for understanding how DLL's work and how to create and use them.
Jun 24 2003
"Walter" <walter digitalmars.com> wrote in message news:bd9s26$1mmg$4 digitaldaemon.com..."Vathix" <Vathix dprogramming.com> wrote in message news:bd9q40$1kt7$1 digitaldaemon.com...II would like my program to pass a class object to a function in a D dll,www.digitalmars.com/bibliography.htmlhave the address of the function but I don't know how to interface it inthedll. I think it has to do with exporting the class from my exe, but Idon'tknow how that works either. Please help, thanks.Richter's book on NT programming fromis essential for understanding how DLL's work and how to create and use them.I've used dlls in C many times (and C compatible D dlls), I don't think I have a problem with that. What I want here is to use it with D classes. I can't just pass my D class object to a function in a D dll and have it able to access this object, it has to know about the members and such, that's where I'm stuck. The only way I think I could do it now is to compile the class code in the exe and dll, but I don't think that's good because it's wasting space (and defeats the purpose of exporting a class ?) and it's not guaranteed to have the same memory layout (class.html "The D compiler is free to rearrange the order of fields in a class"...).
Jun 24 2003
In article <bd9ukm$1p00$1 digitaldaemon.com>, Vathix says...The only way I think I could do it now is to compile the class code in the exe and dll, but I don't think that's good because it's wasting space (and defeats the purpose of exporting a class ?) and it's not guaranteed to have the same memory layout (class.html "The D compiler is free to rearrange the order of fields in a class"...).You don't have to compile the class code into the exe you just need to import it. The rearranging is an interesting issue but any given D compiler from a vendor will layout a class in the same way across compiles. Even obj files would have an issue if this were not true. Perhaps between D compiler vendors some sort of statndard can be determined to make class layouts the same.
Jun 24 2003
"Vathix" <Vathix dprogramming.com> wrote in message news:bd9ukm$1p00$1 digitaldaemon.com...I've used dlls in C many times (and C compatible D dlls), I don't think I have a problem with that. What I want here is to use it with D classes. I can't just pass my D class object to a function in a D dll and have itableto access this object, it has to know about the members and such, that's where I'm stuck.Just import the module in the source code to the DLL, but don't link it in.
Jul 02 2003