473,806 Members | 2,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

getting events into c# app from a COM control - critical path help needed!

Hi, I have a COM control / server I'm trying to get events from in my c#
applications.

1) I'm trying to get events in both c# console apps and in c# winform apps.
2) I can call methods on the COM control / server ok, I just don't receive
any events. The method calls are definitely successful.
3) I have got events and communicated ok with other COM controls from c# -
it's just this one I have a problem with.
4) I can communicate perfectly with the COM control / server from VB and
VC6 - both methods and events work fine.
5) I've tried STA and MTA and have used the control directly and via
tlbimp.exe

It looks like there is a problem with this particular control - is that
possible? I've tried sinking the events via delagates:
objControl.OnDi sable += new IControlEvents_ OnDisableEventH andler(OnDisabl e);
objControl.OnEn able += new IControlEvents_ OnEnableEventHa ndler(OnEnable) ;

and by setting up an event sink:
// Create the object.
ControlProxy objControlProxy = new ControlProxyCla ss();

// Fix the connection points to fire events.
m_objIConnectio nPointContainer =
(UCOMIConnectio nPointContainer )objControlProx y;
Guid objGuid = typeof(eventtlb nsp.IControlEve nts).GUID;
m_objIConnectio nPointContainer .FindConnection Point(ref objGuid, out
m_objIConnectio nPoint);
m_objIConnectio nPoint.Advise(t his, out m_nCookie);

Any help is SINCERELY appreciated, I'm really on the critical path on this.
I've looked all over the ng's - people have been asking about this for years
but I can't find any answers which work on this.

Cheers, Dave.
Nov 16 '05 #1
2 1971
Hi Dave,

Delegates are usually the way to go, they work fine for me. You can examine
the interop assembly with ildasm to see whether event arguments were
generated correctly.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"dave" <da**@dave.co m> wrote in message
news:lV******** *********@newsf e1-gui.ntli.net...
Hi, I have a COM control / server I'm trying to get events from in my c#
applications.

1) I'm trying to get events in both c# console apps and in c# winform
apps.
2) I can call methods on the COM control / server ok, I just don't receive
any events. The method calls are definitely successful.
3) I have got events and communicated ok with other COM controls from c# -
it's just this one I have a problem with.
4) I can communicate perfectly with the COM control / server from VB and
VC6 - both methods and events work fine.
5) I've tried STA and MTA and have used the control directly and via
tlbimp.exe

It looks like there is a problem with this particular control - is that
possible? I've tried sinking the events via delagates:
objControl.OnDi sable += new
IControlEvents_ OnDisableEventH andler(OnDisabl e);
objControl.OnEn able += new IControlEvents_ OnEnableEventHa ndler(OnEnable) ;

and by setting up an event sink:
// Create the object.
ControlProxy objControlProxy = new ControlProxyCla ss();

// Fix the connection points to fire events.
m_objIConnectio nPointContainer =
(UCOMIConnectio nPointContainer )objControlProx y;
Guid objGuid = typeof(eventtlb nsp.IControlEve nts).GUID;
m_objIConnectio nPointContainer .FindConnection Point(ref objGuid, out
m_objIConnectio nPoint);
m_objIConnectio nPoint.Advise(t his, out m_nCookie);

Any help is SINCERELY appreciated, I'm really on the critical path on
this.
I've looked all over the ng's - people have been asking about this for
years
but I can't find any answers which work on this.

Cheers, Dave.


Nov 16 '05 #2
They don't work on this I'm afriad.

I think something dodgy is going on inside the control that is incompatible
with the CLR. My VB6 project (which just creates the control and receives
the events - 5 lines of programming) works perfectly, but when I convert it
to VB.Net, it stops working and behaves just like the c# project.

If I create a VB6 control (exe or dll) that wraps the 3rd party control (ie,
feeds method calls straight through, sends events straight out), and use the
VB6 control from c#, it works perfectly. Once I've got some time, I'll write
a VC++ wrapper.
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.c om> wrote
in message news:O2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi Dave,

