Solved

ActiveX.EXE and threading

Posted on 2013-10-22
5
328 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

696 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