一段QQ即时聊天的MFC代码

来源:百度知道 编辑:UC知道 时间:2024/05/11 03:54:07
void CMy324Dlg::OnButton1()
{
CString i="tencent://message/?uin=" + m_qq; //m_qq为编辑框的变量
ShellExecute(NULL,"open","IEXPLORE",i,NULL,SW_SHOWMAXIMIZED); //调用IE,打开上面的地址
}

为什么会无法实现? 记得昨天还可以,,今天却莫名其妙的不行了...

ShellExecute(NULL,"open","http://www.baidu.com/",NULL,NULL,SW_SHOWMAXIMIZED);
参数写错了
ShellExecute(NULL,"open","IEXPLORE",i,NULL,SW_SHOWMAXIMIZED); //调用IE,打开上面的地
IEXPLORE可以不要
默认为IE

参考MSDN吧
有关ShellExecute
ShellExecute Function

--------------------------------------------------------------------------------

Performs an operation on a specified file.

Syntax

HINSTANCE ShellExecute( HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
Parameters

hwnd
[in] Handle to the owner window used for displaying a user interface (UI) or error messages. This value can be NULL if the operation is not associated with a window.
lpOperation
[in] Pointer to a null-ter