473,385 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1102

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

Similar topics

2
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
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
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
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
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
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
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
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
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
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.