Click here to Skip to main content
15,897,718 members
Home / Discussions / COM
   

COM

 
GeneralRe: Register browser helper object Pin
conman11021-Oct-07 22:28
conman11021-Oct-07 22:28 
GeneralRe: Register browser helper object Pin
User 21559722-Oct-07 1:19
User 21559722-Oct-07 1:19 
QuestionCOM Pin
Catharin18-Oct-07 1:09
Catharin18-Oct-07 1:09 
AnswerRe: COM Pin
User 21559718-Oct-07 6:00
User 21559718-Oct-07 6:00 
GeneralRe: COM Pin
Catharin19-Oct-07 1:16
Catharin19-Oct-07 1:16 
GeneralRe: COM [modified] Pin
User 21559719-Oct-07 5:25
User 21559719-Oct-07 5:25 
GeneralRe: COM Pin
User 21559721-Oct-07 22:39
User 21559721-Oct-07 22:39 
GeneralRe: COM Pin
Catharin22-Oct-07 0:02
Catharin22-Oct-07 0:02 
Sohail,

Not yet solved.

Let me explain the current situation. I created a sample C# class library project. The code is listed below:


COMServer:

using System;
using System.Runtime.InteropServices;

namespace MyComServer
{
public delegate void MyComEventHandler();

// Step 1: Defines an event sink interface to be implemented by the COM sink.
<Guid({16FA6CC7-E2B9-4326-9D4F-ADBAADA6627D})]
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
public interface IMyComEvents
{ [DispId(1)]
void myComEvent();
}

// Step 2: Connects the event sink interface to a class by passing the namespace and event sink interface

[ComSourceInterfaces(typeof(MyComServer.IMyComEvents))]
public class MyComCls
{
public event MyComEventHandler myComEvent;
public MyComCls()
{}
public void raiseMyComEvent()
{
this.myComEvent();
}
}
}


Then the DLL file named MyComServer is registered using the following command

regasm MyComServer.dll /tlb:MyComServer.tlb

then after giving a Strong Name [sn -k MyComServer.snk]

the DLL file is registered into the global assembly using the command

gacutil -i MyComServer.dll


COMClient:

For the client application I used VC++ 6 MFC wizard[exe] and a simple dialog object.

I imported the MyComServer.tlb into stdafx.h file and all supporting header files.

Also done event sinking. After all those process i executed the MFC application. Then i encountered COM Error: 0x80040154 Class Not Registered.

Also is there any other option to invoke the events written in the class library?

Cathrin




GeneralRe: COM [modified] Pin
User 21559722-Oct-07 1:04
User 21559722-Oct-07 1:04 
GeneralRe: COM Pin
Catharin22-Oct-07 2:00
Catharin22-Oct-07 2:00 
GeneralRe: COM Pin
User 21559722-Oct-07 2:36
User 21559722-Oct-07 2:36 
QuestionHow to get Close event of WORD? (COM) Pin
PhanMinhDuy17-Oct-07 20:52
PhanMinhDuy17-Oct-07 20:52 
QuestionCOM interfaces Pin
DanyCode17-Oct-07 9:37
DanyCode17-Oct-07 9:37 
QuestionCOM Pin
Catharin16-Oct-07 0:09
Catharin16-Oct-07 0:09 
AnswerRe: COM [modified] Pin
User 21559716-Oct-07 6:14
User 21559716-Oct-07 6:14 
GeneralRe: COM Pin
Catharin16-Oct-07 23:53
Catharin16-Oct-07 23:53 
QuestionWindows Media Player Control Pin
SonicMouse13-Oct-07 12:22
SonicMouse13-Oct-07 12:22 
AnswerRe: Windows Media Player Control Pin
SonicMouse13-Oct-07 14:56
SonicMouse13-Oct-07 14:56 
QuestionSimple COM component Pin
Shaileshvb10-Oct-07 23:36
Shaileshvb10-Oct-07 23:36 
AnswerRe: Simple COM component Pin
CPallini11-Oct-07 0:52
mveCPallini11-Oct-07 0:52 
AnswerRe: Simple COM component Pin
Michael Dunn14-Oct-07 15:02
sitebuilderMichael Dunn14-Oct-07 15:02 
QuestionIs COM controls compatible with .NET Pin
vimal_q10-Oct-07 21:26
vimal_q10-Oct-07 21:26 
AnswerRe: Is COM controls compatible with .NET Pin
CPallini10-Oct-07 21:57
mveCPallini10-Oct-07 21:57 
Questionstep by step COM use Pin
Shaileshvb10-Oct-07 21:03
Shaileshvb10-Oct-07 21:03 
AnswerRe: step by step COM use Pin
CPallini10-Oct-07 21:11
mveCPallini10-Oct-07 21:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.