473,396 Members | 1,998 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.

Hosting .NET Control that uses Invoke in ActiveX Container

Hello,

I've written a Windows Forms application in .NET 2.0 and am exposing
it to COM using the checkbox in Project Properties and by adding some
register functions and adding it to the GAC. I'm using the ActiveX
Test Container (tstcon32.exe) and I'm able to add the control to the
container. All this works, well almost... I'm using some Invoke calls
from worker threads that update the GUI. In native .NET this means
that stuff is done on the GUI thread, which is accessed by using a
pointer to the parent window. Of course, in a container we don't have
such a thing. My initial thought was to use the HWnd pointer of the
Container window and I can find this value my looking up
CurrentProcess and all. But how do I couple that value to the Invoke
call ? Maybe this is not the recommended way...

Any thoughts ?

Regards,

Janiek
Jun 2 '06 #1
1 3060
Hi guys,

Found the mistake. I attached event handlers to the worker threads in
my GUI constructor. In a .NET application this went well, however in
an ActiveX container this went wrong. I simply moved the event handler
attachments to the control's Load() event. This seems to work.

Greets,

JB

On Fri, 02 Jun 2006 11:32:22 +0200, Janiek Buysrogge
<J.*********@Televic.com> wrote:
Hello,

I've written a Windows Forms application in .NET 2.0 and am exposing
it to COM using the checkbox in Project Properties and by adding some
register functions and adding it to the GAC. I'm using the ActiveX
Test Container (tstcon32.exe) and I'm able to add the control to the
container. All this works, well almost... I'm using some Invoke calls
from worker threads that update the GUI. In native .NET this means
that stuff is done on the GUI thread, which is accessed by using a
pointer to the parent window. Of course, in a container we don't have
such a thing. My initial thought was to use the HWnd pointer of the
Container window and I can find this value my looking up
CurrentProcess and all. But how do I couple that value to the Invoke
call ? Maybe this is not the recommended way...

Any thoughts ?

Regards,

Janiek


Jun 12 '06 #2

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

Similar topics

0
by: Gary | last post by:
sorry for not cross-posting originally (originally posted in the components subgroup) I seem to have run into two documented bugs whose workarounds are incompatible. What I have is an OCX...
2
by: Sunny | last post by:
Hi all, My dev platform: VS .net 2003, win2000pro, office 2000, MOD 2000, C#. Bellow you may read my posting in other group. According that issue, I have dig around and I'm wondering ... My...
3
by: fumihiko | last post by:
Hi, I created an activex control (C++), and it uses another COM dll (C++). This COM dll links with a static library that dose some calculation. (both are debug multithreaded dll) I created a...
0
by: 詹亚军 | last post by:
can activex control export large data to container by event's para ? I develop a activex control,and want to export large data to container(IE),web page can use javascript to capture the...
1
by: Vinay Chopra | last post by:
Hi, I have created an ActiveX control using MFC activeX control wizard and added a dialog to it. Now on that Dialog I dragged a Button control and gave a "hello world" message on it click. When I...
1
by: None | last post by:
Hello In order to host and use an ActiveX control (non-GUI) in a WTL app, I followed the following steps: 1. During project creation, the ActiveX Hosting option is enabled. 2. In the dialog...
0
by: Dave Taylor | last post by:
I have an ActiveX control on a Windows form that provides OPC client functionality. The control has no visible elements. I would like to write a class which uses the control to pass data to an OPC...
7
by: Khaled Hussein | last post by:
Hi Every body, I am currently working in aproject where I am stuck in merging an ActiveX control (*.ocx) file into a managed Class Library (*.dll). I want to hide the ActiveX Control in this...
10
by: Benton | last post by:
Hi there, I have a UserControl with a couple of textboxes and a couple of buttons ("Save" and "Cancel"). The Click event for this buttons is in the UserControl's codebehind of course, so here's...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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,...

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.