473,405 Members | 2,187 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,405 software developers and data experts.

Runtime error when trying to wire up multiple com events.

I am having a problem that looks exactly the same as the below link.

http://www.google.com/groups?hl=en&l...a06%26rnum%3D7

I was wondering if any one has ran into this problem, and has any
reslolutions for it? I have tried all the suggestions from the above
post, and it has not fixed my problem.

Below is my source code, and if I comment out one of the two event
handlers, I no longer get the run time error. This only happens if I
try to wire in more than one event.

using System;
using System.Runtime.InteropServices;
using ANC12Com;

namespace Hunt.Transmitter.TSII.TableWriter
{
/// <summary>
/// Summary description for Foo.
/// </summary>
public class TableWriter
{
private ANC12Com.ANC12ComXClass ANC12 = new ANC12ComXClass();
public TableWriter()
{
RegisterHandlers();
}

public void RegisterHandlers()
{
//With either of the below lines commented out runtime is fine.
ANC12.OnLogon += new
IANC12ComXEvents_OnLogonEventHandler(Foo_OnLogon);
ANC12.OnLogoff += new
IANC12ComXEvents_OnLogoffEventHandler(Foo_OnLogoff );
}

#region Event Handlers

public static void Foo_OnLogon()
{

}
public static void Foo_OnLogoff()
{

}
#endregion Event Handlers
}
}

If any one has any suggestions I would appreciate it.

Thanks,

B.H.
Nov 16 '05 #1
1 1422
Bump:

b_*****@yahoo.com (Vike_Fan_Forever) wrote in message news:<e2**************************@posting.google. com>...
I am having a problem that looks exactly the same as the below link.

http://www.google.com/groups?hl=en&l...a06%26rnum%3D7

I was wondering if any one has ran into this problem, and has any
reslolutions for it? I have tried all the suggestions from the above
post, and it has not fixed my problem.

Below is my source code, and if I comment out one of the two event
handlers, I no longer get the run time error. This only happens if I
try to wire in more than one event.

using System;
using System.Runtime.InteropServices;
using ANC12Com;

namespace Hunt.Transmitter.TSII.TableWriter
{
/// <summary>
/// Summary description for Foo.
/// </summary>
public class TableWriter
{
private ANC12Com.ANC12ComXClass ANC12 = new ANC12ComXClass();
public TableWriter()
{
RegisterHandlers();
}

public void RegisterHandlers()
{
//With either of the below lines commented out runtime is fine.
ANC12.OnLogon += new
IANC12ComXEvents_OnLogonEventHandler(Foo_OnLogon);
ANC12.OnLogoff += new
IANC12ComXEvents_OnLogoffEventHandler(Foo_OnLogoff );
}

#region Event Handlers

public static void Foo_OnLogon()
{

}
public static void Foo_OnLogoff()
{

}
#endregion Event Handlers
}
}

If any one has any suggestions I would appreciate it.

Thanks,

B.H.

Nov 16 '05 #2

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

Similar topics

6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
2
by: Paul | last post by:
I'm hoping someone can help me with the problem. I have a database where the default value for a date field in a table is =date() This works perfectly in my table and on my form. But when I...
0
by: ann | last post by:
Hi, I am trying to add an ActiveX control on my ASP.NET web form (the language for code behind is C#). I have some client-side vbscript to handle events from the html input buttons. In the...
0
by: tshad | last post by:
I am trying to figure out how to handle a couple of problem using multiple events tied to the same button. Following is the button: <asp:button ID="submitAnswer" CommandName="SubmitAnswer"...
3
by: VJ | last post by:
I can't find my posting that had replies to events at runtime.. hence I am posting as new. I did earlier read all your replies. Thanks for the information. I still have not tried them. My...
8
by: g_man | last post by:
I am trying trap Runtime error 3022 (duplicates) in the click event of a command button that closes the form. I have code in the Form_Error event that does a good job of providing a more meaningful...
1
by: rickcross | last post by:
I am trying to use the Access 2007 runtime. I have a program that is fully working in 2007 but when I install the runtime version with same Operating system and Access 2003 installed I have...
6
by: rn5a | last post by:
The different Page events in the page life cycle like Page_PreInit, Page_Init, Page_Load etc. - are they different stages of the runtime process? Does a server send back the HTML output of an...
3
by: chandan | last post by:
Hi, Is any way to palce a control(button/label) at a location on webPage in runtime?? In page_load envet I am adding a button on the page in the contol collection of a panel but not able to...
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
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...
0
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
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
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.