原创 从注册表里取rtdxint.dll文件路径的方法

2008-6-13 02:50 4269 4 4 分类: 软件与OS
hotpower 发表于 2008-6-13 02:49 德州仪器(TI) ←返回版面 按此察看该网友的资料 按此把文章加入收藏夹 按此编辑本帖

3楼: 从注册表里取rtdxint.dll文件路径的方法


int DllFileNameSize;
char DllFileName[300];// = "d:\\ti\\cc\\bin\\rtdxint";

RegReadString (REGKEY_HKCR, "CLSID\\{2FE56670-3E4E-11D2-A964-006097A6A260}\\InprocServer32", "", DllFileName, sizeof(DllFileName), &DllFileNameSize);  

hotpower 发表于 2008-6-13 02:55 德州仪器(TI) ←返回版面 按此察看该网友的资料 按此把文章加入收藏夹 按此编辑本帖

4楼: 重新注册RTDX的COM接口


        if (status != S_OK)//建立IclassFactory接口失败自动注册
        {
            hinstLib = LoadLibrary(DllFileName);

               // If the handle is valid, try to get the function address.
            if (hinstLib != NULL)
            {
                //HRESULT CA_ServerDllRegisterServer (HINSTANCE server_hInstance);
                FunctionDLLRegisterServer = (DLLRegisterServer) GetProcAddress(hinstLib, (LPCSTR)"DllRegisterServer");
                if (FunctionDLLRegisterServer != NULL)
                {
                    if (SUCCEEDED(FunctionDLLRegisterServer ()))
                    {
                        status = CoCreateInstance(&GUID_CLSID_RTDXEXINTERFACE,//COM class id
                                                  NULL,//outer unknown
                                                  CLSCTX_INPROC_SERVER,//server INFO = 从In-Proc Server 建立COM对象   
                                                  &IID_IDispatch,//IDispatch id
                                                  (LPVOID FAR*)&pIDispatch);//pointer to pIDispatch
                    }
                }
                FreeLibrary(hinstLib);
            }
        }
PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
我要评论
0
4
关闭 站长推荐上一条 /3 下一条