473,785 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Interface defined in VB.Net and used in .Net and COM

I'm trying to create a single interafce that can be implelment by either a
..Net class or a COM object. Here's what I'm tried to do. I defined an
interface using VB.net in an assembly all by itself. This interface has a
couple of simple procedures and 3 events. I created a test project in
VB.Net to test a class implementing the interface and everything works fine.
I'm now trying to get a COM object to implement this interface. I used the
TLBEXP utility to generate a type library that I can reference in a VB6
project. The main problem that I'm running into is that when the type
library was generated by TLBEXP, the events in the interface got converted
with underscroes in the name. VB6 is complaining about the undrescores. I
tried removing the events and generating a type library and it seemed to
work since there were no methods with underscores in the name. So I'm
trying to figure out what is the best way to define the interface in .Net so
that when the type library is created it can be used by VB6. I'm including
my .Net interface and the interface in the type library below.

Thanks,

Eric

Interface in VB.Net

Public Interface WizardInterface
Sub Init(ByVal bShowWelcomePag e As Boolean)
Function NextPage() As Boolean
Function BackPage() As Boolean
Sub Show()
Event DoBeforeFinish( ByVal value As System.Object)
Event DoAfterFinish(B yVal value As System.Object)
Event DoAfterCancel(B yVal Value As System.Object)
End Interface
Interface from Type library using TLBEXP

interface WizardInterface : IDispatch {
[id(0x60020000)]
HRESULT remove_DoAfterF inish([in] _DoAfterFinishE ventHandler* obj);
[id(0x60020001)]
HRESULT add_DoAfterFini sh([in] _DoAfterFinishE ventHandler* obj);
[id(0x60020002)]
HRESULT add_DoAfterCanc el([in] _DoAfterCancelE ventHandler* obj);
[id(0x60020003)]
HRESULT remove_DoAfterC ancel([in] _DoAfterCancelE ventHandler* obj);
[id(0x60020004)]
HRESULT remove_DoBefore Finish([in] _DoBeforeFinish EventHandler*
obj);
[id(0x60020005)]
HRESULT add_DoBeforeFin ish([in] _DoBeforeFinish EventHandler* obj);
[id(0x60020006)]
HRESULT Init([in] VARIANT_BOOL bShowWelcomePag e);
[id(0x60020007)]
HRESULT NextPage([out, retval] VARIANT_BOOL* pRetVal);
[id(0x60020008)]
HRESULT BackPage([out, retval] VARIANT_BOOL* pRetVal);
[id(0x60020009)]
HRESULT Show();
};
Nov 20 '05 #1
0 988

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4651
by: Anon Email | last post by:
Hi people, I'm learning about header files in C++. The following is code from Bartosz Milewski: // Code const int maxStack = 16; class IStack
7
1455
by: Stephan Rose | last post by:
Ok here is my scenario I have an interface called IScalar which describes a one dimensional number that has a certain unit of measurement. This interface is used to create multiple structures, each structure representing a certain unit of measurement. So I currently end up with 4 structures each implementing the IScalar interface.
21
13848
by: Helge Jensen | last post by:
I've got some data that has Set structure, that is membership, insert and delete is fast (O(1), hashing). I can't find a System.Collections interface that matches the operations naturally offered by Sets. - ICollection cannot decide containment - IList promises indexability by the natural numbers, which is not achievable (since i hash elements, not sort them). - IDictionary is definatly not setlike. Although I can, of course, define...
2
2843
by: matthew_glen_evans | last post by:
Hi there, Quick one about interfaces in c#. It seems that it is illegal to declare types within an interface. I was quite used to doing this in VB.net where the interface can define a clients remoting interface and object model. eg..
12
1306
by: masoud bayan | last post by:
I've come across something in Interface implementation that I am not sure is correct behavior in VB.NET (and maybe C#) or not? Consider following example: Public Interface IShape
20
6089
by: Luc Kumps | last post by:
(Sorry about the previous post, it got transmitted before it was complete) We try to separate implementation and interface defintions, but we run into a problem. I hope the guru's can solve this, as we seem to lack only a single 'step' to have "full separation"... We have a first project, namespace Ninterface, that contains the interface definitions in class1_interface.cs, like this: namespace Ninterface { public interface IClass1{
0
2511
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that don't work nearly as well as they should, even for analysts and power users. The reason they haven't reached the masses is because most of the tools are so difficult to use and reveal so little
8
2082
by: rn5a | last post by:
Suppose I have the following class code: Imports System Imports System.Data Imports System.Data.SqlClient Public Class DBSettings Private sqlCmd As SqlCommand Private sqlConn As SqlConnection Public ConnectionString As String
7
10600
by: WTH | last post by:
I am now aware (I am primarily a C++ developer) that in C# if you reference the same interface from the same file in two different projects the types are actually incompatible. I found this out because I have written a generic plugin system for my current and future C# needs. I defined a base plugin system interface named IPlugin (original, I know...) which contains some basic plugin infomration all plugins of this system must expose...
0
10157
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10097
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8983
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7505
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5518
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.