lwh-1234 发表于 2004-9-24 10:00:00

请问:如何把编译好的arx应用直接加载到autoacd中?

摘抄文章为什么不好使??
让你的ARX程序自动加载
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至少要运行一次才行。
//-----------------------------------------------------------------------------------------**** Hidden Message *****

easypower 发表于 2004-9-24 11:27:00

送上鲜花一朵:)

dipenghao 发表于 2004-9-25 11:33:00

高手,佩服

dipenghao 发表于 2004-9-26 08:06:00

我第一次运行的时候可以,以后启动AutoCAD有点问题。还的用appload命令加载arx,不知这样做和放到启动组里面有什么区别
页: [1]
查看完整版本: 请问:如何把编译好的arx应用直接加载到autoacd中?