473,414 Members | 1,630 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,414 software developers and data experts.

Timeout on a .net assembly load

Hi All

I have a POS program (Windows app) . I am using VB.net 2005 Pro

The OPOS drivers freezes my program if Parallel port is configured for the
Receipt printer and the Printer is not connected or is turned off
The freezing happens when I try to Claim the device e.g

I am using a .net assembly OPOSPOSPrinter.dll

mypos = new OPOSPOSPrinter
mypos.open(Printername)
mypos.claim(300) ***** Happens here if the driver cannot communicate with
the Printer
mypos.enabled = True

There is no connection timeout on the Parallel printer driver for some
strange reason and the POS program has to be crashed.
Serial and USB versions of the Driver timeout OK
Is there anyway to configure a timeout on the code above
in vb, to kill the driver after say 3 seconds, if the
printer is not responding, so my program can continue to load.?

Regards
Steve

Aug 24 '07 #1
2 3630
On Aug 23, 8:59 pm, "Steve" <ga63...@newsgroups.nospamwrote:
Hi All

I have a POS program (Windows app) . I am using VB.net 2005 Pro

The OPOS drivers freezes my program if Parallel port is configured for the
Receipt printer and the Printer is not connected or is turned off
The freezing happens when I try to Claim the device e.g

I am using a .net assembly OPOSPOSPrinter.dll

mypos = new OPOSPOSPrinter
mypos.open(Printername)
mypos.claim(300) ***** Happens here if the driver cannot communicate with
the Printer
mypos.enabled = True

There is no connection timeout on the Parallel printer driver for some
strange reason and the POS program has to be crashed.
Serial and USB versions of the Driver timeout OK

Is there anyway to configure a timeout on the code above
in vb, to kill the driver after say 3 seconds, if the
printer is not responding, so my program can continue to load.?

Does it ever return? Could you move that code off into another thread
so the rest of your app is not frozen?

Chris

Aug 24 '07 #2
Hi Chris

I never returns, so your idea is a good one

Running the code in a thread would lock the thread. How could I then force
the thread to terminate?

Regards
Steve

"Chris Dunaway" <du******@gmail.comwrote in message
news:11**********************@x40g2000prg.googlegr oups.com...
On Aug 23, 8:59 pm, "Steve" <ga63...@newsgroups.nospamwrote:
>Hi All

I have a POS program (Windows app) . I am using VB.net 2005 Pro

The OPOS drivers freezes my program if Parallel port is configured for
the
Receipt printer and the Printer is not connected or is turned off
The freezing happens when I try to Claim the device e.g

I am using a .net assembly OPOSPOSPrinter.dll

mypos = new OPOSPOSPrinter
mypos.open(Printername)
mypos.claim(300) ***** Happens here if the driver cannot communicate with
the Printer
mypos.enabled = True

There is no connection timeout on the Parallel printer driver for some
strange reason and the POS program has to be crashed.
Serial and USB versions of the Driver timeout OK

Is there anyway to configure a timeout on the code above
in vb, to kill the driver after say 3 seconds, if the
printer is not responding, so my program can continue to load.?


Does it ever return? Could you move that code off into another thread
so the rest of your app is not frozen?

Chris

Aug 24 '07 #3

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

Similar topics

4
by: Arnaud Debaene | last post by:
Hello group. I have an app which can load "plugins" assemblies that are described in the registry (each registry entry gives the full path to the plugin ..dll file). The plugins may be anywhere...
4
by: Mark | last post by:
I wan't to be able to deserialize a class from an assembly that is not in the application domain. To do that I must have the Type from the Assembly. How do you get a Type from an assembly that is...
1
by: Greg Patrick | last post by:
My problem: I load an some assemblies (strong named) from a byte array using Assembly.Load(byte). They load fine. But one one of them is actually accessed, it's referenced assemblies can't be...
4
by: Aashish Patil | last post by:
Hi, My code is trying to load an assembly using Assembly.Load(string assemblyName); Assume that the current executing assembly is called Test.dll The following code works fine
8
by: bdeviled | last post by:
I am deploying to a web environment that uses load balancing and to insure that sessions persist across servers, the environment uses SQL to manage sessions. The machine.config file determines how...
6
by: Steve | last post by:
I'm playing with late binding and trying a very simple test to load an assembly In my "Host" application I have this code: <code> string modulePath =...
7
by: R Reyes | last post by:
Can someone please explain to me why I can't get the MS Word Interop assembly to work in my VS2005 project? I'm trying to manipulate MS Word from my Web Form application and I can't get passed...
4
by: =?Utf-8?B?SmFu?= | last post by:
I have a .NET 2.0 application divided in two assemblies; the exe and a dll. The application generates a plugin-dll which is then loaded in a separate AppDomain (along with a second instance of my...
7
by: chage | last post by:
Hi, I have been searching around to try adding reference assembly to another assembly during runtime, programatically. Is this possible in .Net? The reason for this is because i am having...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.