Solved

ActiveX.EXE and threading

Posted on 2013-10-22
5
320 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBS file using code from 2nd file (txt or vbs) 4 32
How to code SharePoint 2013 online 4 60
clicking a shape in a frame array vb6 3 40
Excel Automation VBA 19 37
We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

895 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now