作者:minyoa
项目:DuiVisio
//{{VCI_IMPLEMENT_BEGIN
int 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;
}
作者:gotomyp
项目:eyepatc
void 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);
}
作者:HackLinu
项目:Free-Download-Manager-vs201
void 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 ();
}
作者:Hpark1
项目:FIE
BOOL 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;
}
作者:Williamzuckerber
项目:chtmoneyhu
void 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()) ) );
}
}
作者:eseawin
项目:CNCS_PMC-Conducto
static 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)));
}
作者:Williamzuckerber
项目:chtmoneyhu
int 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);
}
作者:yotamg
项目:ggches
HWND 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);
}
作者:quinsmpan
项目:Tool
void 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);
}
作者:smarine
项目:ags-we
BOOL 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;
}
作者:liuzhume
项目:MapWinGI
// *************************************************************
// 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;
}
作者:YTYOO
项目:eNV
bool 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;
}
作者:sigurdl
项目:FirstProject
ErrorCode 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
}
作者:bahamut834
项目:xkcod
NetUsage::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));
}
作者:AlexS217
项目:IVR
STDMETHODIMP 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;
}
作者:HackLinu
项目:Free-Download-Manager-vs201
BOOL 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());
}
作者:bea23
项目:CGTask
void 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);
}
作者:hkaise
项目:TRiA
HRESULT 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);
}
作者:yotamg
项目:ggches
BOOL 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);
}
作者:0989
项目:javascript-joystic
STDMETHODIMP CJoystickCtl::getProductName(BSTR *pName) {
USES_CONVERSION;
char* name = stick.getProductName();
CComBSTR wName = A2W(name);
*pName = wName.Detach();
return S_OK;
}