I'm trying to call the WinAPI function DialogBox()
. On the Microsoft website this function is specified to be in the user32.dll. However, when tried to import this function by declaring it as function to import from a dll, the linker told me it isn't there. Then I tried to find the function with the dependency walker in C:\Windows\System32\user32.dll, but the function wasn't there. (I could see all the other fancy function literals there though.) What can be reasons for that and how can I solve the problem?
I'm using the D programming language. The windows module from the standard library does not import the complete set of functions in the WinAPI. Therefore I sometimes have to import stuff by hand.
That's accurate, there is no such function. From the WinUser32.h SDK header file:
In other words, the C preprocesor renames the function to DialogBoxParam. That's the only one you can pinvoke. Just pass a zero like the macro does.