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

Accessing a COM Component

I been trying to write a program to access a COM Component
for a while now, with out much success so far. The
following is part of the code of my program, and this is
the message I get, can anyone see at a glance what I might
be missing.

Any advice would be appreciated.

Method 'USB.Form1.button5_Click(object, System.EventArgs)'
does not match delegate 'void
BDaq._IBBDaqEnumEvents_OnChangeEventHandler()'

namespace USB
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
//Declare an object variable to hold the device collection.
public BDaq.BBDaqEnum Connected;
//Declare an object variable to hold a device.
public BDaq.BBDaqDevice Device1;

//public BDaq.BBDaqDevice Device2; // for a second module

//More code

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

Connected += new
BDaq._IBBDaqEnumEvents_OnChangeEventHandler(this.b utton5_Click);
//
// TODO: Add any constructor code after
InitializeComponent call
//
}

private void button5_Click(object sender, System.EventArgs e)
{
//an instance

BDaq.BBDaqEnum Connected = new BDaq.BBDaqEnum();
Device1 = Connected.Devices("DAQ1");

Device1.Open();

//more code
}
}
}

Nov 15 '05 #1
2 1235
I doubt your COM component is going to be passing Sender and
System.EventArgs as parameters to your event. Those are .NET button click
event parameters. The parameters for your button5_Click() event need to
match the parameters of the Change event of your COM component.

Pete

"Bradley Grant" <br*******@shaw.ca> wrote in message
news:04****************************@phx.gbl...
I been trying to write a program to access a COM Component
for a while now, with out much success so far. The
following is part of the code of my program, and this is
the message I get, can anyone see at a glance what I might
be missing.

Any advice would be appreciated.

Method 'USB.Form1.button5_Click(object, System.EventArgs)'
does not match delegate 'void
BDaq._IBBDaqEnumEvents_OnChangeEventHandler()'

namespace USB
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
//Declare an object variable to hold the device collection.
public BDaq.BBDaqEnum Connected;
//Declare an object variable to hold a device.
public BDaq.BBDaqDevice Device1;

//public BDaq.BBDaqDevice Device2; // for a second module

//More code

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

Connected += new
BDaq._IBBDaqEnumEvents_OnChangeEventHandler(this.b utton5_Click);
//
// TODO: Add any constructor code after
InitializeComponent call
//
}

private void button5_Click(object sender, System.EventArgs e)
{
//an instance

BDaq.BBDaqEnum Connected = new BDaq.BBDaqEnum();
Device1 = Connected.Devices("DAQ1");

Device1.Open();

//more code
}
}
}

Nov 15 '05 #2
I may be getting a little over my head, as I have been
programming in C# for only for about a year or so. I've
done some search on the net for information in this area,
and have not found much. Do you know of any good sources or
have any ideas what parrameters COM would pass to my
button5_Click() event would look like?

Any ideals would be appreciated.
-----Original Message-----
I doubt your COM component is going to be passing Sender and
System.EventArgs as parameters to your event. Those are ..NET button clickevent parameters. The parameters for your button5_Click() event need tomatch the parameters of the Change event of your COM component.
Pete

"Bradley Grant" <br*******@shaw.ca> wrote in message
news:04****************************@phx.gbl...
I been trying to write a program to access a COM Component
for a while now, with out much success so far. The
following is part of the code of my program, and this is
the message I get, can anyone see at a glance what I might
be missing.

Any advice would be appreciated.

Method 'USB.Form1.button5_Click(object, System.EventArgs)'
does not match delegate 'void
BDaq._IBBDaqEnumEvents_OnChangeEventHandler()'

namespace USB
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
//Declare an object variable to hold the device collection.
public BDaq.BBDaqEnum Connected;
//Declare an object variable to hold a device.
public BDaq.BBDaqDevice Device1;

//public BDaq.BBDaqDevice Device2; // for a second module

//More code

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

Connected += new
BDaq._IBBDaqEnumEvents_OnChangeEventHandler(this.b utton5_Click); //
// TODO: Add any constructor code after
InitializeComponent call
//
}

private void button5_Click(object sender, System.EventArgs e) {
//an instance

BDaq.BBDaqEnum Connected = new BDaq.BBDaqEnum();
Device1 = Connected.Devices("DAQ1");

Device1.Open();

//more code
}
}
}

.

Nov 15 '05 #3

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

Similar topics

0
by: Paul Hutchinson | last post by:
All, I wonder if anyone can help/advise with the following interoperability issue we are encountering? We have a .NET web service that takes an abstract type as parameter. Using it from a...
4
by: John Stemper | last post by:
I'm looking for some good articles or hints on accessing a .Net component that I've written from old ASP/VBScript. I've gotten as far as referencing the typelib in the global.asa file but when I...
2
by: wan2tri | last post by:
hello, good day to all of you, hi, im am new in .net , how can i access two or more object remotely , because currently im only accessing one object, windows services is the host, i have a...
1
by: J F | last post by:
Hi all I'm totally new to Visual Studio, coming from Delphi. My question, I'm sure is pretty trivial. I'm using C# I have a component class (Project/Add Class/Component Class). In this...
2
by: Mike | last post by:
..NET framework 1.2 Hello. We've been accessing a Java COM component from classic ASP for a while now, which works fine. We now need to access it from .NET, but we have no idea how to...
3
by: Oleg Skopincevs | last post by:
Hi folks, I am stuck on a problem of creating an object via DCOM from a webservice component. Code: Dim sl As LogonSrv.SysLogon = CreateObject("LogonSrv.SysLogon", LogonServer) Is there...
5
by: Daniel Corbett | last post by:
I am trying to save a file dynamically created in a webpage. I get the following headers, but cannot figure out how to save the attachment. I am basically trying to replicate what internet...
0
by: Nijazi Halimaji | last post by:
Hi Newsgroup I have written a .NET Component, made the check on "register for COM interop" in Build options, create a strong name and registered the assembly in the GAC. Accessing this...
1
by: omantawy | last post by:
Hi, I have some legacy ASP web applications that use an unmanaged COM component to connect to a third party application. The third part application has moved to the managed code in the current...
2
by: Mittalswati | last post by:
Hi All I am getting the below mentioned error while accessing the page which uses VB.Net Dll ,Please look in to the matter and suggest some solution Unable to cast COM object of type...
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.