I have a D DLL loaded by a C ++ program that I have no control over. The LoadLibrarys program is my DLL and uses GetProcAddress to search for a function called "extension_load" that takes one argument (pointer). In my D DLL, I have:
extern (C) int extension_load(void* ptr) { return 0; }
And this name needs to be exported as extension_load, but it is exported as extension_load @ 4, so GetProcAddress cannot find it. How to make this simple extension_load without changing the name?
.def, . Docs , .
Hans Passant. .def , (, ):
EXETYPE NT EXPORTS extension_load DllMain
.def, , dll.def. , :
extern (C++) int extension_load(void* ptr) {
IDE - D-IDE, , def, Project > Properties > Build Options
nameofdef.def
" ". , nameofdef.def D-IDE.
def. export, :
export
export extern (C) int extension_load(void* ptr) { return 0; }
: dmd -ofmydll.dll mydll.d. , DllMain().
dmd -ofmydll.dll mydll.d
DllMain()
Source: https://habr.com/ru/post/1779858/More articles:Should I download a test website? How? - performanceBest way to generate global ViewData? - c #Java vs C ++: performance in an application using web services - javaКак заменить URL-адреса в отображаемом HTML с помощью ASP.NET MVC ActionFilter - asp.net-mvcWhat is the canonical approach to data transfer in jQuery UI Dialogue? - javascriptFlash-строитель (Flex) - скрыть элемент пользовательского интерфейса - flexdelphi, respond to copy action or execute paste - delphiRewriting MVC application style - javaMySQL, word search from one line to another line - sqlC ++ Reduce memory page size from 4096 bytes - c ++All Articles