[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1132
  • Last Modified:

error PRJ0019: while building com project

I got a dll component created from another company (the person that created it is not available now) and I cant compile it. It contains a C++ DLL and C# GUI which uses the dll.when I build the app I get the fallowing errors

Warning      2      The referenced component 'PDBVIEWERAXLib' could not be found.       
Error      4      error PRJ0019: A tool returned an error code from "Performing registration"      PDBViewerAX      
Error      6      The type or namespace name 'AxPDBVIEWERAXLib' could not be found (are you missing a using directive or an assembly reference?)      C:\Documents and Settings\Trajce\Desktop\diplomska\PDBGUI\Form1.Designer.cs      371      17      PDBGUI
Warning      7      Cannot load type library for reference "AxPDBVIEWERAXLib". Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))      PDBGUI
Warning      8      Cannot load type library for reference "PDBVIEWERAXLib". Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))      PDBGUI



I believe I have problem with the registration of the component, and the Gui doesn't recognize it.
I checked couple solutions, but they didn't provide any help :(

If you need code, or parts of code pls write so I can provide them

Thanks in advance
0
Dimkov
Asked:
Dimkov
  • 24
  • 18
1 Solution
 
DimkovAuthor Commented:
[
@echo off

regsvr32 /s /c "c:\Documents and Settings\Trajce\Desktop\diplomska\ActiveXPDB\Debug\PDBViewerAX.dll"

echo regsvr32 exec. time > ".\Debug\regsvr32.trg"



if errorlevel 1 goto VCReportError

goto VCEnd

:VCReportError

echo Project : error PRJ0019: A tool returned an error code from "Performing registration"

exit 1

:VCEnd
]
0
 
jkrCommented:
Check if "PDBViewerAX.dll" is in the place the above path indicates. If it is, use the Dependency Walker (www.dependencywalker.com) to check if any other module that "PDBViewerAX.dll" relies on is missing or just can't be found.
0
 
DimkovAuthor Commented:
the file is there.when trying to register it with regsvr32 it said it cant load library "PDBViewerAX.dll"
with dependency walker I get this:

Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

but i expect it is because I don't have MSJAVA.DLL

I export:
DllCanUnloadNow
DllGetClassObject
DllRegisterServer
DllUnregisterServer
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
jkrCommented:
Are these functions exported without C++ name decoration, i.e. either via a .def file or as

extern "C" __declspec(dllexport) DllRegisterServer(void);

?
0
 
DimkovAuthor Commented:
via a def file:

LIBRARY      "PDBViewerAX.DLL"

EXPORTS
      DllCanUnloadNow        PRIVATE
      DllGetClassObject        PRIVATE
      DllRegisterServer         PRIVATE
      DllUnregisterServer       PRIVATE

previously it was


LIBRARY      "PDBViewerAXPS"

DESCRIPTION  'Proxy/Stub DLL'

EXPORTS
      DllGetClassObject       @1      PRIVATE
      DllCanUnloadNow         @2      PRIVATE
      GetProxyDllInfo         @3      PRIVATE
      DllRegisterServer            @4      PRIVATE
      DllUnregisterServer            @5      PRIVATE

but I changed it hoping i will fix the problem

DllRegisterServer is defined as:

STDAPI DllRegisterServer(void)
{
    // registers object, typelib and all interfaces in typelib
    return _Module.RegisterServer(TRUE);
}

in previous solution you asked RegisterServer to be with false, but here I must register the component, and when compiled with false still gives the same error
0
 
jkrCommented:
Does the Dependency Walker display the names correctly?
0
 
DimkovAuthor Commented:
Jkr, I used dependency walker on regsvr32 with this dll as parametar and here are the errors:



DllMain(0x77D40000, DLL_PROCESS_ATTACH, 0x0007FD30) in "USER32.DLL" called.
LoadLibraryW("9") called from "USER32.DLL" at address 0x77D753E9.
LoadLibraryW("9") returned NULL. Error: The specified module could not be found (126).



GetProcAddress(0x00000000, "CtfImmCoUninitialize") called from "MSCTF.DLL" at address 0x7472279F and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x00000000, "CtfImmLastEnabledWndDestroy") called from "MSCTF.DLL" at address 0x747227DC and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x00000000, "CtfImmSetCiceroStartInThread") called from "MSCTF.DLL" at address 0x7472281F and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x00000000, "CtfImmIsCiceroStartedInThread") called from "MSCTF.DLL" at address 0x74722864 and returned NULL. Error: The specified procedure could not be found (127).

and many more from this dll were not found

