当前位置: 首页>>代码示例>>C++>>正文


C++ UT_Win32LocaleString::fromUTF8方法代码示例

本文整理汇总了C++中UT_Win32LocaleString::fromUTF8方法的典型用法代码示例。如果您正苦于以下问题:C++ UT_Win32LocaleString::fromUTF8方法的具体用法?C++ UT_Win32LocaleString::fromUTF8怎么用?C++ UT_Win32LocaleString::fromUTF8使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UT_Win32LocaleString的用法示例。


在下文中一共展示了UT_Win32LocaleString::fromUTF8方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getColumns

BOOL AP_Win32Dialog_Columns::_onDeltaPos(NM_UPDOWN * pnmud)
{
	wchar_t buf[BUFSIZE];
	UT_Win32LocaleString str;
    
	switch( pnmud->hdr.idFrom )
	{
	case AP_RID_DIALOG_COLUMN_SPIN_NUMCOLUMNS:
		if( pnmud->iDelta < 0 )
		{
			setColumns( getColumns() + 1 );
		}
		else
		{
			if( getColumns() > 1 )
			{
				setColumns( getColumns() - 1 );
			}
		}
		SetDlgItemTextW(m_hDlg, AP_RID_DIALOG_COLUMN_EDIT_NUMCOLUMNS, _itow(getColumns(),buf,10));
		checkButton(AP_RID_DIALOG_COLUMN_RADIO_ONE, (getColumns()==1));
		checkButton(AP_RID_DIALOG_COLUMN_RADIO_TWO, (getColumns()==2));
		checkButton(AP_RID_DIALOG_COLUMN_RADIO_THREE, (getColumns()==3));
		return 1;

	case AP_RID_DIALOG_COLUMN_SPIN_SPACEAFTER:
		if( pnmud->iDelta < 0 )
		{
			incrementSpaceAfter( true );
		}
		else
		{
			incrementSpaceAfter( false );
		}
        str.fromUTF8 (getSpaceAfterString());
        SetDlgItemTextW(m_hDlg, AP_RID_DIALOG_COLUMN_EDIT_SPACEAFTER, str.c_str ());
		return 1;

	case AP_RID_DIALOG_COLUMN_SPIN_MAXSIZE:
		if( pnmud->iDelta < 0 )
		{
			incrementMaxHeight( true );
		}
		else
		{
			incrementMaxHeight( false );
		}
        str.fromUTF8 (getHeightString());
        SetDlgItemTextW(m_hDlg, AP_RID_DIALOG_COLUMN_EDIT_MAXSIZE, str.c_str ());
		return 1;

	default:
		return 0;
	}
}
开发者ID:monkeyiq,项目名称:odf-2011-track-changes-git-svn,代码行数:55,代码来源:ap_Win32Dialog_Columns.cpp

示例2:

void XAP_Win32DialogBase::setDialogTitle(const char* uft8_str)
{
	UT_return_if_fail(IsWindow(m_hDlg));
	UT_Win32LocaleString str;
	str.fromUTF8 (uft8_str);
	SetWindowTextW (m_hDlg, str.c_str());
}
开发者ID:monkeyiq,项目名称:odf-2011-track-changes-git-svn,代码行数:7,代码来源:xap_Win32DialogBase.cpp

示例3: SendMessageW

void AP_Win32Dialog_Field::SetFieldsList(void)
{
	fp_FieldTypesEnum  FType = fp_FieldTypes[m_iTypeIndex].m_Type;

	SendMessageW(m_hwndFormats, LB_RESETCONTENT, 0, 0);
	int i;
	for (i = 0;fp_FieldFmts[i].m_Tag != NULL;i++) 
	{
		if( fp_FieldFmts[i].m_Type == FType )
			break;
	}

	UT_Win32LocaleString str;

	for (;fp_FieldFmts[i].m_Tag != NULL && fp_FieldFmts[i].m_Type == FType;i++) 
	{
		if((fp_FieldFmts[i].m_Num != FPFIELD_endnote_anch) &&
		   (fp_FieldFmts[i].m_Num != FPFIELD_endnote_ref) &&
		   (fp_FieldFmts[i].m_Num != FPFIELD_footnote_anch) &&
		   (fp_FieldFmts[i].m_Num != FPFIELD_footnote_ref))
		{ 
			str.fromUTF8(fp_FieldFmts[i].m_Desc);
			UT_sint32 index = SendMessageW(m_hwndFormats, LB_ADDSTRING, 0, (LPARAM)str.c_str());
			if (index != LB_ERR && index != LB_ERRSPACE)
			{
				SendMessageW(m_hwndFormats, LB_SETITEMDATA, (WPARAM)index, (LPARAM)i);
			}
		}
	}
	SendMessageW(m_hwndFormats, LB_SETCURSEL, 0, 0);
	_FormatListBoxChange();
}
开发者ID:tchx84,项目名称:debian-abiword-packages,代码行数:32,代码来源:ap_Win32Dialog_Field.cpp

