Yes, every call needs to "return" control back to mIRC, but that doesn't mean you need to fill `data`. See /help dll support for the other return values you can use.

The fact that CreateWindowEx "fails" means that your problem has little to do with your message loop, and you're simply not creating the window properly. There's a lot of possible failure points, so I can't tell you what you're doing wrong, but I would suggest doing a clean build and being vigilant about any compiler WARNINGS you may get. Specifically, if you're using a unicode build (which afaik is default in vs2010), the compiler will expect wide strings, not regular ones.. in other words, you're passing in "Window Title" when you should actually be passing in L"Window Title" (with the L prefix). Same goes for wsprintf and MessageBox. I think this was alluded to above in this thread. Again, this depends on your build settings, but the compiler should warn you.

Also note that you should not have a DllMain entry point.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"