Visit Mozilla.org

Talk:Compiling The npruntime Sample Plugin in Visual Studio

From MDC

Useful preprocessor definitions list. Had a similar problem with the basic plugin. Care to explain where you dugg the whole list from? Are you positive all of those are needed?


July 25, 2008 These instructions work for the Platform SDK (Visual studio 2003 , Visual studio 2005 full version). In visual Studio 2005 express or any Visual Studio 2008 product where the Windows SDK has replaced the Platform SDK, you will get a build error;"fatal error # RC 1015cannot open include file 'afxres.h'". (This header file is listed as an include in one of the cpp files). I looked everywhere for this file and found an article that stated this file was intentionally omitted from any express edition of Visual Studio. The only workaround the article mentioned was to replace any reference to afxres.h with windows.h http://community.livejournal.com/relisoft/14930.html. The only other issue I found was that Microsoft has depreciated strcpy which is a method called about 5 times in plugin.cpp You just have to turn off the warning. The new function takes three parameters instead of two. "#pragam(disable : error num)" the only other problem I ran into was there was a draw method that is called in plugin.cpp around line 755 or so. It has 5 params. It was complaining on param 2 that it was expecting a 16bit pointer and not the 32 bit pointer to it, so I casted it with the variable name LPCWSTR.

Alot of work for an empty project build, but it worked! P.S. The article also mentioned switching to windows.h could have other negative ramifications. I guess I'll see.

Mike