473,473 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Can you emulate an ActiveX exe in .NET

Hi there,

I'm currently working on converting an ActiveX exe that was written in
VB6 to VB.NET. The original application was written as a TSR which
lives in the system tray providing integration between a web site and
3rd party windows apps (such as MS office, etc...).

I've managed to convert the application to .NET originally using the
upgrade wizard (to get it up to .NET 1.1 and finally up to .NET 2) and
then rewriting a fair bit of the code. However, I'm having a few
difficulties getting the application to run like the old ActiveX exe.
Basically what I want is for this application to:

a.) provide a COM interface
b.) stay resident so that other apps can call it
c.) run as a single instance application (i.e. new apps that call the
program shouldn't start a new instance but should be able to hook into
the running instance).

I've compiled the application as a DLL / assembly and given it a COM
interface, however at present whenever an app tries to talk to the TSR
it starts another instance of it rather then just hooking into the
original instance.

Would anyone have some ideas on how to achieve what I want with VB.NET.
Thanks in advance!

Feb 24 '06 #1
4 4749
CMM
VB2005 allows you to easily set your app to be single instance in the
project properties. Not sure if there's some other mechanism to it.

Between .NET apps, the only way to mimic the behavior of ActiveX servers is
to use Remoting (which is not as hard as it first seems) even on the same
machine.

--
-C. Moya
www.cmoya.com
"Mike" <mj*******@gmail.com> wrote in message
news:11*********************@e56g2000cwe.googlegro ups.com...
Hi there,

I'm currently working on converting an ActiveX exe that was written in
VB6 to VB.NET. The original application was written as a TSR which
lives in the system tray providing integration between a web site and
3rd party windows apps (such as MS office, etc...).

I've managed to convert the application to .NET originally using the
upgrade wizard (to get it up to .NET 1.1 and finally up to .NET 2) and
then rewriting a fair bit of the code. However, I'm having a few
difficulties getting the application to run like the old ActiveX exe.
Basically what I want is for this application to:

a.) provide a COM interface
b.) stay resident so that other apps can call it
c.) run as a single instance application (i.e. new apps that call the
program shouldn't start a new instance but should be able to hook into
the running instance).

I've compiled the application as a DLL / assembly and given it a COM
interface, however at present whenever an app tries to talk to the TSR
it starts another instance of it rather then just hooking into the
original instance.

Would anyone have some ideas on how to achieve what I want with VB.NET.
Thanks in advance!

Feb 24 '06 #2

Well with Remoting you can cross the aplication domain boundary`s

i found this book to be verry helpfull
http://www.amazon.com/gp/product/073...Fencoding=UTF8

you can do what you want by creating a singleton component

however

a.) provide a COM interface ' afaik this will start a new instance , so
if you component is running as remoting component and a legacy app connects
through the com interface a new instance is created
b.) stay resident so that other apps can call it override the
InitializeLifetimeService

Public Overrides Function InitializeLifetimeService() As Object

Return Nothing

End Function

c.) run as a single instance application (i.e. new apps that call the
program shouldn't start a new instance but should be able to hook into the
running instance).

this is standard behavior of a remoting singleton
The problem i am facing is that i would like to pass a gui to a win32 app
as you can with a ActiveX exe this doesn`t seem to be possible with .Net
without creating memory leaks etc etc
regards

Michel Posseth [MCP]

"Mike" <mj*******@gmail.com> wrote in message
news:11*********************@e56g2000cwe.googlegro ups.com...
Hi there,

I'm currently working on converting an ActiveX exe that was written in
VB6 to VB.NET. The original application was written as a TSR which
lives in the system tray providing integration between a web site and
3rd party windows apps (such as MS office, etc...).

I've managed to convert the application to .NET originally using the
upgrade wizard (to get it up to .NET 1.1 and finally up to .NET 2) and
then rewriting a fair bit of the code. However, I'm having a few
difficulties getting the application to run like the old ActiveX exe.
Basically what I want is for this application to:

a.) provide a COM interface
b.) stay resident so that other apps can call it
c.) run as a single instance application (i.e. new apps that call the
program shouldn't start a new instance but should be able to hook into
the running instance).

I've compiled the application as a DLL / assembly and given it a COM
interface, however at present whenever an app tries to talk to the TSR
it starts another instance of it rather then just hooking into the
original instance.

Would anyone have some ideas on how to achieve what I want with VB.NET.
Thanks in advance!

Feb 24 '06 #3
> Basically what I want is for this application to:

a.) provide a COM interface
b.) stay resident so that other apps can call it
c.) run as a single instance application (i.e. new apps that call the
program shouldn't start a new instance but should be able to hook into
the running instance).


It sounds like you want a single instance winform application or windows
service. I have a write-up of single instance winforms with 1.x and 2.0 at
http://devauthority.com/blogs/jwoole...07/28/318.aspx.

Jim Wooley
Feb 24 '06 #4
after reading the article
No that is not what he wants with VB6 it is possible to creat a so called
out of process component ( Activex executable ) when this one process is
running
multiple clients can connect to this one sole instance .

In VB.Net this is only possible with Remoting using a singleton , however
then you miss the interop with this functionality to legacy apps and you
can`t pass guis to these clients ( wich could be done in VB6 )
regards

Michel Posseth
"Jim Wooley" <ji*************@hotmail.com> schreef in bericht
news:24*************************@msnews.microsoft. com...
Basically what I want is for this application to:

a.) provide a COM interface
b.) stay resident so that other apps can call it
c.) run as a single instance application (i.e. new apps that call the
program shouldn't start a new instance but should be able to hook into
the running instance).


It sounds like you want a single instance winform application or windows
service. I have a write-up of single instance winforms with 1.x and 2.0 at
http://devauthority.com/blogs/jwoole...07/28/318.aspx.
Jim Wooley

Feb 25 '06 #5

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

Similar topics

1
by: wang xiaoyu | last post by:
Hello: i want use activex in wxpython program,but when i use MakeActiveXClass an exception occurs. this is my source code dealing the DICOM ocx.I must note that in this program "hwtxcontrol" is...
2
by: Fie Fie Niles | last post by:
This one XP machine (with IE 6) is having a problem viewing any ActiveX controls (created on VB6) on the Internet Explorer browser. I put the same ActiveX control in a VB program, and when I run...
18
by: DartmanX | last post by:
Is there a simple way to determine if someone using Internet Explorer has completely disabled ActiveX controls? Jason
61
by: /* frank */ | last post by:
I have to do a homework: make a CPU simulator using C language. I have a set of asm instructions so I have to write a program that should: - load .asm file - view .asm file - do a step by step...
9
by: Nathan | last post by:
A couple of months ago, I went looking for a .NET grid component with what I thought was pretty simple criteria - I wanted an interface that provided my users with Excel-like data entry capability....
21
by: Joe Attardi | last post by:
Hey all! I was reading over at the IE Blog the other day http://http://blogs.msdn.com/ie/] and read some interesting, and encouraging news. According to Sunava Dutta, an IE Program Manager,...
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...
6
by: C a r l o s A n t o n i o | last post by:
Hello, I have to submit a file via HyperTerminal using my PC's internal modem on a daily basis. Does anybodoy know how to accomplish this in VS2005? Any language is good, VB preferred. ...
14
by: Eugeny Myunster | last post by:
Hello all, How can i emulate sizeof() only for integers?
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
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,...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.