本文整理汇总了C++中PString::FindLast方法的典型用法代码示例。如果您正苦于以下问题:C++ PString::FindLast方法的具体用法?C++ PString::FindLast怎么用?C++ PString::FindLast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PString
的用法示例。
在下文中一共展示了PString::FindLast方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindPluginsPath
PString FindPluginsPath( void )
{
CRegString regStr( "CLSID\\{C802F39D-BF85-427A-A334-77E501DB62E9}\\InprocServer32\\", "", FALSE, HKEY_CLASSES_ROOT );
string strRead = regStr.read();
PString strPluginPath = strRead;
PINDEX nPos = strPluginPath.FindLast( "\\" );
strPluginPath = strPluginPath.Mid( 0, nPos + 1 ) + "js2n\\";
return strPluginPath;
}
示例2: init
NPBool CPlugin::init(NPWindow* pNPWindow)
{
if(pNPWindow == NULL)
return FALSE;
#ifdef XP_WIN
m_hWnd = (HWND)pNPWindow->window;
if(m_hWnd == NULL)
return FALSE;
// subclass window so we can intercept window messages and
// do our drawing to it
lpOldProc = SubclassWindow(m_hWnd, (WNDPROC)PluginWinProc);
// associate window with our CPlugin object so we can access
// it in the window procedure
SetWindowLong(m_hWnd, GWL_USERDATA, (LONG)this);
#endif
m_Window = pNPWindow;
m_bInitialized = TRUE;
g_pNPInstance = m_pNPInstance;
g_pNPWindow = pNPWindow;
PString strPluginPath;
#ifdef XP_WIN // NPAPI plugin
//Get Current Path of exe
char szFullFileName[ MAX_PATH ];
GetModuleFileName ( GetModuleHandle(NULL), szFullFileName, MAX_PATH ) ;
strPluginPath = szFullFileName;
PINDEX nPos = strPluginPath.FindLast( "\\" );
strPluginPath = strPluginPath.Mid( 0, nPos + 1 ) + "plugins\\js2n\\";
#else // not Windows - assuming Linux
BrInitError error;
if (br_init_lib(&error) == 0 && error != BR_INIT_ERROR_DISABLED)
{
printf( "Error - can't init binreloc, code %d\n", error );
}
strPluginPath = br_find_exe_dir("/usr/lib/firefox/plugins/");
strPluginPath += "js2n/";
#endif
g_NativeLogic.Init( g_strPageURL, strPluginPath );
return TRUE;
}