Yes argv0, that's what I meant by returning a value to mIRC (1, 3, etc -- I didn't mean to say that 'data' has to be filled in every function).

Also, like I mentioned in my previous post, the code has slightly changed because I'm not using unicode anymore, so that's why I removed the L's from my strings. My code produces no warnings.

As for DllMain(), it's what I use to get a handle to the DLL instance, but I removed it to see if it was the problem, and it changes nothing. Window creation still fails. Once again, GetLastError() gives me nothing but a useless "0" which doesn't help me identify the problem at all.

Anyway, I really appreciate all the help you've been giving me here. If you or anyone else know why this may be happening, please post here. I'll try and mess around with it some more and see if I can get it to work.