The error message is fairly clear. At least one of your files (if not your whole project) is set to compile with /clr. You're using a .NET type in a native construtor or inside of DllMain, which is not allowed.
Try running this under a debugger - it should give you more of a clue as to where the problem is occurring. You'll need to change the .NET code to use MFC or Windows API calls, instead.
Reed Copsey, Jr. - http://reedcopsey.com
If a post answers your question, please click "
Mark As Answer" on that post and "
Mark as Helpful".