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 / September 2003

Tip: Looking for answers? Try searching our database.

"Unknown Name" error when using WithEvents on a .Net object

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eric Wilson - 08 Sep 2003 22:52 GMT
I have been debugging the following problem the better part of two days and
am finally throwing in the towel.  I have a newly created .net library with
a class that throws events.  I also have a ActiveX control project (project
A) in Vb6 with a few User Controls.  These usercontrols are each using the
class in the .net library that throws events via the WithEvents keyword.  I
have another vb6 exe project (project B) for displaying the controls in
project A (and any other project I might want to display controls from).
When I add the usercontrols directly to project B, everything works as
expected (events fire when they should, no errors, etc), so I know that I
have all the [ComSourceInterfaces] attributes set up correctly for the
classes.

However, when I put the controls back in project A and just reference them
in project B (the whole goal of the application) things don't work.  Anytime
an event would fire from a method call to the .net object, the .Net object
raises an "Unknown Name" error back to the caller.  I am at a loss as to why
this is.  ANY insight would be useful at this point.  It seems to be a bug
with the manner that vb6 is implementing Connection Points in a user
control, but I just don't know enough about this to figure out anything more
beyond this point.
Eric Wilson - 09 Sep 2003 20:56 GMT
I finally figured out the problem.  Aparrently, you must provide an
implementation for every event of the .Net object in Visual Basic 6, even if
you are only interested in one.

> I have been debugging the following problem the better part of two days and
> am finally throwing in the towel.  I have a newly created .net library with
[quoted text clipped - 16 lines]
> control, but I just don't know enough about this to figure out anything more
> beyond this point.

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.