Loading a menu resource from a dll
Posted on 2002-06-28
Well, it's Friday and it's late, and my thinking is not getting better, so I thought I might as well post a question and call it a day.
I have defined a simple menu within a window. Previously, my window class was the main application and was compiled to an executable. At that time, the menu showed up fine, no problems. However, I recently made a dll out of it and use it from another main application. All non-resource based code is still perfectly fine, but the menu is nowherre to be seen.
I made a small test project to test my hypothesis that it truly is some problem with the code finding the resource when it is a dll, and it turned out the same way. If I run it as a single executable, the menu works fine, but when I make a dll out of it and try to access it as a dll, the menu won't load (LoadMenu returns 0, which is a good indication that something is not quite right).
Does anybody know what I'm doing wrong? The menu is the only resource in my entire project, but I suspect I'd have problems with any type of resource. I guess I've really messed up at some point...
Any help is greatly appriciated!