Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / July 2003

Tip: Looking for answers? Try searching our database.

Using .NET COM objects in VB4

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
R_O_O_K - 06 Jul 2003 13:38 GMT
Hi!

I encounter the following problem:

Let's have a simple .NET COM class.

using System;
using System.Runtime.InteropServices;
namespace Galaxy.Guide
{
    [Guid("F747532F-D6F7-4c4b-A372-76DBC4CDD02A")]
    public class DeepThought
    {
        public void TheAnswer() {
            System.Windows.Forms.MessageBox.Show("42");
        }
    }
}

I compile it to a dll library, regasm it and create a type library.
Then I run VB4, create a new project, add reference to the type library,
and have the following function:

Private Sub Command1_Click()
    Dim dt As New DeepThought
    dt.theanswer
End Sub

Upon execution of the second line of code it throws

Runtime Error -2146233054 (80131522)
No server registered or could not load class CLSID
{The GUID of DeepThought class here}

Any ideas?

Regards!
Michal Ziemski
Willy Denoyette [MVP] - 06 Jul 2003 14:13 GMT
Your COM library must be in the same directory as your VB4 client, or you have to specify the Codebase option when running regasm.

Willy.

> Hi!
>
[quoted text clipped - 34 lines]
> Regards!
> Michal Ziemski

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.