473,698 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(Prin tername)
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 3645
On Aug 23, 8:59 pm, "Steve" <ga63...@newsgr oups.nospamwrot e:
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(Prin tername)
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.goo glegroups.com.. .
On Aug 23, 8:59 pm, "Steve" <ga63...@newsgr oups.nospamwrot e:
>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(Pri ntername)
mypos.claim(30 0) ***** Happens here if the driver cannot communicate with
the Printer
mypos.enable d = 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
2877
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 on the disk. Each plugin defines a class which implements an interface known to the app. The main app loads the plugin with Assembly.LoadFrom and then uses Assembly.GetTypes() and Type.FindInterface to find the concrete types in the plugin that...
4
2879
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 not in the manifest of the current AppDomain. I have tried different ways but get exceptions from all of them that say the: assembly or one of its dependancies could not be found. There must be missing something.
1
15946
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 found on disk and I get a TargetInvocationExeption. For example, let's say I have a C# win forms application called Prog. Prog.exe uses Assembly.Load(byte) to load two C# class library assemblies,
4
1823
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
5484
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 all applications will use sessions and to insure that all application use this method, the session properties cannot be overriden. Within the sessionstate tags, the webadmin (upon my request)r emoved the property for timeout, hoping that...
6
44483
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 = @"C:\PMDRepository\Tools\ManfBusProcMgr\Modules\TestModule\bin\Debug\TestModule"; Assembly a = Assembly.Load(modulePath); </code>
7
10957
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 this screen below. Please help, thanks in advance... Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify...
4
4470
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 application dll). It's been working for months and now the it's not working from my application exe anymore but still working from NUnit when testing the dll. What could have changed in my exe? Some configuration thing in my VS2005 project?
7
10076
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 trouble using a library that creates an instance of a Type that i specified, and it failed the locate the Type during runtime, if i do not reference it during compile time.
0
8675
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6521
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.