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

Importing Multi interface ActiveX control into my windows form

Hi,

I'm trying to use ActiveX control with more than one interface into my
window form.

any way i'm trying to do it (through the IDE or through AxImp.exe) the
only interface exposed is the default interface.
till now the only way i found for doing this is to use the AxImp.exe
and generate a .cs file and then to edit it:

1. declare another interface reference

private MyAx.IMyCompoenent ocx; //generated
private MyAx.IMyCompoenent2 ocx2; //added manually

2. modify AttachInterfaces method
this.ocx = ((MyAx.IMyCompoenent)(this.GetOcx())); //generated
this.ocx2= ((MyAx.IMyCompoenent2)(this.GetOcx())); //added
manually
3. implement each and every method delegation of IMyCompoenent2

i'm sure there is a much easier way for doing it, but i wasn't able to
find it.

thanks in advance
Nov 15 '05 #1
1 1929
Gilad,

That is one way to do it. However, what I would do is just get the
reference returned from the Ocx property, and cast it to the interface that
I want to use later. I don't see the need to add a separate property whose
sole purpose is to perform a task.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Gilad" <gi**********@hotmail.com> wrote in message
news:76**************************@posting.google.c om...
Hi,

I'm trying to use ActiveX control with more than one interface into my
window form.

any way i'm trying to do it (through the IDE or through AxImp.exe) the
only interface exposed is the default interface.
till now the only way i found for doing this is to use the AxImp.exe
and generate a .cs file and then to edit it:

1. declare another interface reference

private MyAx.IMyCompoenent ocx; //generated
private MyAx.IMyCompoenent2 ocx2; //added manually

2. modify AttachInterfaces method
this.ocx = ((MyAx.IMyCompoenent)(this.GetOcx())); //generated
this.ocx2= ((MyAx.IMyCompoenent2)(this.GetOcx())); //added
manually
3. implement each and every method delegation of IMyCompoenent2

i'm sure there is a much easier way for doing it, but i wasn't able to
find it.

thanks in advance

Nov 15 '05 #2

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

Similar topics

0
by: Vagabond Software | last post by:
I want to use an old pdqcom32.ocx control in a Windows Forms project. I have sucessfully imported the control using aximp.exe and now have a few dll files and the C# source code for the wrapper. ...
5
by: Dan | last post by:
Good Day All, I am having a problem in Visual Studio 2005 Beta 2. I am hoping someone might have an idea as to what is going on. I have an ActiveX User Control written using Visual Basic 6.0....
0
by: Ivan | last post by:
I have the SystemMonitor ActiveX control on a form and I try to register a custom performance counter. I expect that after registering the counter with the OS, the user would be able to add it...
0
by: zevikw | last post by:
I am using an ActiveX control in a .NET application which I put on a form. I have another .NET control on that form that handles the Validating event. The method that handles the Validating event,...
2
by: Shawn | last post by:
Hi. I've never created an ActiveX control before, so I know little about what it is capable of and what its limitations are. My problem is this: I have to create a way to send multiple documents...
4
by: Michael D Murphy | last post by:
Hi, I need to use Windows Meadia Player control in my application to run som mpeg movies. There is no user interface, I need to control everything programatically. I do not want to use the...
7
by: irfanali | last post by:
Hallo All, I m trying to create a Multi User Data Program on Access, where my team members would input data on a daily basis. Well the Problems start now : - How do i create a Multi-user...
6
by: hufaunder | last post by:
I have an ActiveX component that I want to use in a library that I am writing. As a first test I used the ActiveX component in a windows form application. Adding the component created: Ax.dll...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.