Learn how to a build a cloud-first strategyRegister Now

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

Create COM DLL in VB.net 2005 and use it in VB6.0 PowerPoint Application (Macro Enabled)

I have created a "COM interop" enabled DLL and TLB file in VB.net 2005 and used it in PowerPoint as a reference and it worked fine on the development machine. But on target machine which have .net framework 2.0 it did not worked. I opened the PowerPoint 2007 with security level LOW, and it showed me MISSING reference of the DLL. When I tried to add DLL file it showed me an error "Can't add reference to specif file". I was able to add the .TLB file as a reference and see the list of available functions in it. But when I executed the program it showed me "Automation Error".
<ComClass(Core.ClassId, Core.InterfaceId, Core.EventsId)> _
Public Class Core

Open in new window

0
Harry_Shan
Asked:
Harry_Shan
  • 4
  • 3
1 Solution
 
IUFITSCommented:
I did something like this when I needed to use a .Net assembly in a classic ASP web site.  I put my DLL project on CodePlex which has instructions in a text file inside of the project:
http://www.codeplex.com/impersonation/SourceControl/ListDownloadableCommits.aspx
 Here is the text from the documentation I left in that project on how to use it which I believe would apply here also:
--------------------------------------------------------------------------------
Installation Instructions
--------------------------------      
1.)  Run the .Net Framework 'gacutil.exe' on the library file.  The gacutil.exe must be the version that is associated with
  the version of the framework that you compiled the library under:
 
  gacutil /i ComImpersonate.dll
 
2.)  Run the assembly for COM.  I had to use the .Net Framework 2.0's version which worked for the 3.5 library:
  regasm /tlb ComImpersonate.dll
0
 
IUFITSCommented:
And, I'm guessing the reason that it worked on your development machine was because the IDE registered the library for you (that's my assumption anyway).
0
 
Harry_ShanAuthor Commented:
I tried using regasm command in RUN window.. it shows me this error screen.

[Window Title]
regasm

[Content]
Windows cannot find 'regasm'. Make sure you typed the name correctly, and then try again.

[OK]

I'm using Windows Vista Ultimate 64 bit operating system. Will that be any problem? However, I've tried the same thing on a Windows XP system... and I got the same error.
0
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.

 
Harry_ShanAuthor Commented:
Okay... I found it, I need to use Visual Studio Command Prompt. But how will I do this on client's PC which only have .net framework?
0
 
IUFITSCommented:
That's a good question.  I actually had to copy it to the target machine (or rather, that was the quickest way I found to fix it).  It wasn't a problem for me because I was deploying it to a server and not to users workstations.  
Now, check this location, it may exist on the client's machine if they have .Net installed:
C:\Windows\Microsoft.NET\Framework\v2.0.50727
You have to user the version specific to the version of the framework you're using (3.0 & 3.5 use 2.0's regasm however, because 3.5 was built off of 2.0, or at least that's the way I've understood it).  In this cause, if it was in the above location you could write a batch file to shell it with the full path.
0
 
IUFITSCommented:
Check this link also, it has some good info:
http://www.thewayofcoding.com/tag/regasm/
 
0
 
Harry_ShanAuthor Commented:
Thanks a lot for your help. I had deployed the application on my client's PC and it worked.

Once again thanks for all your time and support.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now