October 5th, 2011, 02:49 PM
Multiple instances of WindowProc across multiple DLLs
I am writing an experimental application where the window creation process (i.e. WNDCLASSEXA setup, RegisterClassEx, and CreateWindow) are called in a class object and the entire module is complied into a static library.
I then created a DirectX class in another module that is complied into a DLL format, passing in the hWnd to it for its initialization and internal use. The DLL has dependance set and is linked to static library containing the windows class object.
The problem I am having is when I create my main application which also links to static library, and load the dll for directx, and put a break point in the WindowProc, and grab the debugger line indicator to move to another line, a box pops-up showing me 2 options for the WindowProc function, one in the main.exe application and one in the directx.dll. Selecting the directx option pops-up a message box stating I am now looking into a different function. I understand, to some extent what is going on, as the dll is looking at its own version of the function loaded into it, but not sure how to over come it.
Any thoughts on what I am doing wrong? Any way to have a single instance of WindowProc shared between a .exe and associated loaded .dlls?
Any input, ideas, references would be appreciated. Let me know if my question and context are too vague.
October 5th, 2011, 03:55 PM
Re: Multiple instances of WindowProc across multiple DLLs
While writing my original post I noticed something, which is, I am linking the lib with the static definition for WndProc to the main app.exe and the loaded .dll projects. This could be the cause for each dll having its own copy of the function. Not sure though as I am new to using non-MFC dlls, but will see if that is the cause.
if anyone still has some clues/ideas to whats going on, or if my assumption is right/wrong, please do reply.
Click Here to Expand Forum to Full Width