473,490 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

COM+ written in C# from VB6 - who can?

Hi,

Did anybody use the C# class library from VB6 ?

I wrote a standard COM+ interface for this C# class library, the system sees
this COM+ object, can show the interface etc., but VB6 can't create the
object.

I found a couple of good links as I supposed and made the whole job
according these links, everything's fine until I try to create the COM+
object from VB6 application. What I'm doing wrong?

This is a CS class, I created a strong name using SN and added it to the
Assembly, then registered the whole assembly in GAC. It should be there.

----------------------------------------------------------------------------
-------------------------------------
using System;

using System.Runtime.InteropServices;

//--------------------------------------------------------------------------
-----------------------

namespace ToDo

{

[Guid("3A24D643-4E18-4488-907F-F076ABE703CB")]

public interface ToDoWrapper_Interface

{

[DispId(1)]

int Init(int i1, int i2, int i3, string s);

[DispId(2)]

int Create(string s);

}

//--------------------------------------------------------------------------
-----------------------

// Events interface Database_COMObjectEvents

[Guid("03001849-1DBD-471c-97C0-3ADAA1C545DA"),

InterfaceType(ComInterfaceType.InterfaceIsIDispatc h)]

public interface ToDoWrapper_Events

{

}

//--------------------------------------------------------------------------
-----------------------

[Guid("5E67AF8F-01E2-4284-ABD7-FA03B51EE9BD"),

ClassInterface(ClassInterfaceType.None),

ComSourceInterfaces(typeof(ToDoWrapper_Events))]

//--------------------------------------------------------------------------
-----------------------

public class ToDoWrapper_Class : ToDoWrapper_Interface

{

private int m_i1 = 0;

private int m_i2 = 0;

private int m_i3 = 0;

private string m_s = "";

//--------------------------------------------------------------------------
-------------------

public ToDoWrapper_Class()

{

}

//--------------------------------------------------------------------------
-------------------

public int Init(int i1, int i2, int i3, string s)

{

m_i1 = i1;

m_i2 = i2;

m_i3 = i3;

m_s = s;

return 0;

}

//--------------------------------------------------------------------------
-------------------

public int Create(string s)

{

return 0;

}
}

}

----------------------------------------------------------------------------
--------------------------------------------------------------------

Then I created a VB6 application like:

Dim o As Object
Private Sub Command1_Click()
Set o = CreateObject("ToDoWrapper.CToDoWrapper_Class")
Dim myResult As Object
myResult = o.Init(1,2,3,"")
MsgBox "Complete", vbOKOnly, "Complete"
End Sub

The program dies at the CreateObject()

Why?

Thanks,

Dmitri.

Nov 22 '05 #1
0 1104

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

Similar topics

2
1700
by: IK | last post by:
Hello All, Please excuse me for posting this here, but I don't find any other group where I will get a proper answer. This is about clarifying the C++ part of COM. I understand that COM is a...
1
717
by: Daniel | last post by:
System.IO.StreamWriter Close or Flush method to shut down the computer in such a way that just part of the file is written? or an empty file is written? Also if the Close or Flush is to a...
1
1354
by: Uty | last post by:
As the subject suggests, I have two questions about using COM objects in C#. I'm using two different objects, each of which is giving me a problem. The first object ... we'll call it AppXControl....
1
1302
by: Konrad Kataneksza | last post by:
Hi, I have written COM in C#. This COM is called by an application written in Delphi 5. I want to be able to debug my COM when it is called by mentioned application. MS Visual Studio runs...
7
3873
by: TJ | last post by:
In C# how do you achieve pass-by-reference property declarations in the Type Library? I am writing a COM Class Library that must mimick an existing library for which the only information is the...
0
965
by: Just D. | last post by:
All, Is it possible to write a COM+ component in C# with some GUI to use it from a native application written for example in VB? Afaik this component is using the different libraries and it's...
132
4712
by: Kevin Spencer | last post by:
About 2 years ago, and as recently as perhaps 1 year ago, I can recall seeing many posts about what language to use with ASP.Net. The consensus was that employers paid more for C# programmers, and...
8
1200
by: Amit | last post by:
Hello group, I will appreciate it if you give me some advice on my question: I am asked to write a program. This program is supposed to act as "Adobe PDF" feature which some of you either have...
14
10423
by: Franz Steinhäusler | last post by:
Hello NG, wWhat are the best programs in your opinion, written entirly in pyhton, divided into categories like: a) Games b) Utilities/System c) Office d) Web/Newsreader/Mail/Browser ....
61
6886
by: giveitawhril2008 | last post by:
I'm just learning about Python now and it sounds interesting. But I just read (on the Wiki page) that mainstream Python was written in C. That's what I was searching for: Python was written in what...
0
7112
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7146
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7183
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...
1
6852
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...
0
7356
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4878
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...
0
3084
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...
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
277
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.