NPP_New(NPMIMEType pluginType,
NPError NP_LOADDS NPP_New(NPMIMEType pluginType,
NPP_New(NPMIMEType pluginType,                NPP instance,                uint16 mode,                int16 argc,                char* argn[],                char* argv[],                NPSavedData* saved){	// trap a NULL ptr 	if (instance == NULL)	{		return NPERR_INVALID_INSTANCE_ERROR;	}	// Read the parameters	CLSID clsid = CLSID_NULL;	tstring szName;	tstring szCodebase;	PropertyList pl;	for (int16 i = 0; i < argc; i++)	{		if (stricmp(argn[i], "CLSID") == 0 ||			stricmp(argn[i], "CLASSID") == 0)		{			// Accept CLSIDs specified in various ways			// e.g:            //   "C16DF970-D1BA-11d2-A252-000000000000"			//   "{C16DF970-D1BA-11d2-A252-000000000000}"            //   "CLSID:C16DF970-D1BA-11d2-A252-000000000000"			char szCLSID[256];			if (strnicmp(argv[i], "CLSID:", 6) == 0)			{				char szTmp[256];				sscanf(argv[i], "CLSID:%s", szTmp);				sprintf(szCLSID, "{%s}", szTmp);			}			else if(argv[i][0] != '{')			{				sprintf(szCLSID, "{%s}", argv[i]);			}			else			{				strncpy(szCLSID, argv[i], sizeof(szCLSID));			}			USES_CONVERSION;			CLSIDFromString(A2OLE(szCLSID), &clsid);		}		else if (stricmp(argn[i], "NAME") == 0)		{			USES_CONVERSION;			szName = tstring(A2T(argv[i]));		}		else if (stricmp(argn[i], "CODEBASE") == 0)		{			szCodebase = tstring(A2T(argv[i]));		}		else if (strnicmp(argn[i], "PARAM_", 6) == 0)		{			USES_CONVERSION;			std::wstring szName(A2W(argn[i] + 6));			std::wstring szParam(A2W(argv[i]));				// Empty parameters are ignored			if (szName.empty())			{				continue;			}			// Check for existing params with the same name			BOOL bFound = FALSE;			for (PropertyList::const_iterator i = pl.begin(); i != pl.end(); i++)			{				if (wcscmp((BSTR) (*i).szName, szName.c_str()) == 0)				{					bFound = TRUE;					break;				}			}			// If the parameter already exists, don't add it to the			// list again.			if (bFound)			{				continue;			}			CComVariant vsValue(szParam.c_str());			CComVariant vIValue; // Value converted to int			CComVariant vRValue; // Value converted to real			CComVariant &vValue = vsValue;			// See if the variant can be converted to an integer			if (VariantChangeType(&vIValue, &vsValue, 0, VT_I4) == S_OK)			{				vValue = vIValue;			}			else if (VariantChangeType(&vRValue, &vsValue, 0, VT_R8) == S_OK)			{				vValue = vRValue;			}			// Add named parameter to list			Property p;			p.szName = szName.c_str();			p.vValue = vValue;			pl.push_back(p);		}	}	// Create the control site	CControlSiteInstance *pSite = NULL;	CControlSiteInstance::CreateInstance(&pSite);	if (pSite == NULL)	{		return NPERR_GENERIC_ERROR;	}	pSite->AddRef();	// TODO check the object is installed and at least as recent as	//      that specified in szCodebase	// Create the object	if (FAILED(pSite->Create(clsid, pl, szName)))	{		pSite->Release();		return NPERR_GENERIC_ERROR;	}    instance->pdata = pSite;	return NPERR_NO_ERROR;}