LoadLibraryExW("PDBViewerAX.dll", 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: The specified procedure could not be found (127).

GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsAlloc") called from "MSVCR71.DLL" at address 0x7C341950 and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsGetValue") called from "MSVCR71.DLL" at address 0x7C34195D and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsSetValue") called from "MSVCR71.DLL" at address 0x7C34196A and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsFree") called from "MSVCR71.DLL" at address 0x7C341977 and returned NULL. Error: The specified procedure could not be found (127).
0
 
jkrCommented:
OK,

>>LoadLibraryW("9") called from "USER32.DLL" at address 0x77D753E9

is *really* odd as well as the NULL parameter in

>>GetProcAddress(0x00000000, "CtfImmCoUninitialize")

What other stuff does your DLL link to?
0
 
DimkovAuthor Commented:
the pdbviewerax.dll links the fallowing dlls:

wininet.dll
opengl32.dll (which is colored red)
glu32.dll
kernel32.dll
user32.dll
gdi32.dll
advapi32.dll
ole32.dll
oleaut32.dll

is it possible there is some problem in the code, like bad exporting of class or function or interface?
0
 
jkrCommented:
Sorry, I guess I was not clear - the DLL in the above (MSCTF.DLL) seems to be long to some Office (2003? XP?) helpers, so that probably is quite unrelated. Anything more in the output?
0
 
DimkovAuthor Commented:
should I post the whole log on the
regsvr32.exe pdbviewerax.dll?
it is about 5 pages
0
 
jkrCommented:
Mabe not here, but you will find a list of free web space at http://www.ghacks.net/2006/06/01/free-file-host-list-june-2006/
0
 
DimkovAuthor Commented:
http://rapidshare.com/files/47388054/log.doc.html

If needed, I can give you the solution in zip (about 8mb) to see. I own the rights and I can share it... just to fix this hell problem
0
 
jkrCommented:
Um, does that have to be '.doc'? Anyway, the problem seems to be in

