четвер, 3 грудня 2009 р.

How to call NPN functions in NPAPI plugin

For every NPN function used like NPN_GetValue, NPN_Evaluate, NPN_ReleaseVariantValue etc. one has to write a wrapper. First of all we need to save pointer to NPNetscapeFuncs* which is passed to NP_Initalize:

NPNetscapeFuncs* npnfuncs;
NPError NP_Initialize(NPNetscapeFuncs *npnf) {
npnfuncs = npnf;
}

Then we need to write a wrapper for each function. Here goes an example for NPN_GetValue, NPN_Evaluate, NPN_ReleaseVariantValue:
/* Wrappers for NPN functions */

NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable, void *value)
{
return npnfuncs->getvalue(instance, variable, value);
}

bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script,
NPVariant *result)
{
return npnfuncs->evaluate(npp, npobj, script, result);
}

void NPN_ReleaseVariantValue(NPVariant *variant)
{
npnfuncs->releasevariantvalue(variant);
}

The procedure entry point ?_Xfunc@tr1@std@@YAXXZ could not be located in the dynamic library MSVCP90D.dll

If you ever see the message "The procedure entry point ?_Xfunc@tr1@std@@YAXXZ could not be located in the dynamic library MSVCP90D.dll" from the program, then one of the solutions is to install the Visual Studio 2008 Service Pack 1. First try installing redistributable version (~4MB) and if this won't help, then try downloading the full version (~800 MB). This bug is caused by mistake from Microsoft which may not be seen on developer's machine, but may appear on client running the software.

If you want to download full installer and install it on machine where there is no access to Internet, then you should better use offline installer.

середа, 6 травня 2009 р.

An Inconvinient Truth

Just watched this movie. It's about global warming, which everybody is talking about. Before watching the movie I simply didn't think about it much. But this movie changed it all. It's not like any other movie about global warming, but rather a good . So I would recommend everybody to watch it. It's just 1,5 hours of your time but it can make the world better.