TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
travis.hurst
NA
13
0
Using COM to call C#.NET app from another framework?
Sep 28 2004 7:15 AM
I have an old application that I am programming in. I have built a small application in C# that interacts with a database. I need call this from the old app using an object to pass back a value. I have set it up to perform this from the old app: eg. My call from the old app vgContact = OLEGet(vlFCObject,"GetFirmContact") What is the easiest way to call the C#.NET app and return the value? Writing a .NET wrapper? Bearing in mind I am new to COM and .NET A collegue tried the following but it only seems to work for his PC alone. ============================================= using System; using System.Runtime.InteropServices; using Firm_Contact; namespace FirmContactCOM { [Guid("D6F88E95-8A27-4ae6-B6DE-0542A0FC7039")] [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] public interface _FirmContact { [DispId(1)] int GetFirmContact(); } [Guid("13FE32AD-4BF8-495f-AB4D-6C61BD463EA4")] [ClassInterface(ClassInterfaceType.None)] [ProgId("FirmContactCOM.FirmContact")] public class FirmContact : _FirmContact { public FirmContact(){} public int GetFirmContact() { return(Firm_Contact.MainFirmContact.StartUp()); } } }
Reply
Answers (
0
)
Problem accessing collections in VB6 dll from c#
Extracting field text in MS Word with C#