none
error PRJ0050: Failed to register output.

    Question

  • Hi,

    I am new to VC++ and just tried to replicate customer problem. They are creating custom application by using our SDK(VC++ DLL) and facing the below error. I created a Fresh VC++ MFC DLL Project in MS-Visual Studio 2008 without referring to our SDK DLL. Then I set the Register Output option to Yes from Project properties->Configuration properties->Linker->General section. When I rebuild the project it gives me below mentioned error.

    error PRJ0050: Failed to register output. Please ensure you have the appropriate permissions to modify the registry.

    I tried running the MS-Visual Studio in Administrator a/c but is still giving the same error. What is going wrong? Am I doing something wrong?

    I appreciate your inputs.


    Regards, Jignesh
    • Edited by jdp12383 Friday, November 4, 2011 5:27 AM
    Friday, November 4, 2011 5:26 AM

Answers

  • Is it possible that if the current SDK DLL dependes on other SDK DLL which user has not referred lead to this PRJ0050 error?
    Regards, Jignesh
    • Marked as answer by jdp12383 Tuesday, November 15, 2011 7:22 AM
    Wednesday, November 9, 2011 10:40 AM

All replies

  • From what you are sysing you created a COM DLL. There is no sense to registering a non COM DLL. Is this correct your DLL is a COM DLL?

    If you have a COM DLL, than you could check the registration process using the debugger and starting your DLL with "Regsvr32 /i yourdllname".

    Friday, November 4, 2011 9:00 AM
  • Thanks Bordon for your reply,

    Sorry, but I am new to this VC++ world.

    1. How can I find that DLL is a COM DLL? I just created a fresh project and set the Register Output option.

    2. Is Register Output options only works for COM DLL and gives that error if DLL is not COM DLL?

    3. What are the possibilities that can generate this error? Customer claims that they just replaced the previous version of SDK file with new one and this error. If they roll it back then it doesn't give this error.

    I appreciate your guidance in this regard.


    Regards, Jignesh
    • Edited by jdp12383 Friday, November 4, 2011 9:32 AM
    Friday, November 4, 2011 9:16 AM
  • It depend on the option you used during the creation your DLL project. In general you should not have a COM DLL.

    If you check in the Class view the "global functions and variables" than a COM DLL should have 4 global functions:

    DllCanUnloaDnow

    DllGetclassObject

    DllRegister

    DllUnregister

    Normal DLLs does not need any registration. COM DLLs may be registered if you have a NON regfree COM DLL.

    You can also check if your DLL has the 4 named exported functions using DependencyWalker:

    http://www.dependencywalker.com/


    • Edited by Bordon Friday, November 4, 2011 10:25 AM
    Friday, November 4, 2011 10:17 AM
  • Thanks Bordon. This is going to be a great learning session for me.

    I checked the Class view of the project and the Global Functions and Variables section is empty. I think it is because its a fresh project.

    I also checked my project dll with Dependency Walker for the above listed functions but none of them is there. Actually I used the profiling feature of the tool and passed my dll as argument and found one fail enrty.

    GetProcAddress(0x10000000 [TEST.DLL], "DllRegisterServer") called from "REGSVR32.EXE" at address 0x01001EA0 and returned NULL. Error: The specified procedure could not be found (127).

    I have few questions,

    1. I guess PRJ0050 error is coming because my project does not include any of above Dll* functions. Register Output options is not working due to that and it should be set to No? I can set it to Yes only if my dll is COM DLL. Am I correct?

    2. What can I do if I want to make it COM DLL?

    I really appreciate your guidance.


    Regards, Jignesh
    Friday, November 4, 2011 11:40 AM
  • Regarding your first question:

    If you do not have a COM DLL than there is no reason for registering something. Therefore it sould be set to "No".

    Regarding your 2nd question:

    If you create a COM DLL (mostly I do ATL / MFC) COM DLLs you may need the regitering frature. I never used this. I registered the COM DLL using RegSvr32 by myself. It is mostly necessary only one times. The automatic registering feature maybemakes sense if you have a bunch of COM classes in your DLL and you are adding a lot interfaces over the time and you do not want to register all this interfaces by yourself.

    Like I said, when I need a COM DLL I create a normal MFC DLL and than I add a ATL COM+ component. I'm to lazy to do everything by hand therfore I go the MFC / ATL way. I'm a little oldfashioned in this way and I do not create COM DLLs all the day only sometimes. Therefore I do a COM DLL this way. Other ways may be better, but for ME it is the best to have a fast result.

    Friday, November 4, 2011 11:51 AM
  • Thanks again Bordon.

    I am able to understand it now. As you mentioned I quickly created a ATL project and checked the two things you told me to do earlier.

    Global Functions and Variables section is empty but when I tried it with Dependency Walker it showed me a successful registration message. I checked for the functions list you gave and none of them found. However I noticed that the DllRegisterServer entry which was failing with other dll it is successfully executed now. Also I noted down that the auto generated code below of the project which performs the registering and un-registering operations.

    if (bInstall)
    {	
        hr = DllRegisterServer();
        if (FAILED(hr))
        {	
        	DllUnregisterServer();
        }
    }
    else
    {
        hr = DllUnregisterServer();
    }
    


    But I am thinking about the problem that our customer is facing. What went wrong with them that they receive PRJ0050 error if they replace with new SDK DLL (is not COM DLL, Thanks to you I can say that now) and if roll back error gone? They say that its a COM DLL.

    I appreciate.


    Regards, Jignesh
    Friday, November 4, 2011 12:16 PM
  • I guess the question should be why are the customers trying to register a DLL if it is not a COM DLL?

    Maybe the old DLL contained the required functions like DllRegisterServer, even though it does not use COM. This is certainly possible, although it would be pointless (except for maybe eliminating customer confusion).

    In Visual Basic all DLLs are COM DLLs, so VB folks often have the mistaken notion that all DLLs are COM DLLs.

    Friday, November 4, 2011 12:55 PM
  • Thanks Scott McPhillips for your inputs.

    Actually our SDK DLL is not COM DLL. But they have made their VC++ project (Which outputs COM DLL) and using our SDK DLL as Additional Library. Hope this clarifies the main question.

    They say that they just replaced our SDK DLL and have PRJ0050 error. If they roll back with our old version SDK DLL then it does not give PRJ0050 error.

    What should be there which gives such behavior?


    Regards, Jignesh
    Friday, November 4, 2011 1:11 PM
  • They say that they just replaced our SDK DLL and have PRJ0050 error. If they roll back with our old version SDK DLL then it does not give PRJ0050 error.
    Does your "new" SDK DLL exports DllRegisterServer? And does your old DLL exports this function.
    Friday, November 4, 2011 3:44 PM
  • Thanks Bordon for your continuous guidance. I appreciate.

    No. Neither current SDK DLL nor old exports DllRegisterServer. We just add new APIs function name in .def file, declaration in .h file and definition in .cpp file to export it.


    Regards, Jignesh
    Monday, November 7, 2011 5:03 AM
  • Is it possible that if the current SDK DLL dependes on other SDK DLL which user has not referred lead to this PRJ0050 error?
    Regards, Jignesh
    • Marked as answer by jdp12383 Tuesday, November 15, 2011 7:22 AM
    Wednesday, November 9, 2011 10:40 AM