|
摘抄文章为什么不好使??
[U]让你的ARX程序自动加载[/U]
void Regiter(LPCTSTR lpszMyAppName)
{
CString strKeyPos=::acrxProductKey()+CString(_T(""));
//下边函数的第一个参数:AcadApp::kOnCommandInvocation,是调用你的命令时自动加载
::acrxRegisterApp(AcadApp::kOnCommandInvocation,lpszMyAppName,strKeyPos,2);
CRegKey regKey;
if(regKey.Create(HKEY_LOCAL_MACHINE,strKeyPos+_T(")
{
CRegKey regSubKey;
if(regSubKey.Create(regKey,_T("Commands"))==ERROR_SUCCESS)
{
regSubKey.SetValue("E:\\刘万辉程序相关源代码");
//一直加加到你的命令加完为止
regSubKey.Close();
}
if(regSubKey.Create(regKey,_T("Loader"))==ERROR_SUCCESS)
{
regSubKey.SetValue(acedGetAppName(),_T("MODULE"));
regSubKey.Close();
}
if(regSubKey.Create(regKey,_T("Name"))==ERROR_SUCCESS)
{
regSubKey.SetValue(lpszMyAppName,lpszMyAppName);
regSubKey.Close();
}
regKey.Close();
}
}
//将上边那个函数放在AcRx::kInitAppMsg消息处,当然你的ARX至少要运行一次才行。
//-----------------------------------------------------------------------------------------本帖以下内容被隐藏保护;需要你回复后,才能看到! 游客,如果您要查看本帖隐藏内容请 回复 |
|