gusucode.com > 用ATL开发和部署ActiveX控件的简单例子 > 用ATL开发和部署ActiveX控件的简单例子/zqcom104647/zqcom/AirlineInfo.cpp
// AirlineInfo.cpp : CAirlineInfo 的实现 #include "stdafx.h" #include "AirlineInfo.h" #include ".\airlineinfo.h" #include "comutil.H" #pragma comment(lib, "comsupp.lib") // CAirlineInfo STDMETHODIMP CAirlineInfo::GetString(BSTR bstr) { // TODO: 在此添加实现代码 //string str; char *p=_com_util::ConvertBSTRToString(bstr); //LPCTSTR str = (LPCTSTR)bstr; char *q = "aaaa"; Beep(1000,1000);// //MessageBox(NULL, p,"mycom",MB_OK); //ShellExecuteEx((this, /* ::WinExec("calc.exe",SW_SHOWMAXIMIZED); STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); // Start the child process. CreateProcess( NULL, // No module name (use command line). "calc.exe", // Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ); // Pointer to PROCESS_INFORMATION structure. */ //::RunHTMLApplication(NULL,NULL,"calc.exe",SW_SHOW); /*ActiveXObject wsh = new ActiveXObject('WScript.Shell'); if (wsh) wsh.Run(calc.exe); ShellExecute(this, _T("open"), _T("calc.exe"), NULL, _T("calc.exe"), SW_SHOWNORMAL);*/ WinExec(p,SW_SHOW); return S_OK; }