Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


dll registering


dll registering

Author
Message
shivsam
shivsam
Forum God
Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)

Group: Forum Members
Posts: 8, Visits: 1
Hi friends,

I have added a dll reference (COM) from my VB program. When I register this dll, say from a batch file and if I start my VB appln (exe), its working fine. But if I register this dll (resvr32 /s dll_name) from my exe that is inside my vb code ( without calling that batch file outside) and if I run the exe :

It throws error :

error 91: Object variable or with block variable not set.

Please give a suggestion for the above.

It throws error in the below vb line code ( 'SET' line ) :

dim objec as new com_dll_name.interface_name

......

SET objec = com_dll_name.interface_name

Thanks in advance,
Sam
Mark
Mark
Forum God
Forum God (69K reputation)

Group: Moderators
Posts: 1.1K, Visits: 11K

A few things.

  1. Once a dll has been registered, it doesn't have to be reregistered unless you have unregistered it.
  2. I don't know if it was a typo or not but this is spelled wrong "resvr32 /s dll_name" it should bw regsvr32. I would also remove the /s switch so you know if the registration was successful.
  3. When you declare the object, I would remove the new statement from the declarations

Dim objec as new com_dll_name.interface_name
Change to
Dim objec as com_dll_name.interface_name


shivsam
shivsam
Forum God
Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)

Group: Forum Members
Posts: 8, Visits: 1
Hi,

Thanks for your reply.

Its a typo error as you said.
I tried with your suggestion(removing 'new'), but it didn't work.

The exact error I am getting is :

Error 429: Activex component can't create object.

Please advice. What might be the error cause ?

Thanks,
Sam


Mark
Mark
Forum God
Forum God (69K reputation)

Group: Moderators
Posts: 1.1K, Visits: 11K

Is this a component you are making? If so have you recompiled it a few times? If this is the case, it is possible that you have broken binary compatilbity and your reference it pointing to an old (possibly deleted) dll. To check if this is the case go ahead and open up the project references and scroll down the list and see if the object is listed more than once.

 


shivsam
shivsam
Forum God
Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)

Group: Forum Members
Posts: 8, Visits: 1
Hi,

Yes you are right. It is listed more than once. Now what should I do ?

Thanks,
Sam
Mark
Mark
Forum God
Forum God (69K reputation)

Group: Moderators
Posts: 1.1K, Visits: 11K

If you have already deleted the old dll or just overwritten it then down load RegClean from here and run it. http://www.download.com/3000-2094-881470.html?tag=list This should remove all the extras from your reference list. If you still have the dlls on your machine then use regsvr32 with the /u switch to unregister it.

While the newer OS are not listed for this utility, I have used it on all without problems.

To avoid this problem in the future, under project properties for your dll select the component tab. Choose the binary compatiblity option and then browse to your dll and then click OK. Now if you try to compile your dll and you are going to change the interface, it will tell you.


shivsam
shivsam
Forum God
Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)

Group: Forum Members
Posts: 8, Visits: 1
Hi,

In my application properties, I went to Component TAB, as you said. But the compatibility etc. options seem to be in disabled state. What to do ?

Please advice.

Thanks,
Sam
Mark
Mark
Forum God
Forum God (69K reputation)

Group: Moderators
Posts: 1.1K, Visits: 11K

It needs to be in the dll project not the project using the dll.


shivsam
shivsam
Forum God
Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)

Group: Forum Members
Posts: 8, Visits: 1
Hi,

I tried in the dll project. It gives an error :

"Unable to set the version compatible component : my dll_name with path".

I have doubt, in the component tab, I choosed binary compatibility, then in the text box automatically my dll to be created came and with this I pressed OK. It gave the above error. What should be in the text filed ( Is it the library that is needed for the dll project (I guess) OR the dll to be created ). I don't undersatnd this concept. What is this compatibility actually means ?

Please explain the options :

No compatibilitiy
Project compatibility
Binary compatibility

Thank you very much for your concern to this newbie.

Thanks,
Sam

Mark
Mark
Forum God
Forum God (69K reputation)

Group: Moderators
Posts: 1.1K, Visits: 11K
Here is brief description of the various compatibility modes http://support.microsoft.com/default.aspx?scid=kb;en-us;161137. Maybe the best thing for you to do is unregister your dll, delete all the compiled copies and then run a registry cleaner like RegClean. Then open the dll project and recompile the dll. This should then leave you a copy in your references that you can use.
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search