Solved

ActiveX.EXE and threading

Posted on 2013-10-22
5
317 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
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.
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…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

762 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

11 Experts available now in Live!

Get 1:1 Help Now