Jump to content
Xtreme .Net Talk

mjohnson3091

Avatar/Signature
  • Posts

    31
  • Joined

  • Last visited

Everything posted by mjohnson3091

  1. It needs to be static otherwise it returns 0 everytime.
  2. Hi all, Not sure if this is the right forum but here goes anyway. I'm currently trying out some code to reproduce an application written originally in VB 6 which used ActiveX EXE's. The original application had a client (ActiveX EXE) and Manager (Windows EXE). When a user connected to the Manager it would create a new instance of the Client. I'm trying to do the same in .NET using C#, and using a webservice as the client (not sure if that is the best way, so I'm open to comments on that!). The webservice is very simple and just has one method currently that returns the session number. The Manager (windows application) will, when a button is clicked, attempt to add a new session (create an instance of it) and pass it it's session number. The problem I have is that when I request the session number from any of the instances, it always returns the last sessions number. Manager Code below: //DECLARED AS FOLLOWS: private Client.Session Session1; private Client.Session Session2; //INSTANCIATED AS FOLLOWS Session1 = new Client.Session(); mlngSessions=1; Session1.Initialise(mlngSessions); Session2 = new Client.Session(); mlngSessions=2; Session2.Initialise(mlngSessions); // INFORMATION READ AS FOLLOWS: MessageBox.Show ("Response from Session " + Convert.ToString(Session1.get_SessionNumber()),"MANAGER",MessageBoxButtons.OK,MessageBoxIcon.Information); MessageBox.Show ("Response from Session " + Convert.ToString(Session2.get_SessionNumber()),"MANAGER",MessageBoxButtons.OK,MessageBoxIcon.Information); Client Code Below: private static long mlngSessionNumber; [WebMethod] public bool Initialise(long SessionNumber) { mlngSessionNumber=SessionNumber; return(true); } public long SessionNumber { [WebMethod] get { return mlngSessionNumber; } } Any advice greatly appreciated
  3. If you haven't already solved this, you may find that the scanner can be setup with both preambe and postamble, what this means is that you can assign characters to be added to the front and back of the barcode when it is scanned and before it is transmitted to the PC. The scanner will act as a keyboard input, so therefore if you set the focus to a textbox initially, scanning a barcode with a postamb Carriage Return should automatically accept the barcode. Hope that helps
  4. I'm currently looking at rewriting a current application which allows devices running a Terminal Emulator to connect to it to display screens for interaction with the user and a server program. I want this to now use a browser on the device as opposed to a terminal emualtor, but I have some questions/problems..... How can I tell the type of device trying to request a page from the server? With a terminal emulator I can pick up it's IP address and look it up in a DB Table to get its screen parameters. Is there a similare method? Is it possible to resize ASP pages being requested by a mobile device to be viewed in a browser or do I need seperate pages for each device type (i.e.: some devices will be 800*600 some will be 200*200 etc.)? Any advice appreciated.
  5. Thanks for the feedback guys (Nice to hear from someone down the road PlausiblyDamp). The intention was to convert the program to .NET using the migration tool as a rough and ready way in to .NET and to get a little more used to the environment, the idea was then to twist the MD's arm and get us some training about the framework and the ins and outs of .NET. Phase 2 of the project was to rewrite a lot of the code based upon our knowledge gained through the training to make better use of the framework and move away from the legacy VB code in the project to a "pure" .NET based solution. Granted this isn't the best way to approach it, but if I don't show any initiative in wanting to go forward, there is no way he is going to look at moving to .NET. So I suppose I must ask the question again in regards to the ActiveX Exe - any suggestions???
  6. As this is my first post I'd like to say Hi to everyone first. I have been playing at migrating or current multi-tier VB6 program to VB.Net. I used the migration wizard, which did a reasonable job, but also left me with some problems. Our VB6 application top level would spawn off clients which were ActiveX exe's. Upon migration the wizard suggested that the program should be converted to a DLL. I managed to get the program working with a single client, but the problem is, that when the object is created, it doesn't appear with it's own process ID and therefore it is handled differently. When I try to set the object to Nothing this works fine, but trying to instantiate it again gives me "Error 387 - Set not permitted". Is this something to do with it being a DLL and not an Active EXE? I'm using the following code - this is cut down, but should give the idea Private WithEvents objSession1 As BECSessionManager.RFSession '...Within the code (tcpserver Accept) objSession1 = Nothing objSession1 = New BECSessionManager.RFSession ' ...within the code (tcpserver Disconnect) objsession1=Nothing Any suggestions would be really appreciated. Thanks in advance Mark J.
×
×
  • Create New...