Solved

Problem with REGSVR32 and VB DLL

Posted on 1997-11-05
13
395 Views
Last Modified: 2010-05-18
I have encountered a problem trying to register a VB Active DLL.  It's a bit complicated so I hope i can explain it clearly :)

1) Create an activeX DLL with clsClass1

2) Create an activeX DLL with clsClass2, which has a reference to clsClass1 AND a method in clsClass2 takes as a parameter clsClass1

3) Compile on machine 1 and create a project to reference and use clsClass2 and clsClass1...all is well

4) copy DLLs or clsClass1 and clsClass2 to machine 2 and run REGSVR32 on both Dlls

5)  create a project that references both DLLs and do a browse on clsClass2....the method that expects clsClass1 as a parameter now shows no parameters AND when you try to use that method you get a compiler error saying the function is restricted or does not recognize the parameter or return types.

For some reason using REGSVR32, the parameters defined as a specificy class causes problems.  If you go back and change the parameter to a general purpose object...it works fine on the second PC.  

Does anyone have any way to get around this problem?  In order to keep the GUIDs sane, I want to compile them in one place and distribute and register the DLLs to other developers on the project. HELP!!!!!
0
Comment
Question by:rmichels
13 Comments
 
LVL 3

Expert Comment

by:ChrisLewis
ID: 1439945
What order are you registering the classes in?

Are you regsvr32'ing Class1 first or class2?

chris
0
 
LVL 3

Author Comment

by:rmichels
ID: 1439946
I'm registering the lowest level dependent class first, so that is Class1.  Then I register class2.

Another twist to this problem, is that this seems to work, if Class1 is NOT a vb developed class, but a VC++ class.  It seems to me that REGSVR or the info in the DLL is wrong
0
 
LVL 2

Expert Comment

by:PedroMVGomes
ID: 1439947
have you try reportin this bug to microsotf?
0
 
LVL 3

Author Comment

by:rmichels
ID: 1439948
I have not reported this bug to microsoft, but I think a co-worker is probably going to post some information on the appropriate newsgroup.  I generally find the response from microsoft, via newsgroups to be unacceptable in the how long it takes to get an answer.
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1439949
Look for RegSvr32 update at Microsoft FTP site.
0
 
LVL 3

Author Comment

by:rmichels
ID: 1439950
I have searched microsoft's site but could only find the same regsvr32.exe that I have (Aug 96).  Do you have an exact path for this file?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 8

Expert Comment

by:MikeP090797
ID: 1439951
Sorry, I don't. It's someware deep down there.
0
 
LVL 3

Author Comment

by:rmichels
ID: 1439952
Sorry to reject, but I could not find any reference to an updated REGSVR32.EXE anywhere in MSDN. There is a REGSVR32A.EXE which contains the same REGSVR32.EXE that I am running.

Also, the problem appears to have been solved.  The compatibility options were not set correctly in the VB Project options.  Changes must must have been made that somehow negated the interface.

So I am going to request this question be deleted by Cust.Serv
0
 
LVL 1

Expert Comment

by:aprasrl
ID: 1439953
First:

In your project make SURE that the reference to clsClass1
comes BEFORE the reference to clsClass2 or it will NEVER
work (use the MoveUp/MoveDown arrows of references dialog)

Second Try this:

change the reference and the parameter in clsClass2 from
clsClass1 to "Object" this could solve the problem of the
object browser

I Hope I've been of some help, let me (all us) know... :-)
0
 
LVL 3

Author Comment

by:rmichels
ID: 1439954
Sorry, my last comment states I have figured this out (and what the problem was), and I have asked cust serv to delete question.
0
 
LVL 8

Expert Comment

by:mrmick
ID: 1439955
Why not compile both into one ActiveX.DLL?
0
 
LVL 3

Author Comment

by:rmichels
ID: 1439956
please read my previous comments. I have already solved this problem and have asked cust serv to delete..but they have not as yet.   The two units were not compiled into one dll because this a three tier design, with each tier containing appropriate DLL and EXE activeX components.
0
 
LVL 7

Accepted Solution

by:
linda101698 earned 200 total points
ID: 1439957
I'm posting the solutions rmichels stated solved the problem so the question can be saved in the PAQ.

The problem appears to have been solved. The compatibility options were not set correctly in the VB Project options. Changes must must have been made that somehow negated the interface.

The two units were not compiled into one dll because this a three tier design, with each tier containing appropriate DLL and EXE activeX components.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now