示例4: SendDlgItemMessageW

int XAP_Win32DialogBase::addItemToCombo(UT_sint32 controlId, LPCSTR p_str)
{
	UT_return_val_if_fail(IsWindow(m_hDlg), CB_ERR);
    UT_Win32LocaleString str;
	str.fromUTF8 (p_str); 	
	return SendDlgItemMessageW(m_hDlg, controlId, CB_ADDSTRING, 0, (LPARAM)str.c_str());	
}
开发者ID:monkeyiq,项目名称:odf-2011-track-changes-git-svn,代码行数:7,代码来源:xap_Win32DialogBase.cpp

示例5: SetDlgItemTextW

bool XAP_Win32DialogBase::setDlgItemText(HWND hWnd, int nIDDlgItem,  const char* uft8_str)
{
	UT_return_val_if_fail(IsWindow(hWnd), false);
	
	UT_Win32LocaleString str;
	str.fromUTF8 (uft8_str);
	return (bool) SetDlgItemTextW (hWnd, nIDDlgItem, str.c_str());
}
开发者ID:monkeyiq,项目名称:odf-2011-track-changes-git-svn,代码行数:8,代码来源:xap_Win32DialogBase.cpp

示例6: CreatePen

/*
	Draws the Format button with an arrow
*/
void AP_Win32Dialog_Styles::_onDrawButton(LPDRAWITEMSTRUCT lpDrawItemStruct, HWND hWnd)
{
    UINT			uiState    = lpDrawItemStruct->itemState;
    HPEN			hPen;
    HPEN			pOldPen;
	HDC				hdc = lpDrawItemStruct->hDC;
	int				nWidth;
	int				nHeight;
	int		 		x, xEnd, xStart;
	int 			y;
	POINT 			p;	
	const char* 	pText;
	HWND 			hParent;
	LONG			lData;

	UT_Win32LocaleString str;
	
	const XAP_StringSet * pSS = m_pApp->getStringSet();		
	
	pText=	pSS->getValue(AP_STRING_ID_DLG_Styles_ModifyFormat);		
	
	nWidth = lpDrawItemStruct->rcItem.right - lpDrawItemStruct->rcItem.left;
	nHeight = lpDrawItemStruct->rcItem.bottom - lpDrawItemStruct->rcItem.top;
		      
    // set the pen color
    if (uiState&ODS_DISABLED)
        hPen = CreatePen(PS_SOLID, 0, GetSysColor(COLOR_GRAYTEXT));
    else
        hPen = CreatePen(PS_SOLID, 0, GetSysColor(COLOR_BTNTEXT));
    
    pOldPen =  (HPEN) SelectObject(hdc, hPen);

    // draw the border of the button
    if(uiState&ODS_SELECTED)
        DrawFrameControl(hdc, &lpDrawItemStruct->rcItem, DFC_BUTTON, DFCS_BUTTONPUSH|DFCS_PUSHED);
    else
        DrawFrameControl(hdc, &lpDrawItemStruct->rcItem, DFC_BUTTON, DFCS_BUTTONPUSH);	
	
	// Draw arrow
	y = nHeight/2;
	xStart = (nWidth/6)*5;
	for (int i=0; i<4; i++)
	{
  	   x = xStart + i;
	   xEnd = xStart + 7 - i;

	   ::MoveToEx(hdc, x, y, &p);	   
       ::LineTo(hdc, xEnd, y);
	   y++;
	 }

	str.fromUTF8(pText);
	ExtTextOutW(hdc, (nWidth/6)*1, ((nHeight/4)), 0, NULL, str.c_str(), str.length(), NULL);
		
    // Clean Up
    SelectObject(hdc, pOldPen);       
    DeleteObject(hPen);
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:61,代码来源:ap_Win32Dialog_Styles.cpp

示例7:

// cmdline processing call back I reckon
void AP_Win32App::errorMsgBadArg(const char *msg)
{
	char *pszMessage;
	UT_Win32LocaleString str;

	pszMessage = g_strdup_printf ("%s\nRun with --help' to see a full list of available command line options.\n", msg);
	str.fromUTF8(pszMessage);
	MessageBoxW(NULL, str.c_str(), L"Command Line Option Error", MB_OK|MB_ICONERROR);
	g_free( pszMessage );
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:11,代码来源:ap_Win32App.cpp

示例8:

void AP_Win32Dialog_Field::SetTypesList(void)
{
	UT_Win32LocaleString str;
	for (int i = 0;fp_FieldTypes[i].m_Desc != NULL;i++) 
	{
		str.fromUTF8(fp_FieldTypes[i].m_Desc);
		SendMessageW(m_hwndTypes, LB_ADDSTRING, (WPARAM)0, (LPARAM)str.c_str());
	}
	SendMessageW(m_hwndTypes, LB_SETCURSEL, (WPARAM)0, (LPARAM)0);
	m_iTypeIndex = 0;
}
开发者ID:tchx84,项目名称:debian-abiword-packages,代码行数:11,代码来源:ap_Win32Dialog_Field.cpp

示例9:

void AP_Win32Dialog_MailMerge::setFieldList()
{
	if (!m_vecFields.size())
		return;	

	resetContent(AP_RID_DIALOG_MAILMERGE_LISTBOX);
		
 	// build a list of all items
    for (UT_sint32 i = 0; i < m_vecFields.size(); i++)
	{
		UT_continue_if_fail(m_vecFields[i]);
		
		UT_Win32LocaleString str;
		str.fromUTF8(((UT_UTF8String*)m_vecFields[i])->utf8_str());
		
		SendMessageW(GetDlgItem(m_hDlg, AP_RID_DIALOG_MAILMERGE_LISTBOX), LB_ADDSTRING,
			0, (LPARAM)str.ucs2_str());
	}
	
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:20,代码来源:ap_Win32Dialog_MailMerge.cpp

示例10: s_createDirectoryIfNecessary

static bool s_createDirectoryIfNecessary(const char * szDir)
{
	struct _stat statbuf;
	UT_Win32LocaleString str;
	
	str.fromUTF8(szDir);

	if (_wstat(str.c_str(),&statbuf) == 0)								// if it exists
	{
		if ( (statbuf.st_mode & _S_IFDIR) == _S_IFDIR )			// and is a directory
			return true;

		UT_DEBUGMSG(("Pathname [%s] is not a directory.\n",szDir));
		return false;
	}

	if (CreateDirectoryW(str.c_str(),NULL))
		return true;

	UT_DEBUGMSG(("Could not create Directory [%s].\n",szDir));
	return false;
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:22,代码来源:ap_Win32App.cpp

示例11: strlen

/*
	Does a stringSet exist on disk?
*/
bool	AP_Win32App::doesStringSetExist(const char* pLocale)
{
	HANDLE in;
	const char * szDirectory = NULL;

	UT_return_val_if_fail(pLocale, false);
	
	getPrefsValueDirectory(true,AP_PREF_KEY_StringSetDirectory,&szDirectory);
	UT_return_val_if_fail(((szDirectory) && (*szDirectory)), false);

	char *szPathname = (char*) UT_calloc(sizeof(char),strlen(szDirectory)+strlen(pLocale)+100);
	UT_return_val_if_fail(szPathname, false);
	
	char *szDest = szPathname;
	strcpy(szDest, szDirectory);
	szDest += strlen(szDest);
	if ((szDest > szPathname) && (szDest[-1]!='\\'))
		*szDest++='\\';
	lstrcpyA(szDest,pLocale);
	lstrcatA(szDest,".strings");

	UT_Win32LocaleString wsFilename;
	wsFilename.fromUTF8(szPathname);

	in = CreateFileW(wsFilename.c_str(),0,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,
		OPEN_EXISTING,0,NULL);
	g_free (szPathname);
	
	if (in!=INVALID_HANDLE_VALUE)
	{
		CloseHandle(in);
		return true;
	}			
	
	return false;
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:39,代码来源:ap_Win32App.cpp

示例12: GetDlgItem

BOOL AP_Win32Dialog_ListRevisions::_onInitDialog(HWND hWnd, WPARAM /*wParam*/, LPARAM /*lParam*/)
{
	const XAP_StringSet * pSS = m_pApp->getStringSet();
    
	setDialogTitle (getTitle());

	// localize controls
	_DSX(BTN_OK,			DLG_OK);
	_DSX(BTN_CANCEL,		DLG_Cancel);

	setDlgItemText(AP_RID_DIALOG_LIST_REVISIONS_FRAME,getLabel1());

	// set the column headings
	HWND h = GetDlgItem(hWnd, AP_RID_DIALOG_LIST_REVISIONS_LIST);

    LVCOLUMNW col;
    UT_Win32LocaleString str;
	col.mask = LVCF_TEXT | LVCF_SUBITEM | LVCF_WIDTH;

	int col_hdr[3]={AP_STRING_ID_DLG_ListRevisions_Column1Label,
					AP_STRING_ID_DLG_ListRevisions_Column2Label,
					AP_STRING_ID_DLG_ListRevisions_Column3Label};
	int col_wid[3]={80,160,230};

	for (int i=0; i<3; i++) {
		col.iSubItem = i;
		col.cx = col_wid[i];
		str.fromUTF8(pSS->getValue(col_hdr[i]));
		col.pszText = (LPWSTR) str.c_str();
		SendMessageW(h, LVM_INSERTCOLUMNW, i, (LPARAM)&col);
	}

	ListView_SetItemCount(h, getItemCount());

	LVITEMW item;
	item.state = 0;
	item.stateMask = 0;
	item.iImage = 0;

	WCHAR buf[60];
	const char *tmp;
	item.pszText = buf;

	for(UT_uint32 i = 0; i < getItemCount(); i++)
	{
		wsprintfW(buf,L"%d",getNthItemId(i));
		item.pszText = buf;
		item.iItem = i;
		item.iSubItem = 0;
		item.lParam = getNthItemId(i);
		item.mask = LVIF_TEXT | LVIF_PARAM;
		SendMessageW(h, LVM_INSERTITEMW, 0, (LPARAM)&item);

		item.iSubItem = 1;
		tmp=getNthItemTime(i);
		if (tmp) {
			str.fromASCII(tmp,-1);
			item.pszText = (LPWSTR) str.c_str();
		} else {
			item.pszText = L"";
		}
		item.mask = LVIF_TEXT;
		SendMessageW(h, LVM_SETITEMW, 0, (LPARAM)&item);
		
		item.iSubItem = 2;
		str.fromUTF8(getNthItemText(i));
		item.pszText = (LPWSTR) str.c_str();
		item.mask = LVIF_TEXT;
		SendMessageW(h, LVM_SETITEMW, 0, (LPARAM)&item);
	}
   
	SendMessageW(h, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);  								
    centerDialog();	

	return 1;							// 1 == we did not call SetFocus()
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:76,代码来源:ap_Win32Dialog_ListRevisions.cpp

示例13: HIWORD


//.........这里部分代码省略.........
			rebuildDeleteProps();
			updateCurrentStyle();
		}
		return 1;

	case AP_RID_DIALOG_STYLES_NEWMODIFY_BTN_TOGGLEITEMS:
	{
	    RECT 	rect;
	    HMENU 	hMenu;
	    int		x,y;	    	    
	    HWND	hWndButton;
		static int menu_items[]={AP_STRING_ID_DLG_Styles_ModifyParagraph,
								AP_STRING_ID_DLG_Styles_ModifyFont,
								AP_STRING_ID_DLG_Styles_ModifyTabs,
								AP_STRING_ID_DLG_Styles_ModifyNumbering,
								AP_STRING_ID_DLG_Styles_ModifyLanguage
								};
	    
		UT_Win32LocaleString str;

	    hWndButton = GetDlgItem(hWnd, AP_RID_DIALOG_STYLES_NEWMODIFY_BTN_TOGGLEITEMS);
	    XAP_Win32App * app = static_cast<XAP_Win32App *> (m_pApp);		
		const XAP_StringSet * pSS = m_pApp->getStringSet();
	    
		// Get button position
	    GetWindowRect(hWndButton, &rect);
	    x = rect.left;
	    y = rect.bottom;	               		

	    // Menu creation
	    hMenu =  CreatePopupMenu();
		str;
		for (int i=0; i<5; i++) {
			str.fromUTF8(pSS->getValue(menu_items[i]));
			AppendMenuW(hMenu, MF_ENABLED|MF_STRING, i+1, (LPCWSTR)str.c_str());
		}
	
	    // show and track the menu
    	m_selectToggle = TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_NONOTIFY|TPM_RETURNCMD,
    						x,y,0, hWndButton,  NULL);		    							    	        						 							    
	    
	    switch(m_selectToggle)
		{
		case 0:	// user has cancelled
			break;
		case 1:
			ModifyParagraph();
			break;
		case 2:
			ModifyFont();
			break;
		case 3:
			ModifyTabs();
			break;
		case 4:
			ModifyLists();
			break;
		case 5:
			ModifyLang();
			break;
		default:
			break;			
		}
		
		rebuildDeleteProps();
		updateCurrentStyle();
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:67,代码来源:ap_Win32Dialog_Styles.cpp

示例14: GetDlgItem


//.........这里部分代码省略.........
		}

		delete pStyles;
		
		// Strings (not styles names)
		const char*	pDefCurrent = pSS->getValue(AP_STRING_ID_DLG_Styles_DefCurrent);
		const char*	pDefNone = pSS->getValue(AP_STRING_ID_DLG_Styles_DefNone);
		
		nIndex = _win32DialogNewModify.addItemToCombo( AP_RID_DIALOG_STYLES_NEWMODIFY_CBX_FOLLOWPARA, 
                                              pDefCurrent );
		_win32DialogNewModify.setComboDataItem(AP_RID_DIALOG_STYLES_NEWMODIFY_CBX_FOLLOWPARA,
			nIndex, (DWORD)-1);

		nIndex = _win32DialogNewModify.addItemToCombo( AP_RID_DIALOG_STYLES_NEWMODIFY_CBX_BASEDON, 
                                              pDefNone);
		_win32DialogNewModify.setComboDataItem(AP_RID_DIALOG_STYLES_NEWMODIFY_CBX_BASEDON,
			nIndex, (DWORD)-1);
		
		if( m_bisNewStyle )
		{	
			
			const char* p = pSS->getValue(AP_STRING_ID_DLG_Styles_ModifyParagraph);
			
			_win32DialogNewModify.addItemToCombo( AP_RID_DIALOG_STYLES_NEWMODIFY_CBX_TYPE,
                                                  p );
                                                  
			p = pSS->getValue(AP_STRING_ID_DLG_Styles_ModifyCharacter);
                                                  
			_win32DialogNewModify.addItemToCombo( AP_RID_DIALOG_STYLES_NEWMODIFY_CBX_TYPE,
                                                  p);			                         
                                                  
			// Set the Default syltes: none, default current
			UT_sint32 result;
			str.fromUTF8(pSS->getValue(AP_STRING_ID_DLG_Styles_DefNone));
			result = SendDlgItemMessageW(hWnd, AP_RID_DIALOG_STYLES_NEWMODIFY_CBX_BASEDON, CB_FINDSTRING, -1,
										(LPARAM) str.c_str());
			_win32DialogNewModify.selectComboItem( AP_RID_DIALOG_STYLES_NEWMODIFY_CBX_BASEDON, result );
			
			str.fromUTF8(pSS->getValue(AP_STRING_ID_DLG_Styles_DefCurrent));
			result = SendDlgItemMessageW(hWnd, AP_RID_DIALOG_STYLES_NEWMODIFY_CBX_FOLLOWPARA, CB_FINDSTRING, -1,
										(LPARAM) str.c_str());
			_win32DialogNewModify.selectComboItem( AP_RID_DIALOG_STYLES_NEWMODIFY_CBX_FOLLOWPARA, result );
			
			str.fromUTF8(pSS->getValue(AP_STRING_ID_DLG_Styles_ModifyParagraph));
			result = SendDlgItemMessageW(hWnd, AP_RID_DIALOG_STYLES_NEWMODIFY_CBX_TYPE, CB_FINDSTRING, -1,
										(LPARAM) str.c_str());
			_win32DialogNewModify.selectComboItem( AP_RID_DIALOG_STYLES_NEWMODIFY_CBX_TYPE, result );

			eventBasedOn();
			eventFollowedBy();
			eventStyleType();
			fillVecFromCurrentPoint();			
		}
		else
		{
			const char * szCurrentStyle = NULL;
			const char * szBasedOn = NULL;
			const char * szFollowedBy = NULL;
			const char * pLocalised = NULL;
			PD_Style * pStyle = NULL;
			PD_Style * pBasedOnStyle = NULL;
			PD_Style * pFollowedByStyle = NULL;
			
			szCurrentStyle = m_selectedStyle.c_str();
			
			pt_PieceTable::s_getLocalisedStyleName(szCurrentStyle, utf8);						
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:67,代码来源:ap_Win32Dialog_Styles.cpp

示例15: pluginName


//.........这里部分代码省略.........
	const char * szMenuLabelSetName = NULL;
	if (getPrefsValue( AP_PREF_KEY_StringSet, (const gchar**)&szMenuLabelSetName)
		&& (szMenuLabelSetName) && (*szMenuLabelSetName))
	{
		;
	}
	else
		szMenuLabelSetName = AP_PREF_DEFAULT_StringSet;

	getMenuFactory()->buildMenuLabelSet(szMenuLabelSetName);	
	
	//////////////////////////////////////////////////////////////////
	// Check for necessary DLLs now that we can do localized error messages
	//////////////////////////////////////////////////////////////////

	// Ensure that common control DLL is loaded
	HINSTANCE hinstCC = LoadLibraryW(L"comctl32.dll");
	UT_return_val_if_fail (hinstCC, false);
	InitCommonControlsEx_fn  pInitCommonControlsEx = NULL;
	if( hinstCC != NULL )
		pInitCommonControlsEx = (InitCommonControlsEx_fn)GetProcAddress( hinstCC, "InitCommonControlsEx");
	if( pInitCommonControlsEx != NULL )
	{
		INITCOMMONCONTROLSEX icex;
		icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
		icex.dwICC = ICC_COOL_CLASSES | ICC_BAR_CLASSES 	// load the rebar and toolbar
					| ICC_TAB_CLASSES | ICC_UPDOWN_CLASS	// and tab and spin controls
					| ICC_STANDARD_CLASSES;
		pInitCommonControlsEx(&icex);
	}
	else
	{
		InitCommonControls();

		UT_Win32LocaleString err;
		err.fromUTF8 (m_pStringSet->getValue(AP_STRING_ID_WINDOWS_COMCTL_WARNING));		
		MessageBoxW(NULL, err.c_str(), NULL, MB_OK);
	}

	//////////////////////////////////////////////////////////////////
	// load the all Plugins from the correct directory
	//////////////////////////////////////////////////////////////////

#ifndef DISABLE_BUILTIN_PLUGINS
	abi_register_builtin_plugins();
#endif

	bool bLoadPlugins = true;
	bool bFound = getPrefsValueBool(XAP_PREF_KEY_AutoLoadPlugins,&bLoadPlugins);

	if(bLoadPlugins || !bFound)
	{
		WCHAR szPath[PATH_MAX];
		WCHAR szPlugin[PATH_MAX];
		_getExeDir( szPath, PATH_MAX);
#ifdef _MSC_VER
		lstrcatW(szPath, L"..\\plugins\\*.dll");
#else
#define ABI_WIDE_STRING(t) L ## t
		lstrcatW(szPath, ABI_WIDE_STRING("..\\lib\\" PACKAGE L"-" ABIWORD_SERIES L"\\plugins\\*.dll"));
#endif

		WIN32_FIND_DATAW cfile;
		HANDLE findtag = FindFirstFileW( szPath, &cfile );
		if( findtag != INVALID_HANDLE_VALUE )
		{
			do
			{	
				_getExeDir( szPlugin, PATH_MAX );
#ifdef _MSC_VER
				lstrcatW( szPlugin, L"..\\plugins\\" );
#else
				lstrcatW( szPlugin, ABI_WIDE_STRING("..\\lib\\" PACKAGE L"-" ABIWORD_SERIES L"\\plugins\\" ));
#endif
				lstrcatW( szPlugin, cfile.cFileName );
				XAP_ModuleManager::instance().loadModule( getUTF8String(szPlugin) );
			} while( FindNextFileW ( findtag, &cfile ) );
			FindClose( findtag );
		}

		UT_String pluginName( getUserPrivateDirectory() ); 
		UT_String pluginDir( getUserPrivateDirectory() );
		pluginDir += "\\AbiWord\\plugins\\*.dll";
		UT_Win32LocaleString str;
		str.fromUTF8(pluginDir.c_str());
		findtag = FindFirstFileW( str.c_str(), &cfile );
		if( findtag != INVALID_HANDLE_VALUE )
		{
			do
			{	
				pluginName = getUserPrivateDirectory();
				pluginName += "\\AbiWord\\plugins\\";
				pluginName += getUTF8String(cfile.cFileName);
				XAP_ModuleManager::instance().loadModule( pluginName.c_str() );
			} while( FindNextFileW( findtag, &cfile ) );
			FindClose( findtag );
		}
	}
	return bSuccess;
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:101,代码来源:ap_Win32App.cpp


注:本文中的UT_Win32LocaleString::fromUTF8方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。