这篇教程C++ A2W函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中A2W函数的典型用法代码示例。如果您正苦于以下问题:C++ A2W函数的具体用法?C++ A2W怎么用?C++ A2W使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了A2W函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: TRACE//{{VCI_IMPLEMENT_BEGINint CDuiPlugin::OnInit(UINT nIDTemplate, HWND hWnd, LPCSTR lpszName, CRect rc){ // 调用DuiSystem创建一个Panel控件对象,并加载xml文件 TRACE("CDuiPlugin::OnInit, name=%s, rc=%d,%d,%d,%d/n", lpszName, rc.left, rc.top, rc.right, rc.bottom); USES_CONVERSION; // 设置DuiVision库的根目录 DuiSystem::SetRootPath(GetPlugInRootPath()); // 初始化DUI库 DWORD dwLangID = 0; new DuiSystem(NULL, dwLangID, _T(""), 1116, nIDTemplate, _T("")); DuiSystem::LogEvent(LOG_LEVEL_DEBUG, L"CDuiPlugin::OnInit root path is %s", GetPlugInRootPath()); // 加载xml m_pDuiPanel = (CDuiPanel*)DuiSystem::CreateControlByName(L"div", hWnd, NULL); if(m_pDuiPanel) { // 给插件的panel对象注册事件处理对象 CDuiHandlerPlugin* pHandler = new CDuiHandlerPlugin(); pHandler->SetDuiPanel(m_pDuiPanel); DuiSystem::RegisterHandler(m_pDuiPanel, pHandler); // 加载插件界面文件 BOOL bRet = m_pDuiPanel->LoadXmlFile(A2W(lpszName)); DuiSystem::LogEvent(LOG_LEVEL_DEBUG, L"CDuiPlugin::OnInit load %s %s", A2W(lpszName), bRet ? L"succ" : L"fail"); } return 0;}
开发者ID:minyoad,项目名称:DuiVision,代码行数:31,
示例2: cvGetModuleInfovoid CEyepatch::DisplayVersionInfo() { USES_CONVERSION; WCHAR versionInfo[1024]; const char* opencv_libraries = 0; const char* addon_modules = 0; cvGetModuleInfo( 0, &opencv_libraries, &addon_modules ); wsprintf(versionInfo, L"Eyepatch Version: %s/n", EYEPATCH_VERSION); wcscat(versionInfo, L"/nOpenCV Libraries: "); wcscat(versionInfo, A2W(opencv_libraries)); wcscat(versionInfo, L"/nAdd-On Modules: "); wcscat(versionInfo, A2W(addon_modules)); MSGBOXPARAMS mbp; mbp.hwndOwner = this->m_hWnd; mbp.hInstance = this->m_hInstance; mbp.dwStyle = MB_USERICON; mbp.lpszIcon = MAKEINTRESOURCE(IDI_EYEPATCH); mbp.dwContextHelpId = NULL; mbp.lpfnMsgBoxCallback = NULL; mbp.dwLanguageId = NULL; mbp.lpszCaption = L"Eyepatch Version Information"; mbp.lpszText = versionInfo; ::MessageBoxIndirect(&mbp);}
开发者ID:gotomypc,项目名称:eyepatch,代码行数:25,
示例3: ProcessHtmlvoid CFDMFlashVideoDownloads::ProcessHtml(LPCSTR pszHost, LPCSTR pszHtml){ vmsVideoSiteHtmlCodeParser vshcp; if (FALSE == vshcp.Parse (pszHost, pszHtml)) return; USES_CONVERSION; IWGUrlReceiverPtr spRcvr; spRcvr.CreateInstance (__uuidof (WGUrlReceiver)); spRcvr->put_Url (A2W (vshcp.get_VideoUrl ())); if (vshcp.get_IsVideoUrlDirectLink ()) { CString str = vshcp.get_VideoTitle (); str += "."; str += vshcp.get_VideoType (); spRcvr->put_FileName (A2W (str)); spRcvr->put_Comment (A2W (vshcp.get_VideoTitle ())); spRcvr->put_FlashVideoDownload (TRUE); } spRcvr->AddDownload ();}
开发者ID:HackLinux,项目名称:Free-Download-Manager-vs2010,代码行数:25,
示例4: _TBOOL CxNetCardInfo::ParseData(){ USES_CONVERSION; macaddress.Format( _T("%02X:%02X:%02X:%02X:%02X:%02X"),pinfo->Address[0],pinfo->Address[1],pinfo->Address[2],pinfo->Address[3],pinfo->Address[4],pinfo->Address[5] ); description = pinfo->Description; type.Format(_T("%d"),pinfo->Type); PIP_ADDR_STRING pAddressList = &(pinfo->IpAddressList); IpAddress = _T(""); do { IpAddress += pAddressList->IpAddress.String; pAddressList = pAddressList->Next; if( pAddressList != NULL ) IpAddress += _T( "/r/n" ); }while( pAddressList != NULL ); subnet.Format( _T("%s"), A2W(pinfo->IpAddressList.IpMask.String) ); gateway.Format( _T("%s"), A2W(pinfo->GatewayList.IpAddress.String) ); if( pinfo->HaveWins ) PrimaryWinsServer.Format( _T("%s"),pinfo->PrimaryWinsServer.IpAddress.String ); else PrimaryWinsServer.Format( _T("%s"),_T("N/A") ); if( pinfo->DhcpEnabled ) dhcp.Format( _T("%s"),pinfo->DhcpServer.IpAddress.String ); else dhcp.Format( _T("%s"),_T("N/A") ); pinfo = pinfo->Next; return TRUE;}
开发者ID:Hpark11,项目名称:FIES,代码行数:30,
示例5: _tcscpy_svoid versionManager::getMainModuleVersion(VMMAPDEF& mapVersion){ std::string strVersion = ""; TCHAR szBankPath[1000]; _tcscpy_s(szBankPath, getModulePath().c_str()); _tcscat_s(szBankPath, _T("//MoneyHub.exe")); CFileVersionInfo vinfo; if (vinfo.Create(szBankPath)) { tstring strFileVersion = vinfo.GetFileVersion(); replace(strFileVersion.begin(), strFileVersion.end(), ',', '.'); strFileVersion.erase(remove(strFileVersion.begin(), strFileVersion.end(), ' '), strFileVersion.end()); strVersion = std::string(CT2A(strFileVersion.c_str(), 936)); } else return ; USES_CONVERSION; if(m_bEnName) mapVersion.insert(std::make_pair(L"Main",A2W(strVersion.c_str()) ) ); else { VMMAPDEF::iterator it = m_mapEnChName.find(L"Main"); if( it != m_mapEnChName.end() ) mapVersion.insert(std::make_pair(it->second.c_str(), A2W(strVersion.c_str()) ) ); }}
开发者ID:Williamzuckerberg,项目名称:chtmoneyhub,代码行数:29,
示例6: _OnAlarmstatic void CDECL _OnAlarm(int rank, ALARM_CLASS ac, const char * msg, PCRTK_ADDR src){ if(!theDb){ return; } USES_CONVERSION; theDb->Fire_OnAlarm(rank, ac, A2W(msg), A2W((char*)CHostName(src->host)));}
开发者ID:eseawind,项目名称:CNCS_PMC-Conductor,代码行数:8,
示例7: DetourMessageBoxIndirectAint WINAPI DetourMessageBoxIndirectA(const LPMSGBOXPARAMSA lpMsgBoxParams){ USES_CONVERSION; wstring lpText = A2W(lpMsgBoxParams->lpszText); wstring lpCaption = A2W(lpMsgBoxParams->lpszCaption); return mhMessageBox(lpMsgBoxParams->hwndOwner, lpText.c_str(), lpCaption.c_str(), lpMsgBoxParams->dwStyle);}
开发者ID:Williamzuckerberg,项目名称:chtmoneyhub,代码行数:8,
示例8: CreateWindowHWND Win32Tools::CreateWnd(HINSTANCE hinstance, char captain[]){ USES_CONVERSION; // Create the window return CreateWindow(A2W("MyWindowClass"), A2W(captain), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 800, 800, NULL, NULL, hinstance, NULL);}
开发者ID:yotamgi,项目名称:ggchess,代码行数:9,
示例9: GetModuleFileNamevoid MaxAWDExporter::CopyViewer(bool network){ char awdDrive[4]; char awdPath[1024]; char awdName[256]; char dleFullPath[1024]; char dleDrive[4]; char dlePath[1024]; char tplHtmlPath[1024]; char tplSwfPath[1024]; char tplJsPath[1024]; char outHtmlPath[1024]; char outSwfPath[1024]; char outJsPath[1024]; // Get paths of plug-in DLE file and output AWD file and split into // components to be used to concatenate input and output paths. //TCHAR * dleFullPath_tchar=A2W(_T("")); TCHAR dleFullPath_tchar[1024]; GetModuleFileName(hInstance, dleFullPath_tchar, 1024); char * dleFullPath_ptr=W2A(dleFullPath_tchar); _splitpath_s(dleFullPath_ptr, dleDrive, 4, dlePath, 1024, NULL, 0, NULL, 0); _splitpath_s(awdFullPath, awdDrive, 4, awdPath, 1024, awdName, 256, NULL, 0); // Select which viewer SWF file to copy depending on which sandbox // it should be compiled for (network or local.) char *viewerName = network?"AwayExtensions3dsMax//AWDHTMLViewer//viewer_n" : "AwayExtensions3dsMax//AWDHTMLViewer//viewer_l"; // Assemble paths for inputs (templates) _makepath_s(tplHtmlPath, 1024, dleDrive, dlePath, "AwayExtensions3dsMax//AWDHTMLViewer//template", "html"); _makepath_s(tplSwfPath, 1024, dleDrive, dlePath, viewerName, "swf"); _makepath_s(tplJsPath, 1024, dleDrive, dlePath, "AwayExtensions3dsMax//AWDHTMLViewer//swfobject", "js"); // Assemble paths for outputs _makepath_s(outHtmlPath, 1024, awdDrive, awdPath, awdName, "html"); _makepath_s(outSwfPath, 1024, awdDrive, awdPath, "viewer", "swf"); _makepath_s(outJsPath, 1024, awdDrive, awdPath, "swfobject", "js"); // Copy HTML, and evaluate any variables in the template CopyViewerHTML(tplHtmlPath, outHtmlPath, awdName); // Copy SWF and JS files as-is TCHAR * tplSwfPath_tchar=A2W(tplSwfPath); TCHAR * outSwfPath_tchar=A2W(outSwfPath); TCHAR * tplJsPath_tchar=A2W(tplJsPath); TCHAR * outJsPath_tchar=A2W(outJsPath); CopyFile(tplSwfPath_tchar, outSwfPath_tchar, false); CopyFile(tplJsPath_tchar, outJsPath_tchar, true); TCHAR * outHtmlPath_tchar=A2W(outHtmlPath); ShellExecute(NULL, _T("open"), outHtmlPath_tchar, NULL, NULL, SW_SHOWNORMAL); free (tplSwfPath_tchar); free (outSwfPath_tchar); free (tplJsPath_tchar); free (outJsPath_tchar); free (dleFullPath_ptr); free (outHtmlPath_tchar);}
开发者ID:quinsmpang,项目名称:Tools,代码行数:57,
示例10: BuildFilterGraphBOOL CVMR9Graph::BuildAndRenderGraph(bool withSound){ USES_CONVERSION; int nLayer = 0; HRESULT hr; // ENSURE that a valid graph builder is available if (m_pGraphBuilder == NULL) { BOOL bRet = BuildFilterGraph(withSound); if (!bRet) return bRet; } // ENSURE that the filter graph is in a stop state OAFilterState filterState; m_pMediaControl->GetState(500, &filterState); if (filterState != State_Stopped) { m_pMediaControl->Stop(); } // CHECK a source filter availaibility for the layer if (m_srcFilterArray[nLayer] == NULL) { char pszFilterName[10]; sprintf(pszFilterName, "SRC%02d", nLayer); IBaseFilter* pBaseFilter = NULL; hr = m_pGraphBuilder->AddSourceFilter(A2W(m_pszFileName), A2W(pszFilterName), &pBaseFilter); if (FAILED(hr)) { ReportError("Could not find a source filter for this file", hr); return FALSE; } m_srcFilterArray[nLayer] = pBaseFilter; } else { // suppress the old src filter IBaseFilter* pBaseFilter = m_srcFilterArray[nLayer]; RemoveFilterChain(pBaseFilter, m_pVMRBaseFilter); pBaseFilter->Release(); m_srcFilterArray[nLayer] = NULL; // create a new src filter char pszFilterName[10]; sprintf(pszFilterName, "SRC%02d", nLayer); hr = m_pGraphBuilder->AddSourceFilter(A2W(m_pszFileName), A2W(pszFilterName), &pBaseFilter); m_srcFilterArray[nLayer] = pBaseFilter; if (FAILED(hr)) { m_srcFilterArray[nLayer] = NULL; ReportError("Could not load the file", hr); return FALSE; } } // RENDER the graph BOOL bRet = RenderGraph(); if (!bRet) return bRet; return TRUE;}
开发者ID:smarinel,项目名称:ags-web,代码行数:55,
示例11: GetDbSchemeName// *************************************************************// GerStyleTableName()// *************************************************************CStringW OgrStyleHelper::GetStyleTableName(CStringW layerName){ CStringW name; USES_CONVERSION; if (m_globalSettings.useSchemesForStyles) { name.Format(L"%s%s", GetDbSchemeName(layerName, true), A2W(STYLES_TABLE_NAME)); } else { name = A2W(STYLES_TABLE_NAME); } return name;}
开发者ID:liuzhumei,项目名称:MapWinGIS,代码行数:16,
示例12: A2Wbool CAddDevice::CheckONVIF(){ USES_CONVERSION; bool bResult = false; vector<NODEITEM> vcONVIFnode; vector<NODEITEM*> vcENCPnode; m_pbk->GetONVIFNodes(vcONVIFnode); vcENCPnode = CIPCamDiscovery::GetNodePtr(); vector<CString> vcStrIP; vector<CString>::iterator it; CString str; int nIdx = 0, nCount = vcONVIFnode.size(); for(nIdx = 0; nIdx < nCount; nIdx++) { str.Empty(); str = A2W(vcONVIFnode[nIdx].ip); vcStrIP.push_back(str); } nCount = vcENCPnode.size(); for(nIdx = 0; nIdx < nCount; nIdx++) { str.Empty(); str = A2W(vcENCPnode[nIdx]->ip); it = find(vcStrIP.begin(),vcStrIP.end(),str); if (it != vcStrIP.end()) { int nIdx = it-vcStrIP.begin(); vcStrIP.erase(it); vcONVIFnode.erase(vcONVIFnode.begin()+nIdx); } } CString strAddress, strPort; GetKeyinAddress(strAddress, strPort); nCount = vcONVIFnode.size(); for(nIdx = 0; nIdx < nCount; nIdx++) { str.Empty(); str = A2W(vcONVIFnode[nIdx].ip); if (str == strAddress) { GetONVIF_RTSP(vcONVIFnode[nIdx].stream_url, m_strUserName, m_strPassword, vcONVIFnode[nIdx]); m_vcNodes.push_back(vcONVIFnode[nIdx]); bResult = true; break; } } return bResult;}
开发者ID:YTYOON,项目名称:eNVR,代码行数:51,
示例13: ASSERTErrorCode HTMLIFrameElement::Load(){ ASSERT(0); return 0;#if 0 ASSERT(m_pFrameContent); sysstring src = get_src(); if (src.Length()) { TCHAR result[2048]; { sysstring documentUrl = m_ownerDocument->get_url(); DWORD resultLen = sizeof(result); InternetCombineUrl(W2A(documentUrl), W2A(src), result, &resultLen, 0); } CComBSTR url = A2W(result); return m_pFrameContent->LoadSRC(CComQIPtr<IHlinkSite>(m_ownerDocument), url); } else return S_FALSE;#endif}
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:28,
示例14: GetIfTableNetUsage::NetUsage(){ m_OutLen = 0; GetIfTable(NULL, &m_OutLen, FALSE); m_OutBuf = new BYTE[m_OutLen]; DWORD ret = GetIfTable((PMIB_IFTABLE)m_OutBuf, &m_OutLen, FALSE); USES_CONVERSION; if(ret == NO_ERROR) { MIB_IFTABLE *pIfTable = (MIB_IFTABLE *)m_OutBuf; for(DWORD a=0; a<pIfTable->dwNumEntries; a++) { MIB_IFROW & row = pIfTable->table[a]; NetIf ni; ni.InSpeed = 0; ni.LastIn = row.dwInOctets; ni.LastOut = row.dwOutOctets; ni.Name = A2W((LPCSTR)row.bDescr); ni.OutSpeed = 0; m_IfRow.push_back(ni); } } SYSTEMTIME st; ::GetLocalTime(&st); FILETIME ft; SystemTimeToFileTime(&st, &ft); //m_LastTime = time((time_t *)&m_LastTime); memcpy(&m_LastTime, &ft, sizeof(ULONGLONG));}
开发者ID:bahamut8348,项目名称:xkcode,代码行数:31,
示例15: ErrorSTDMETHODIMP CISEMMManager::EnterOrder(ISEOrder* Order, BSTR* OrderID){ USES_CONVERSION; if(!Order || !OrderID || !Order->Series) return E_POINTER; string sSeries = (char*)_bstr_t(Order->Series); if(sSeries.length() == 0) return Error(L"Invalid series name."); if(Order->Quantity <= 0) return Error(L"Invalid order quantity."); if(Order->Price <= 0) return Error(L"Invalid order price."); if(Order->BidOrAsk == enBoth) return Error(L"Order may only be of Ask or Bid type."); string sOrderID; HRESULT hr = theISEManager->EnterOrder(sSeries, Order->Quantity, Order->Price, Order->BidOrAsk, sOrderID); if(SUCCEEDED(hr)) *OrderID = SysAllocString(A2W(sOrderID.c_str())); return hr;}
开发者ID:AlexS2172,项目名称:IVRM,代码行数:30,
示例16: StopDownloadingBOOL vmsTpDownloadMgr::DeleteFile(){ bool bMaySleep = false; if (m_dldr) { if (IsRunning ()) { StopDownloading (); while (m_bThreadRunning) Sleep (10); } bMaySleep = true; } USES_CONVERSION; std::wstring wstrSrcPath = A2W (m_info.strOutputPath); if (wstrSrcPath [wstrSrcPath.length () - 1] != '//') wstrSrcPath += '//'; return ::DeleteFile (get_OutputFilePathName());}
开发者ID:HackLinux,项目名称:Free-Download-Manager-vs2010,代码行数:25,
示例17: D3DXLoadMeshFromXvoid x_mesh_t::load( LPCWSTR file_name, LPDIRECT3DDEVICE9 device ){ ID3DXBuffer *materials_buf = NULL; HRESULT hr = D3DXLoadMeshFromX(file_name, 0, device, NULL, &materials_buf, NULL, &m_materials_count, &m_mesh); if (hr != ERROR_SUCCESS) return; D3DXMATERIAL *materials_array = (D3DXMATERIAL *)materials_buf->GetBufferPointer(); m_materials = new D3DMATERIAL9[m_materials_count]; m_textures = new texture_t[m_materials_count]; bool result; for (DWORD i = 0; i < m_materials_count; ++i) { m_materials[i] = materials_array[i].MatD3D; m_materials[i].Ambient = m_materials[i].Diffuse; std::wstring str; A2W(str, std::string(materials_array[i].pTextureFilename)); result = m_textures[i].load(device, str.c_str()); } if (materials_buf) materials_buf->Release(); m_mesh->OptimizeInplace(D3DXMESHOPT_COMPACT | D3DXMESHOPT_ATTRSORT, NULL, NULL, NULL, NULL);}
开发者ID:bea231,项目名称:CGTasks,代码行数:29,
示例18: GenerateErrorHRESULT GenerateError (REFCLSID rClsId, REFIID riid, LPCOLESTR pcHelpFile, HRESULT hRes) {#endif CComBSTR strMsgLine; DWORD dwErr = FormatMessageLine( strMsgLine, hRes, NULL );#if defined(_DEBUG) USES_CONVERSION; if( dwErr ) { LPTSTR lptMsg = NULL; CComBSTR strMsg(L"/n---------------------- Fehler beim Erzeugen der Fehlermeldung ----------------------/n"); if( ::FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, dwErr, 1024, (LPTSTR) &lptMsg, 0, NULL ) ) { USES_CONVERSION; strMsg.Append( A2W(lptMsg) ); ::LocalFree(lptMsg); if( 0x716 == dwErr ) { strMsg.Append(L"/n----------------------------------------------------------------------------------------"); strMsg.Append( L"/nHat die Message-Ressource den Wert 1? ;-)" ); } strMsg.Append(L"/n----------------------------------------------------------------------------------------"); _CrtDbgReport(_CRT_ASSERT, strFile, line, NULL, W2A(strMsg) ); return E_FAIL; } } CComBSTR strDbgLine; FormatDebuggerLine( strDbgLine, hRes, strFile, line, strExpr ); strDbgLine.Append( _T("/t") ); strDbgLine.Append( strMsgLine ); strDbgLine.Append( _T("/n") ); { ATLTRACE( W2A(strDbgLine) ); }#endif DWORD dwHelpID = hRes; return AtlReportError(rClsId, strMsgLine, dwHelpID, pcHelpFile, riid, hRes);}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:32,
示例19: sizeofBOOL Win32Tools::RegisterThisClass(HINSTANCE hinstance, WNDPROC CurrWindowProc, HBRUSH bgColor){ USES_CONVERSION; // fill the wndclass WNDCLASSEX wcx; wcx.cbSize = sizeof(wcx); // size of structure wcx.style = CS_HREDRAW | CS_VREDRAW; // redraw if size changes wcx.lpfnWndProc = CurrWindowProc; // points to window procedure wcx.cbClsExtra = 0; // no extra class memory wcx.cbWndExtra = 0; // no extra window memory wcx.hInstance = hinstance; // handle to instance wcx.hIcon = LoadIcon(NULL, IDI_APPLICATION); // predefined app. icon wcx.hCursor = LoadCursor(NULL, IDC_ARROW); // predefined arrow wcx.hbrBackground = bgColor ; // white background brush wcx.lpszMenuName = NULL; // name of menu resource wcx.lpszClassName = A2W("MyWindowClass"); // name of window class wcx.hIconSm = (HICON)LoadImage(hinstance, // small class icon MAKEINTRESOURCE(5), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR); // Register the window class. return (BOOL)RegisterClassEx(&wcx);}
开发者ID:yotamgi,项目名称:ggchess,代码行数:27,
示例20: A2WSTDMETHODIMP CJoystickCtl::getProductName(BSTR *pName) { USES_CONVERSION; char* name = stick.getProductName(); CComBSTR wName = A2W(name); *pName = wName.Detach(); return S_OK;}
开发者ID:09898,项目名称:javascript-joystick,代码行数:7,
示例21: wcscpyvoid CNCSMultiSZ::replace(char *newEntryName, int index){ USES_CONVERSION; wchar_t *result; if (index<MAX_MSZ_NUM_LINE) result = wcscpy(wcApps[index],A2W(newEntryName));}
开发者ID:forostm,项目名称:libecw,代码行数:7,
示例22: CreateFileMappingbool CmdLineHandler::toBeLeader(){ USES_CONVERSION; bool ret = true; //create share memory sharedMemHandle_ = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, SHARED_MEM_SIZE, A2W(userShareMemName_)); if (NULL == sharedMemHandle_) { fatalbox("%s", "can't get shared memory handle!"); exit(-1); } sharedType_ = (GetLastError() == ERROR_ALREADY_EXISTS) ? SHARED_TYPE_FOLLOWER : SHARED_TYPE_LEADER; sharedBuffer_ = (char* ) MapViewOfFile(sharedMemHandle_, // handle to map object FILE_MAP_ALL_ACCESS, // read/write permission 0, 0, SHARED_MEM_SIZE); if (NULL == sharedBuffer_){ fatalbox("%s", "can't get shared memory!"); CloseHandle(sharedMemHandle_); exit(-1); } if (isLeader()){ memset(sharedBuffer_, 0, SHARED_MEM_SIZE); } return isLeader();}
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:34,
示例23: CallContextDayNote BOOL CallContextDayNote(SYSTEMTIME Time, HWND hCalendar) { CStringArray arr; arr.Add(_l("New reminder")); arr.Add(_l("Add date to clipboard")); int iSelection=SelectFromMenu(arr,0); if(iSelection<0){ return 0; } if(iSelection==0){ return -1; } CString s=""; COleDateTime tm;//=COleDateTime(Time); tm.SetDate(Time.wYear,Time.wMonth,Time.wDay); if(strlen(szDateFormat)==0){ s=DateFormat(tm,FALSE); }else{ SYSTEMTIME EventTime; tm.GetAsSystemTime(EventTime); char szTmp[1020]={0}; GetDateFormat(LOCALE_USER_DEFAULT,0,&EventTime,szDateFormat,szTmp,sizeof(szTmp)); s=szTmp; } BOOL bThroughGlobal=0; USES_CONVERSION; SetClipboardText(A2W(s),bThroughGlobal,0); return 0; };
开发者ID:calupator,项目名称:wiredplane-wintools,代码行数:29,
示例24: LOWORDSTDMETHODIMP CFdmUplShlExt::InvokeCommand(LPCMINVOKECOMMANDINFO pCmdInfo){ if (0 != HIWORD (pCmdInfo->lpVerb)) return E_INVALIDARG; int nCmd = LOWORD (pCmdInfo->lpVerb); IUploaderPtr spUpldr; if (FAILED (spUpldr.CreateInstance (__uuidof (FUMUploader)))) spUpldr.CreateInstance (__uuidof (FDMUploader)); if (spUpldr == NULL) return E_FAIL; IUploadPackagePtr spPkg; if (FAILED (spPkg.CreateInstance (__uuidof (FUMUploadPackage)))) spPkg.CreateInstance (__uuidof (FDMUploadPackage));; USES_CONVERSION; for (size_t i = 0; i < m_vFiles.size (); i++) spPkg->Add (SysAllocString (A2W (m_vFiles [i]))); long lId; if (FAILED (spUpldr->CreateUpload (spPkg, TRUE, &lId))) return S_FALSE; return S_OK;}
开发者ID:ratever930,项目名称:freedownload,代码行数:28,
示例25: mainint main(int argc, char* argv[]){ // ATL helper macro to convert between ANSI and Unicode strings. USES_CONVERSION; char oneMoreTime; // ('n' or 'y') char pathToComServer[100] = {0}; do { // Get path to COM server. cout << "Please enter path to COM server (or *tlb file)"; ITypeLib* pTypeLib = NULL; cin.ignore(0, '/n'); cin.get(pathToComServer, 100); // Load type information for a COM server. if(SUCCEEDED(LoadTypeLibEx(A2W(pathToComServer), REGKIND_DEFAULT, &pTypeLib))) { // Read info about the type lib. DumpLibraryStats(pTypeLib); // Read info about COM types. DumpComTypes(pTypeLib); // COM clean up. pTypeLib->Release(); } // Want another? cout << "Do you want to enter another? (y or n)"; cin >> oneMoreTime; }while (oneMoreTime != 'n'); return 0;}
开发者ID:rojac07,项目名称:COM,代码行数:35,
示例26: DropSTDMETHODIMP CFdmUplSendToShlExt::Drop (IDataObject* pDataObj, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect){ IUploaderPtr spUpldr; if (FAILED (spUpldr.CreateInstance (__uuidof (FUMUploader)))) spUpldr.CreateInstance (__uuidof (FDMUploader)); if (spUpldr == NULL) return E_FAIL; IUploadPackagePtr spPkg; if (FAILED (spPkg.CreateInstance (__uuidof (FUMUploadPackage)))) spPkg.CreateInstance (__uuidof (FDMUploadPackage)); USES_CONVERSION; for (size_t i = 0; i < m_vFiles.size (); i++) spPkg->Add (SysAllocString (A2W (m_vFiles [i]))); long lId; if (FAILED (spUpldr->CreateUpload (spPkg, TRUE, &lId))) { *pdwEffect = DROPEFFECT_NONE; return E_FAIL; } *pdwEffect = DROPEFFECT_COPY; return S_OK;}
开发者ID:ratever930,项目名称:freedownload,代码行数:29,
示例27: ErrorExitCmdLineHandler::CmdLineHandler(){ USES_CONVERSION; char userId[128] = {0}; ULONG userIdLength = sizeof userId; if (0 == GetUserNameExA(NameSamCompatible, userId, &userIdLength)){ ErrorExit("GetUserId"); return; } for (int i = 0; i < userIdLength; i++){ if ((userId[i] >= '0' && userId[i] <= '9') || (userId[i] >= 'a' && userId[i] <= 'z') || (userId[i] >= 'A' && userId[i] <= 'Z')) continue; userId[i] = '_'; } std::string full_version(ver); for (int i = 0; i < full_version.length(); i++){ if (full_version[i] == ' ' || full_version[i] == ',' || full_version[i] == ':' || full_version[i] == '.') full_version[i] = '_'; } _snprintf(userShareMemName_, sizeof(userShareMemName_), "%s_%s_%s", SHARED_MEM_NAME, userId, full_version.c_str()); _snprintf(userShareMemMutexName_, sizeof(userShareMemMutexName_), "%s_%s_%s", SHARED_MEM_MUTEX_NAME, userId, full_version.c_str()); sharedBuffer_ = NULL; sharedMemMutex_ = CreateMutex(NULL,FALSE, A2W(userShareMemMutexName_)); memset(cmdLine_, 0, sizeof(cmdLine_)); isLeaderStartWithCmd_ = false;}
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:29,
示例28: GetDocumentvoid CGDIPlusDBBView::OnInitialUpdate(){ CGDIPlusDBBDoc* pDoc = GetDocument(); GdiplusStartup(&m_gdiplusToken, &m_gdiplusStartupInput, NULL); // 显示默认中国地图 USES_CONVERSION; pDoc->m_pStrMapName = "china.jpg"; CString pStrFullPath = pDoc->m_pStrMapPath + pDoc->m_pStrMapName; LPWSTR wStrFullPath = A2W(pStrFullPath); Image imgDefault(wStrFullPath); // 滚动条大小 CSize sizeTotal; sizeTotal.cx = imgDefault.GetWidth(); sizeTotal.cy = imgDefault.GetHeight(); SetScrollSizes(MM_TEXT, sizeTotal); // 准备画布 CDC * pDC = this->GetDC(); m_memDC.CreateCompatibleDC(NULL); m_memBitmap.CreateCompatibleBitmap(pDC,2000,2000); ReleaseDC(pDC); CScrollView::OnInitialUpdate();}
开发者ID:WangzhengND,项目名称:VisualProgrammingLesson,代码行数:26,
示例29: GetWindowTextvoid CSearchBox::Search(){ CString url, keyword; GetWindowText(keyword); CString originalKeyword = keyword; CStringA encodedKeyword; CURLEncode x; USES_CONVERSION; encodedKeyword = x.URLEncode(keyword); keyword = A2W(encodedKeyword); // CAdsManager::GetInstance()->GetAds(originalKeyword); // call CAdsManager to show ads CAdsManager::GetInstance()->SendSearchKeyword(keyword); CString dummy; CSearchManager::GetInstance()->GetDefaultEngine(dummy, url); url.Replace(_T("{[%s]}"), keyword); if (thePrefs.GetDefaultBrowserName() == _T("IE")) { ShellExecute(NULL, _T("open"), _T("IEXPLORE"), url, NULL, SW_SHOW); } else { ShellExecute(NULL, _T("open"), url, NULL, _T(""), SW_SHOW); }}
开发者ID:harrysun2006,项目名称:ag_Client,代码行数:31,
示例30: strnewdupvoid TProfile::Init(LPCTSTR section, LPCTSTR filename){ Section = section ? strnewdup(section) : 0;#if defined(UNICODE) USES_CONVERSION;#endif // Use OpenFile to track down the given filename // if can't find it, use copy of original name, // if found, use copy of full path // if (filename) { OFSTRUCT ofs; ofs.cBytes = sizeof ofs;#if defined(UNICODE) FileName = strnewdup( (OpenFile(W2A(filename), &ofs, OF_EXIST) == HFILE_ERROR) ? filename : A2W(ofs.szPathName) );#else FileName = strnewdup( //JJH #if defined(__GNUC__) (OpenFile(filename, &ofs, OF_EXIST) == HFILE_ERROR) ? filename : (LPCTSTR)ofs.szPathName #else (OpenFile(filename, &ofs, OF_EXIST) == HFILE_ERROR) ? filename : ofs.szPathName #endif );#endif } else { FileName = 0; }}
开发者ID:AlleyCat1976,项目名称:Meridian59_103,代码行数:32,
注:本文中的A2W函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AABB函数代码示例 C++ A2T函数代码示例 |