您的位置:首页 > 大数据 > 人工智能

Error PRJ0050 - Failed to register output - Ensure you have permissions to modify the registry

2011-04-25 14:29 344 查看
This nasty looking error, you might get under VS 2005, often maybe more annoying than harmful. The scenario I describe below may not account for all occurrences of this error, but it might be rather frequent. When you start a project in most cases you rely on the wizard, and when building a COM component, the wizard will create and add an idl file to your project, and generate internal command to invoke MIDL compiler to produce a type library. Some developers don't always need the type library, or even the idl, because their component is specialized and don't need to be advertised to the general COM public. Thus, they may remove those. However, the wizard generated DllRegisterServer() function calls the module's DllRegisterServer() without specifying an argument for the optional BOOL bRegTypeLib, which then assumes its default value of TRUE. As a consequence, when RegSvr32.exe is invoked by the VS build tool, it tries to register also the type library, after registering the module's COM objects. The ATL code tries to locate the type library first inside the dll, and if that fails by locating the tlb file with the root name identical to the binary module. I have read some developers complain that the error may popup sometime and sometime not. It maybe that the tlb file might have been lingering in the folder from the previous compilations and thus was found. In any case to fix the problem provide explicitly FALSE as the argument to both DllRegisterServer(FALSE) and DllUnregisterServer(FALSE), if you don't have the type library.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