Solved

ActiveX.EXE and threading

Posted on 2013-10-22
5
323 Views
Last Modified: 2013-11-25
I have an application that connects to multiple pieces of automated packaging equipment. The main form of my application is just the gui. When the program starts it creates multiple instances of an activex.exe for each piece of packaging equipment. The activex establishes a tcp connection to the machine and monitors its status. It reports back to the main gui status information so the user can take action. My question is if i have the activex set as multi use each instance of the active x running in its own thread? Or do i want these to be single use?
0
Comment
Question by:Basicfarmer
  • 2
5 Comments
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 39596155
If I'm not mistaken, multiuse or singleuse applies to the class, not to exe. So ActiveX exe creates multiple instances of the same class, they run asynchronously, but it's all within one process represented by ActiveX exe. Is that how you have it? if not, then where exactly do you see the choice between single use and multiuse?
0
 

Author Comment

by:Basicfarmer
ID: 39597309
If I run it as single use and I go to the task manager I see that an activex is running for each instance I have created the class. If I select multiuse, then I only see one activex in the task manager. So I am wondering if using multiuse if a new class is instantiated for each piece of equipment that I am monitoring and if those are all running in their own thread.
0
 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 500 total points
ID: 39597588
Yes, each instance of the class specified as multiuse runs in its own thread. Make sure to specify correct threading model in the Properties of the project. But all this has quite a few nuances, such as avoiding creation of the main form on each thread, using "createobject" instead of "new", and more. Back in times of VB6 ActiveX EXE was the only way to have multithreaded application written in VB*, but today writing .Net-based application in Visual Studio would make much more sense. .Net Framework has far better support for multithreading,

*) we actually have here exactly such an application we created, doing things very similar to yours.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question