Problems registering VBPrnDlg.dll 
Author Message
 Problems registering VBPrnDlg.dll

Hi,

I've downloaded this dll from Microsoft, extracted the files (VBPrnDlg.dep,
VBPrnDlg.dll, VBPrnDlg.exp, VBPrnDlg.lib) to windows/system32 and then
"RegSvr32 C:\Windows\System32\VBPrnDlg.dll" to register the dll.

The problem is that I'm receiving an erro message stating that the module
"C:\windows\System32\VBPrnDlg.dll" was loaded but there was a fail with an
error cod 0x80020009.

I've done a search for the error code, but no useful information was found.

Can someone help me with this?

In case this makes any difference, I have Windows Vista Pro.

Thanks for all,

--
Luiz Horacio



Thu, 02 Feb 2012 11:46:54 GMT  
 Problems registering VBPrnDlg.dll

Quote:
> I've downloaded this dll from Microsoft, extracted the files
> (VBPrnDlg.dep, VBPrnDlg.dll, VBPrnDlg.exp, VBPrnDlg.lib)
> to windows/system32 and then "RegSvr32 C:\Windows\
> System32\VBPrnDlg.dll" to register the dll. The problem is
> that I'm receiving an erro message stating that the module
> "C:\windows\System32\VBPrnDlg.dll" was loaded but there
> was a fail with an error cod 0x80020009. I've done a search
> for the error code, but no useful information was found. Can someone help
> me with this? I have Windows Vista Pro.

