Solved

Class Library and Type Library registration problems

Posted on 2006-07-05
4
337 Views
Last Modified: 2008-07-03
I have written a c# COM component as a dll to automate and external applcation using Visual Studio 2005.
It works well on my development machine in VBscript using CreateObject(.....) and in VBA if I reference the dll.

I created an installation project and used this to install the code onto a new machine.

In VBA everything works OK but using VbScript I get and error 8070002 File not found error when I use CreateObject(......).

I suspect that there is something wrong with the registration of the Type Library but comparisons of the registries doesn't show anything different.

Clearly I have done something incorrect with the installation project but for the life of me I can't see where to go from here.

Hope soemone can help

Regards
Andy
0
Comment
Question by:ieg
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17044636
Andy,

What are you using for the ProgID for CreateObject?

Bob
0
 

Author Comment

by:ieg
ID: 17071202
TheLearnedOne -thanks for replying.
I managed to fix the problem but like so many issues it wasn't straight forward and the history of the COM component played a roll.
Some relevant history - the COM component automates Crystal Viewer and was originally written in VS2003. Issues over version numbers of the .Net Framework and Crystal meant that I had to upgrade to VS2005, .Net Framework 2.0 and Crystal XI SP2.

The problem with the Type Library turned out to be the fact that I hadn't allocated a GUID to the assembly (Thanks to TheLearnedOne here). Allocating a GUID in Properties/Application/Application Assembly meant that the Type Library was detected as a dependency in the setup program. COM components created in VS2005 seem to have the GUID set automaticaly but in VS2003 that wasn't the case.

However this didn't solve the 8070002 problem - clearly I had 2 issues. It transpired that I was using the wrong Crystal Viewer. The VS2003 project was refering to componenets in C:\Program Files\Common Files\Business Objects\2.7 but Crystal XI uses C:\Program Files\Common Files\Business Objects\3.0. and beacuse the new PC I was installing on had only ever had Crystal XI on - this is what the 8070002 problem was. The toolbox of the project was also referencing the incorrect components.
I removed the references from the toolbox menu, added the correct ones, removed the controls from the form and readded them and it all worked.


I'd like TheLearnedOne to get the points but this post to be flagged as the answer.
Thanks
Andy
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 17074491
Closed, 500 points refunded.
Netminder
Site Admin
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

708 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

10 Experts available now in Live!

Get 1:1 Help Now