LoadLibraryExW("PDBViewerAX.dll", 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: The specified procedure could not be found (127).

Did yo uspecify the full path to your DLL?
0
 
DimkovAuthor Commented:
i wrote:

cd C:\Documents and Settings\Trajce\Desktop\diplomska\ActiveXPDB\Debug
regsvr32 PDBViewerAX.dll

and get message

LoadLibrary("PDBViewerAx.dl") failed  - the specified procedure could not be found

possible error in the code?


0
 
jkrCommented:
Hm, have you tried setting C:\Documents and Settings\Trajce\Desktop\diplomska\ActiveXPDB\Debug as the "Working Directory" for Profiling?
0
 
DimkovAuthor Commented:
yes
that is the starting directory,and PDBViewerAX.dll is in program arguments
0
 
DimkovAuthor Commented:
since it is looking at address 0X0000 is it possible there is problem in the code, it is a wild guess..
thank you for your patience
0
 
DimkovAuthor Commented:
jkr please don't give up on me... you have the most points of all, if you can't solve this error noone can
0
 
jkrCommented:
>>please don't give up on me...

Don't worry, just some things to handle in RL ;o)

The NULL parameter here is not the problem, as with 'LoadLibraryExW()', that one is documented as "reserved, must be NULL"

What happens if you try to denug that process (set "Exectuable for Debugging session to 'regsvr32.exe', the working directory, etc.)?
0
 
DimkovAuthor Commented:
i dont quite understand:

i removed the gui project, and run only the dll.
in properties/debugging

as command I entered C:\WINDOWS\system32\regsvr32.exe
as working directory C:\Documents and Settings\Trajce\Desktop\diplomska\ActiveXPDB\Debug
as command arguments  pdbviewerax.dll

when running, first it told me that regsvr32.exe has no debug info
. when clicking OK, it gave me the same message:
LoadLibrary("PDBViewerAx.dll") failed  - the specified procedure could not be found
0
 
DimkovAuthor Commented:
does this look fine?


CComModule _Module;

BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_PDB, CBMPDB)
OBJECT_ENTRY(CLSID_SimPDB, CSimPDB)
END_OBJECT_MAP()
0
 
jkrCommented:
>>does this look fine?

Yes.

Do you still get the same when you use

C:\WINDOWS\system32\regsvr32.exe "C:\Documents and Settings\Trajce\Desktop\diplomska\ActiveXPDB\Debug\pdbviewerax.dll"

?
0
 
DimkovAuthor Commented:
it returned:
LoadLibrary("C:\Documents and Settings\Trajce\Desktop\diplomska\ActiveXPDB\Debug\pdbviewerax.dll") failed. The specified procedure could not be found
:(
0
 
jkrCommented:
OK, just to be sure - what's the output of

dumpbin /exports "C:\Documents and Settings\Trajce\Desktop\diplomska\ActiveXPDB\Debug\pdbviewerax.dll"

?
0
 
DimkovAuthor Commented:
File Type: DLL

  Section contains the following exports for PDBViewerAX.DLL

    00000000 characteristics
    46B80654 time date stamp Tue Aug 07 07:42:44 2007
        0.00 version
           1 ordinal base
           4 number of functions
           4 number of names

    ordinal hint RVA      name

               1    0 0005CD89 DllCanUnloadNow = @ILT+3460(_DllCanUnloadNow@0)
          2    1 0005DA7C DllGetClassObject = @ILT+6775(_DllGetClassObject@12)
          3    2 0005F5D9 DllRegisterServer = @ILT+13780(_DllRegisterServer@0)
          4    3 0005DAB8 DllUnregisterServer = @ILT+6835(_DllUnregisterServer@0
)

  Summary

        6000 .data
        3000 .idata
       27000 .rdata
        9000 .reloc
        4000 .rsrc
       C0000 .text
       5B000 .textbss
0
 
jkrCommented:
'@ILT' (referring to the "Import Link Table", see http://www.windowsitlibrary.com/Content/356/11/4.html) draws my attention here. Could you  give it a try again to not use a .def file ans export the functions as

extern "C" __declspec(dllexport) DllRegisterServer(void);

etc.?
0
 
jkrCommented:
.. or at least add '__declspec(dllexport)' to your current code?
0
 
DimkovAuthor Commented:
I got these errors:

Error      4      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      c:\documents and settings\trajce\desktop\diplomska\activexpdb\pdbviewerax.cpp      45      
Error      5      error C2556: 'int DllCanUnloadNow(void)' : overloaded function differs only by return type from 'HRESULT DllCanUnloadNow(void)'      c:\documents and settings\trajce\desktop\diplomska\activexpdb\pdbviewerax.cpp      45      
Error      6      error C2373: 'DllCanUnloadNow' : redefinition; different type modifiers      c:\documents and settings\trajce\desktop\diplomska\activexpdb\pdbviewerax.cpp      45      

when I went to .h file I couldn't find the functions.
When I did search through the entire solution, it found it only in the .def
I removed .def from the project properties-linking-input-module definition file
0
 
jkrCommented:
Sorry, that should have been


extern "C" __declspec(dllexport) HRESULT DllRegisterServer(void);
0
 
DimkovAuthor Commented:
Error      4      error C2373: 'DllCanUnloadNow' : redefinition; different type modifiers      c:\documents and settings\trajce\desktop\diplomska\activexpdb\pdbviewerax.cpp      45      

I tried to fix the error by deleting the .def file, but it didn't help
I searched for DllCanUnloadNow in the whole solution, but it was not found, not even in the pdbviewerax.h file
0
 
jkrCommented:
Just for testing purposes, uncomment the code of 'DllCanUnloadNow()', it is not needed for registration.
0
 
DimkovAuthor Commented:
this happens to all of the functions. i wrote the errors connected just for this function to reduce the size of my post...
0
 
jkrCommented:
OK, let's check the .def issue. I used 'dumpbin' on one of my working COM servers, the output should look like

File Type: DLL

  Section contains the following exports for bovda3ge.dll

           0 characteristics
    3D7DF6AB time date stamp Tue Sep 10 15:42:03 2002
        0.00 version
           2 ordinal base
           6 number of functions
           6 number of names

    ordinal hint RVA      name

          2    2 00001320 DllCanUnloadNow
          3    3 00001330 DllGetClassObject
          4    4 00001080 DllRegisterServer
          5    5 000011A0 DllUnregisterServer

  Summary

        1000 .data
        2000 .rdata
        1000 .reloc
        1000 .rsrc
        6000 .text

The corresponding .def file was

EXPORTS
    ; Explicit exports can go here
    DllCanUnloadNow             @2 PRIVATE          ;DLL unloading
    DllGetClassObject           @3 PRIVATE          ;Component object model
    DllRegisterServer           @4 PRIVATE          ;Component object model
    DllUnregisterServer         @5 PRIVATE          ;Component object model

Can you modify your .def file by adding the EXPORTS section from above?
0
 
DimkovAuthor Commented:
I did it both times: first time with the original def I was given:


LIBRARY      "PDBViewerAXPS"

DESCRIPTION  'Proxy/Stub DLL'

EXPORTS
      DllGetClassObject       @1      PRIVATE
      DllCanUnloadNow         @2      PRIVATE
      GetProxyDllInfo         @3      PRIVATE
      DllRegisterServer            @4      PRIVATE
      DllUnregisterServer            @5      PRIVATE

and the second time with yours:

LIBRARY      "PDBViewerAXPS"

DESCRIPTION  'Proxy/Stub DLL'

EXPORTS
    ; Explicit exports can go here
    DllCanUnloadNow             @2 PRIVATE        ;DLL unloading
    DllGetClassObject           @3 PRIVATE          ;Component object model
    DllRegisterServer           @4 PRIVATE           ;Component object model
    DllUnregisterServer         @5 PRIVATE          ;Component object model


File Type: DLL

  Section contains the following exports for PDBViewerAX.DLL

    00000000 characteristics
    46B8C412 time date stamp Tue Aug 07 21:12:18 2007
        0.00 version
           1 ordinal base
           4 number of functions
           4 number of names

    ordinal hint RVA      name

          1    0 0005CD89 DllCanUnloadNow = @ILT+3460(_DllCanUnloadNow@0)
          2    1 0005DA7C DllGetClassObject = @ILT+6775(_DllGetClassObject@12)
          3    2 0005F5D9 DllRegisterServer = @ILT+13780(_DllRegisterServer@0)
          4    3 0005DAB8 DllUnregisterServer = @ILT+6835(_DllUnregisterServer@0
)

  Summary

        6000 .data
        3000 .idata
       27000 .rdata
        9000 .reloc
        4000 .rsrc
       C0000 .text
       5B000 .textbss

C:\Program Files\Microsoft Visual Studio 8\VC>dumpbin /exports "C:\Documents and
 Settings\Trajce\Desktop\diplomska\ActiveXPDB\Debug\pdbviewerax.dll"
Microsoft (R) COFF/PE Dumper Version 8.00.50727.762
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file C:\Documents and Settings\Trajce\Desktop\diplomska\ActiveXPDB\Debug
\pdbviewerax.dll

File Type: DLL

  Section contains the following exports for PDBViewerAX.DLL

    00000000 characteristics
    46B8C4FD time date stamp Tue Aug 07 21:16:13 2007
        0.00 version
           1 ordinal base
           4 number of functions
           4 number of names

    ordinal hint RVA      name

          1    0 0005CD89 DllCanUnloadNow = @ILT+3460(_DllCanUnloadNow@0)
          2    1 0005DA7C DllGetClassObject = @ILT+6775(_DllGetClassObject@12)
          3    2 0005F5D9 DllRegisterServer = @ILT+13780(_DllRegisterServer@0)
          4    3 0005DAB8 DllUnregisterServer = @ILT+6835(_DllUnregisterServer@0
)

  Summary

        6000 .data
        3000 .idata
       27000 .rdata
        9000 .reloc
        4000 .rsrc
       C0000 .text
       5B000 .textbss

is it possible the problem to be that it is proxy/stub (which I am not sure what it means)
or the name of the library:LIBRARY      "PDBViewerAXPS"

I also noticed the dumps are the same
0
 
jkrCommented:
The 'DESCRIPTION' part is not relevant, it is just what the name says. Anyway, does it register with the alternative .def?
0
 
DimkovAuthor Commented:
no, it gives the same error
0
 
DimkovAuthor Commented:
Jkr, this is what i do:
I created a new project, and I am inserting each class one by one(and copy/paste the code inside). After every insertion i rebuild the project.
The first problem arrived after one class was inserted
it gave me the error:

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

I removed all the code in the functions, and the program worked. Then I started adding function by function and rebuild on every add.


After using in one of the functions

      if ((pixelformat = ChoosePixelFormat(m_hDC, ppfd)) == 0 )
            return false;

I get this error.
0
 
DimkovAuthor Commented:
and yes, I am the computer administrator on this computer.
Also in this class it is the first time I use

#include <gl/gl.h>
#include <gl/glu.h>
i have added the dlls and libs in res, and added this directory
0
 
jkrCommented:
Check with RegMon (http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/Regmon.mspx) if that is really a registry permission problem. This is getting quite weird...
0
 
DimkovAuthor Commented:
fixed the previous problem... it seems glut32.lib was older version then the dll.
continuing with copy paste...
0
 
DimkovAuthor Commented:
After manually adding all the classes and all the files
it finally works.

Thank you for your help Jkr.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 24
  • 18
Tackle projects and never again get stuck behind a technical roadblock.
Join Now