In order to manually register a DLL in Vista you need to specifically do so
as the administrator or the registration will fail, even if you /are/ the
administrator (it's a Vista thing!). One simple way is to open a DOS window
as administrator and register it from there. Use the Start button / All
Programs and then /right click/ Command Prompt and select Run As
Administrator. Now enter regsvr32 c:\windows\system32\vbprndlg.dll into the
DOS window and press Enter.

Mike



Thu, 02 Feb 2012 15:26:38 GMT  
 Problems registering VBPrnDlg.dll
Oops! In my previous response I said, "Use the Start button / All  Programs
and then /right click/ Command Prompt . . . etc". I actually meant to say:

    Use the Start button / All  Programs / Accessories and
    then /right click/ Command Prompt . . . etc.

Mike



Thu, 02 Feb 2012 15:35:36 GMT  
 Problems registering VBPrnDlg.dll


Quote:
> Hi,

> I've downloaded this dll from Microsoft, extracted the files
> (VBPrnDlg.dep, VBPrnDlg.dll, VBPrnDlg.exp, VBPrnDlg.lib) to
> windows/system32 and then "RegSvr32 C:\Windows\System32\VBPrnDlg.dll" to
> register the dll.

> The problem is that I'm receiving an erro message stating that the module
> "C:\windows\System32\VBPrnDlg.dll" was loaded but there was a fail with an
> error cod 0x80020009.

> I've done a search for the error code, but no useful information was
> found.

> Can someone help me with this?

> In case this makes any difference, I have Windows Vista Pro.

Big difference if you have UAC enabled. Open an elevated command prompt
window by right-clicking the Command Prompt shortcut in the Start Menu and
choosing "Run as administrator". Run regsvr32.exe from this.

--
Mike



Thu, 02 Feb 2012 19:57:04 GMT  
 Problems registering VBPrnDlg.dll
Mouse-free alternative:

Press the Windows key then type "cmd.exe" and then do Ctrl-Shift-Enter.
Alt-C to accept the UAC prompt.


Quote:
> Oops! In my previous response I said, "Use the Start button / All
> Programs and then /right click/ Command Prompt . . . etc". I actually
> meant to say:

>    Use the Start button / All  Programs / Accessories and
>    then /right click/ Command Prompt . . . etc.

> Mike



Thu, 02 Feb 2012 23:39:01 GMT  
 Problems registering VBPrnDlg.dll
Hi MikeD,

Thanks, I got it registered. Nevertheless, I still get a message:

Compile error:
User-defined type not defined

on line:
Dim objprn As New VBPrnDlgLib.PrinterDlg

Any other thing I can do?

Thanks,

Luiz Horacio


Quote:



>> Hi,

>> I've downloaded this dll from Microsoft, extracted the files
>> (VBPrnDlg.dep, VBPrnDlg.dll, VBPrnDlg.exp, VBPrnDlg.lib) to
>> windows/system32 and then "RegSvr32 C:\Windows\System32\VBPrnDlg.dll" to
>> register the dll.

>> The problem is that I'm receiving an erro message stating that the module
>> "C:\windows\System32\VBPrnDlg.dll" was loaded but there was a fail with
>> an error cod 0x80020009.

>> I've done a search for the error code, but no useful information was
>> found.

>> Can someone help me with this?

>> In case this makes any difference, I have Windows Vista Pro.

> Big difference if you have UAC enabled. Open an elevated command prompt
> window by right-clicking the Command Prompt shortcut in the Start Menu and
> choosing "Run as administrator". Run regsvr32.exe from this.

> --
> Mike



Fri, 03 Feb 2012 01:52:01 GMT  
 Problems registering VBPrnDlg.dll
Hi Mike,

Thanks, it worked. Nevertheless, I still get a message:

Compile error:
User-defined type not defined

on line:
Dim objprn As New VBPrnDlgLib.PrinterDlg

Any other thing I can do?

Thanks,

Luiz Horacio



Quote:
> Oops! In my previous response I said, "Use the Start button / All
> Programs and then /right click/ Command Prompt . . . etc". I actually
> meant to say:

>    Use the Start button / All  Programs / Accessories and
>    then /right click/ Command Prompt . . . etc.

> Mike



Fri, 03 Feb 2012 01:50:53 GMT  
 Problems registering VBPrnDlg.dll

Quote:
> Hi Mike, Thanks, it worked. Nevertheless, I still get a message:
> Compile error:
> User-defined type not defined
> on line:
> Dim objprn As New VBPrnDlgLib.PrinterDlg
> Any other thing I can do?

It looks as though you have not set the required reference. In the VB IDE
use the Project / References menu and click the Browse button then navigate
to your Windows/System32 folder (if the Add Reference dialog does not
already default to that folder) and select VBPrnDlg.dll and click the Open
button followed by OK.

Mike



Fri, 03 Feb 2012 02:23:41 GMT  
 Problems registering VBPrnDlg.dll


Quote:
> Hi MikeD,

> Thanks, I got it registered. Nevertheless, I still get a message:

> Compile error:
> User-defined type not defined

> on line:
> Dim objprn As New VBPrnDlgLib.PrinterDlg

> Any other thing I can do?

Did you add a reference to it in your project?

BTW, most people discourage that particular syntax.  Better to do this:

Dim objprn As VBPrnDlgLib.PrinterDlg
Set objprn  = New VBPrnDlgLib.PrinterDlg

The problems with using New in the declaration are that you may
inadvertantly instantiate it when you don't intend to and it adds a little
overhead because every use of the object in your code is wrapped by a check
to see if it's instantiated. It's considered "best practice" to explicitly
instantiate objects yourself rather than let VB do it.

--
Mike



Fri, 03 Feb 2012 06:07:08 GMT  
 Problems registering VBPrnDlg.dll
Hi Mike,

Thanks again.

I tried your solution, but VB hanged.

I tried this in a virtual machine running XP and it worked perfectly, but
not in my own machine which runs Vista.

Is there anything I can do to track the problem?

Thanks for all your patience.

Luiz Horacio



Quote:


>> Hi Mike, Thanks, it worked. Nevertheless, I still get a message:
>> Compile error:
>> User-defined type not defined
>> on line:
>> Dim objprn As New VBPrnDlgLib.PrinterDlg
>> Any other thing I can do?

> It looks as though you have not set the required reference. In the VB IDE
> use the Project / References menu and click the Browse button then
> navigate to your Windows/System32 folder (if the Add Reference dialog does
> not already default to that folder) and select VBPrnDlg.dll and click the
> Open button followed by OK.

> Mike



Fri, 03 Feb 2012 06:06:13 GMT  
 Problems registering VBPrnDlg.dll


Quote:



>> Hi MikeD,

>> Thanks, I got it registered. Nevertheless, I still get a message:

>> Compile error:
>> User-defined type not defined

>> on line:
>> Dim objprn As New VBPrnDlgLib.PrinterDlg

>> Any other thing I can do?

> Did you add a reference to it in your project?

> BTW, most people discourage that particular syntax.  Better to do this:

> Dim objprn As VBPrnDlgLib.PrinterDlg
> Set objprn  = New VBPrnDlgLib.PrinterDlg

> The problems with using New in the declaration are that you may
> inadvertantly instantiate it when you don't intend to and it adds a little
> overhead because every use of the object in your code is wrapped by a
> check to see if it's instantiated. It's considered "best practice" to
> explicitly instantiate objects yourself rather than let VB do it.

> --
> Mike

Hi Luiz,

One thing to mention, in case you have not done it. You must run VB as
administrator or it can cause you some problems in both Vista and Windows 7.

Navigate to the VB98 folder and right click on the vb6.exe and click run as
administrator.

Norm



Fri, 03 Feb 2012 07:43:22 GMT  
 Problems registering VBPrnDlg.dll
Hi MikeD,

Thanks for the suggestion.

I tried to add the reference, but VB locked. Norm made the magic in the post
just below.

Thanks for all your attention.

Luiz Horacio



Quote:



>> Hi MikeD,

>> Thanks, I got it registered. Nevertheless, I still get a message:

>> Compile error:
>> User-defined type not defined

>> on line:
>> Dim objprn As New VBPrnDlgLib.PrinterDlg

>> Any other thing I can do?

> Did you add a reference to it in your project?

> BTW, most people discourage that particular syntax.  Better to do this:

> Dim objprn As VBPrnDlgLib.PrinterDlg
> Set objprn  = New VBPrnDlgLib.PrinterDlg

> The problems with using New in the declaration are that you may
> inadvertantly instantiate it when you don't intend to and it adds a little
> overhead because every use of the object in your code is wrapped by a
> check to see if it's instantiated. It's considered "best practice" to
> explicitly instantiate objects yourself rather than let VB do it.

> --
> Mike



Fri, 03 Feb 2012 12:20:34 GMT  
 Problems registering VBPrnDlg.dll
Hi Norm,

Thanks, thanks, thanks...

I had to register the DLL using CMD.exe as administrator, otherwise it would
not register. And I couldn't add the reference... until your post.

Thanks,

Luiz Horacio



Quote:





>>> Hi MikeD,

>>> Thanks, I got it registered. Nevertheless, I still get a message:

>>> Compile error:
>>> User-defined type not defined

>>> on line:
>>> Dim objprn As New VBPrnDlgLib.PrinterDlg

>>> Any other thing I can do?

>> Did you add a reference to it in your project?

>> BTW, most people discourage that particular syntax.  Better to do this:

>> Dim objprn As VBPrnDlgLib.PrinterDlg
>> Set objprn  = New VBPrnDlgLib.PrinterDlg

>> The problems with using New in the declaration are that you may
>> inadvertantly instantiate it when you don't intend to and it adds a
>> little overhead because every use of the object in your code is wrapped
>> by a check to see if it's instantiated. It's considered "best practice"
>> to explicitly instantiate objects yourself rather than let VB do it.

>> --
>> Mike

> Hi Luiz,

> One thing to mention, in case you have not done it. You must run VB as
> administrator or it can cause you some problems in both Vista and Windows
> 7.

> Navigate to the VB98 folder and right click on the vb6.exe and click run
> as administrator.

> Norm



Fri, 03 Feb 2012 12:23:33 GMT  
 
 [ 13 post ] 

 Relevant Pages 

1. Register problems, VB Setup dont register HTML.OCX, cant load or register

2. VB.NET DLL can register with regsvr32 but cannot register with Component service

3. VB.NET DLL can register with regsvr32 but cannot register with Component service

4. Using VBPRNDLG.DLLl Instead of Print Common Dialog Boxes

5. Problem with PDW registering .tlb & .dll

6. Installation problem with registering dao350.dll

7. ActiveX dll Register/use problem?

8. Installation problem with registering dao350.dll

9. Problem registering Shdocvw.dll

10. Problems registering ActiveX DLL w/SP3

11. SHDOCVW.DLL registering problem

12. problems registering shdocvw.dll

 

 
Powered by phpBB® Forum Software