Delegates are usually the way to go, they work fine for me. You can examine the interop assembly with ildasm to see whether event arguments were
generated correctly.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"dave" <da**@dave.co m> wrote in message
news:lV******** *********@newsf e1-gui.ntli.net...
Hi, I have a COM control / server I'm trying to get events from in my c#
applications.

1) I'm trying to get events in both c# console apps and in c# winform
apps.
2) I can call methods on the COM control / server ok, I just don't receive any events. The method calls are definitely successful.
3) I have got events and communicated ok with other COM controls from c# - it's just this one I have a problem with.
4) I can communicate perfectly with the COM control / server from VB and
VC6 - both methods and events work fine.
5) I've tried STA and MTA and have used the control directly and via
tlbimp.exe

It looks like there is a problem with this particular control - is that
possible? I've tried sinking the events via delagates:
objControl.OnDi sable += new
IControlEvents_ OnDisableEventH andler(OnDisabl e);
objControl.OnEn able += new IControlEvents_ OnEnableEventHa ndler(OnEnable) ;
and by setting up an event sink:
// Create the object.
ControlProxy objControlProxy = new ControlProxyCla ss();

// Fix the connection points to fire events.
m_objIConnectio nPointContainer =
(UCOMIConnectio nPointContainer )objControlProx y;
Guid objGuid = typeof(eventtlb nsp.IControlEve nts).GUID;
m_objIConnectio nPointContainer .FindConnection Point(ref objGuid, out
m_objIConnectio nPoint);
m_objIConnectio nPoint.Advise(t his, out m_nCookie);

Any help is SINCERELY appreciated, I'm really on the critical path on
this.
I've looked all over the ng's - people have been asking about this for
years
but I can't find any answers which work on this.

Cheers, Dave.

Nov 16 '05 #3

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

Similar topics

303
17808
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b. Yahoo store was originally written in Lisp. c. Emacs The issues with these will probably come up, so I might as well mention them myself (which will also make this a more balanced
3
1889
by: Bob | last post by:
Is there an interface or events in the system that occurs pre and post garbage collection that one of my objects can attach to? I need to know in my application when garbage collection is about to take place and when it has completed. This is to make sure a system critical event does not happen while the application is frozen, if it freezes for longer than 2 seconds. Thanks!
4
2562
by: blue | last post by:
I have a drop-down list, a radio button list and a submit button. I'm adding these controls to a table and I'm adding the table to a Placeholder. I'm adding it to the Placeholder because I don't know exactly where the table will be located on the page until runtime. Before the form control table is added to the Placeholder, I'm adding a whole bunch of tables to the Placeholder. This is a flowchart program and I have multiple action boxes...
1
7592
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a dropdown in UC1 _________________________ 1) MainPage_Load 2) User Control_1 Load
8
10021
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/WebApplication1'. 'HTTP/1.1 500 Internal Server Error'."
12
2827
by: scsharma | last post by:
Hi, I am working on creating a webapplication and my design calls for creating main webform which will have menu bar on left hand side and a IFrame which will contain all the forms that are shown when menu items are clicked.Besides these i would like to put a custom status bar. Any error message encountered in any of the webpage will be displayed in the banner. The problem iam encountering is how to access the customer status bar in child...
4
7796
by: planetthoughtful | last post by:
Hi All, I have a relatively simple web user control I've included in a page that simply presents 3 drop down lists and a submit button, that I use as a date picker (ie one list for day, one for month, one for year). I have the control registered on the page and it displays fine, but I haven't managed to work out how to get the value(s) back from the control on clicking the submit button (performs a postback). I want to use the date...
19
1509
by: amit | last post by:
Hi group, Long story short, I'm new to JavaScript and have started it less than 3 weeks. My question is 1) how can I create a situation that when user clicks on gif or ... image file an event get triggered? what I have done is:
33
11872
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon (NT_AUTHORITY\SYSTEM). I understand that when the service starts, no user may be logged in, but that's ok, as the app I am monitoring can only be run by a logged in user. Do I need to use WMI to get the user context of Explorer.exe or is there a...
0
9719
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10624
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10371
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
10374
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
10111
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6877
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
5546
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...
1
4330
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
3853
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.