Jump to content
Xtreme .Net Talk

mjohnson3091

Avatar/Signature
  • Posts

    31
  • Joined

  • Last visited

Everything posted by mjohnson3091

  1. Thanks for that, I'll have a look into that method. When you mentioned about building the resource files into separate DLL's I'm guessing that these can then be managed in code, for example if the user selects a different language from the application itself as opposed to the machine Locale setting? I'm just thinking on the mobile devices, the default Locale would be English, but they may have Polish or German operators for these devices, so they would need to be "hot-swappable" so to speak. Thanks, Mark
  2. Hi all, I'm just looking for some advice on the best way to go about making a current c# application multi-lingual. Currently all the text for controls captions and messages are coded in to the application, so I was wondering what the best approach would be. My thoughts were to store all the strings in a database table (as the application uses a DB anyway) and read them in at start up into a class and then use them that way (ie. cmdOK.caption = Lang.OK;) The problem I have with that is how to go about extracting all the text from within the code. Any suggestions other than a manual approach?? Alternatively, as this hasn't taken place yet, I'm open to other suggestions. Please take into account that this application is running on a mobile device. Thanks in advance for any suggestions/advice. Mark
  3. Hi, I'm writing some code in c# for a mobile device. I have a list view that raises the ItemActivate event on a double click or by the user selecting an item using the cursor keys and pressing Enter. This may be a silly question, but how can I determine whether it was the double click or the Enter/Return key pressed that raises the event? Thanks in advance. Mark
  4. Hi, I've posted here as I don't think this falls under one particular heading. I've got a web app written in C# which uses some VB6 dll's and it runs fine on my machine. The problem I have is getting it to work on other machines (everything else works in the program apart from the bit that uses the DLLs) and also build problems. My first question is related to the DLL's. .NET creates and interop file for use to reference the original DLL, so I assume it's necessary to deploy the original DLL along with the web app. My question is, does the original DLL need to be installed in the exact same folder on the target machine as it was on the development machine? I've tried installing and registering the DLLs in the BIN folder of the webapp, also creating the same structure as my development machine and still no joy, so any advice appreciated it there. My second question is related to the building of the web app. I've created a setup kit for a web app, and I've added the compiled website code to it. The MSI builds without errors, but when I attempt to run it gives an error "Installation was interrupted before XYZ could be installed". This has only just started happening, as I've used the same technique to build the application previous, so once again, any advice appreciated. Regards, Mark J.
  5. I'm writing a program for Mobile devices (in c# and VS2003) which runs on a variety of operating systems (PocketPC / CE.NET / Windows Mobile 5) and have different screen sizes. At the moment, I've only deployed on 2 devices (one CE.NET 4.2 with a screen of 800*600 and one PocketPC with a screen 200*320). I'm using the screen size as a determinate between whether to display the forms for the 800*600 device or the 200*320, which works OK. I've now got the problem that I need to deploy this application on to a CE.NET 4.2 device with a 320*200 screen and I get problems with screen layouts due to menu positioning etc. Is there a simple way to determine the OS of the device then I can select the relevant forms or indeed a way of automatically changing the forms between CE and PocketPC friendly type (i.e. Menu positioning) so I don't need to design new forms for each device type. Another point is that I have all the forms for the different devices in the same project, so when it is compiled, it has all the forms, which makes the footprint for the application quite large. What the standard practice for handling this? Can the project be split into seperate projects in one solution and share some of the common functionality files? I'll rty to explain below... Current Layout SolutionTest |---Project |---PocketPCForm1 |---PocketPCForm2 |---WinCEFormSmall1 |---WinCEFormSmall2 |---WinCEFormBig1 |---WinCEFormBig2 |---clsDatabaseAccess |---clsRegistryAccess Thoughts as follows: SolutionTest |---ProjectPocketPC | |---Form1 | |---Form2 |---ProjectWinCESmall | |---Form1 | |---Form2 |---ProjectWinCEBig | |---Form1 | |---Form2 | |---clsDatabaseAccess *Classes Shared amoungst project |---clsRegistryAccess *without duplicating them? Hope that makes sense Any advice greatly appreciated.
  6. Hi all, First of all let me say that i'm a real novice with VS2005 and mobile apps. I've got a real problem with an application in VS2005 for Compact Framework 2 on a device running PocketPC2003. I'll try to explain the problem.... I have a number of forms that "communicate" to a backend server through a single form (I'll call it Main for identification purposes). These other forms could be menus or function screens. On creation of each form, I create an instance member for that form and for the main form as follows: //current instance of main form - for comms frmMain frmMainFormInstance; //current instance of this form - for comms private static frmMenu InspInstance = null; public static frmMenu Instance() { if (InspInstance == null) { InspInstance = new frmMenu (); } return InspInstance; } I have a public routines in Main that will send and receive data and can be called from each other form using the instance of Main. So i can send data as below. private void SendMessage(string strField, string strData) { frmMainFormInstance.SendData( strField + "" + Globals.cstFieldDelimiter + strData); } When a response to a send is received in main, it sends the data back to the public "ReadMessage" routine on the relevent form as follows: frmMenuInstance = frmMenu .Instance(); frmMenuInstance .ReadMessage(strField, strResult, strData); So far all this works fine...... The problem I have is when I come to work with any of the controls on the form, for example a label. In the ReadMessage routine on frmMenu, if I try to write some text to a label I get the message "TextAlign = 'InspInstance.label1.TextAlign' threw an exception of type 'System.NotSupportedException' " and this seems to be the same for all labels on the form. Even though VS2005 is deploying the "Message" DLL for the device, it doesn't give me anymore specific information about the error. When it creates the initial instance and I can write to the labels without any problems. I hope all that made some sense to somebody. Any suggestions/advice would be really helpful.
  7. As my dynamic form creation playing is getting further I seem to be getting more problems. I'm creating a form based upon a received XML message, which may or maynot contain a call to create a new PictureBox. If it does, I create the picturebox and all that works fine. The problem I have is, if I assign an event to a button, for example to save the image from the PictureBox, the code won't compile, because it tells me that the reference to the picturebox doesn't exist, which I suppose is true as it hasn't been created yet. How can I get around this? Example of my code... // This is called if we need to add a new picturebox void AddPicture() { PictureBox img1 = new PictureBox(); img1.Width=200; img1.Height=200; img1.Left=50; img1.Top=50; img1.BackColor=Color.White; this.Controls.Add(img1); img1.Visible=true; } // This is called to attempt to save the image void SavePicture() { ((PictureBox) img1).Image.Save("C:\\temp\\pic.bmp"); } I can understand why it fails, because at design time img1 doesn't exist, I just don't know how to solve it or get around it. Any help appreciated. Thanks in advance.
  8. A bit silly of me - works a treat mate, thanks.
  9. I'm looking at creating a form layout dynamically from an XML document. The parsing of the XML data i'm fine with and the creating of the controls I think I'm ok with, it's just the naming of them. The code below is a cutdown example of what I'm using to draw the form. I'm using C# and hope to deploy this onto mobile devices at some point. // Loop around the number of Data items and draw the form for(intLoop=0;intLoop<dtData.Rows.Count;intLoop++) { switch(dtData.Rows[intLoop]["Type"]) { case "Button": { Button btn1 = new Button(); btn1.Width=dtData.Rows[intLoop]["Width"]; btn1.Height=dtData.Rows[intLoop]["Height"]; // ..... etc. for the properties this.Controls.Add(btn1); btn1.Visible=true; } } } In this example I'm using the name btn1, would I be better passing the names in the XML message? If so, how can I use the string field I get as a name (i.e.: If I pass the string "Button1" in the XML message and assign it to a string variable, strName, then will the new Button not take the name strName instead of its value)? Hope that makes sense. Thanks in advance.
  10. Thanks for the reply. I think that would give me a timer object, but as I was planning on storing them in a sorted list, each Timer would have the same name and an integer key as an ID. It's the integer key that I'm looking for. If I'm completely wrong in my understanding, please tell me how I can reference it back to the Sorted List and get the relevant ID. Thanks again.
  11. Hi all, I'm trying to create a set of timers and store them in a SortedList identified with a number stored in a variable. All the timers will point to the same TimerElapsed handling code. Is there anyway to get the Elapsed code to recognise which timer elapsed? Thanks in advance. // Called each time need to add a new timer. System.Timers.Timer ClientTimer = new System.Timers.Timer(); ClientTimer.Enabled = true; ClientTimer.Interval = 5000; ClientTimer.Elapsed += new System.Timers.ElapsedEventHandler(ClientTimerTimeout); mTimers.Add(mintClientID,ClientTimer); The Timer Elapsed hadling code is below. private void ClientTimerTimeout(object sender, System.Timers.ElapsedEventArgs e) { System.Windows.Forms.MessageBox.Show("Elapsed!", "Timer Event Raised!"); }
  12. I'm just having a play about with XML as I've never used it before and I've encountered a problem that I can't seem to figure out. I've got a simple XML message as a string and convert it to a StringReader stream. I then try to pass that to a DataSet using the ReadXML method, but it gives me a System error. Reading the same message from a file seems to work fine. I've attached the code, so if anybody can shed any light I would greatly appreciate it. Regards, Mark J. XMLTest.zip
  13. Thanks for the reply Wile. I found it very informative in regards to what I've done. Thanks again.
  14. Hmmmm it isn't as easy as I thought! :confused: The idea has changed slightly from how I first planned so maybe this impacts how it works.. I have a single application that will accept connections from remote devices. I want this application to create a new thread for each connection to process the messages. I want the main process to still receive the messages and send them on to the correct thread for processing. The problem is how can I do that? For example I have 5 threads (in this case they have started a form) and I want to say, set a value on thread 3 because I received a message from remote connection 3. How would I do that. Any explanation would be appreciated, as I'm not sure if I can actually do what i want to do. Thanks again.
  15. Thanks for the reply Diesel. I didn't expect it to be as simple as that. In regards to the form thing, I'm looking at other ways of dealing with that. Thanks again.
  16. Hi, I'm quite new to the idea of threading and was wondering what was the best way to handle the following... I have an application that is going to accept socket connections from various other remote devices. I want to create a new thread to handle each of these connections. I'm OK, I think, on how to do that, it's just the best way to handle the threads to keep track of them, for example if another message comes in from one remote device, I need to route that message to the correct thread for processing. What would be the best way to handle that? Any suggestions appreciated. Also as a side note, this may be a really stupid question, but if I have and application with a form and a class, how do I update controls (i.e.: textboxes) on that form from my class? I can't seem to reference them. BTW I'm working in C# but I'm familiar with VB also. Thanks in advance for any assistance. Mark
  17. Thanks mate, I'll bear that in mind. Looks like it's back to the drawing board then! :)
  18. Ah, thats making more sense.... The complete model is the Manager, Client (Business Services) and a Data Layer. So in this case the Client Webservice would be handling Business Services such as PO Reception in a warehouse, which maybe being carried out by more than one user, and therefore need to keep some kind of state on the current transaction for the current user, hence the reason for using seperate ActiveX Exes in the VB6 version. So what would you suggest would be the best way forward, because one advantage of using the ActiveX exes, was that is one client "died" it didn't affect the whole system. Thanks again for your help on this. I'm new to .NET and it's a little different!
  19. There's no reason why it couldn't have a non-permanent connection. The comms with the webservice is exactly what I want to do as you described, the problem I have is that I want multiple instances of the webservice as I tried to explain in the first post. The problem I get is that the system doesn't seem to do that, or it give unexpected results (like returning the session number of the last session, not the one requested).
  20. The manager app takes the information from the remote terminals via sockets (normally data scanned from barcodes). it then passes that data to the relevant client instance that processes the data. Each client has a permanently open connection via another lower data layer. Hope that helps.
  21. Thanks for the reply. I tried to explain in my first post, but I suppose it isn't the easiest thing to explain. Let me try again. In the current VB6 application, we have a manager program (Windows EXE) which handles connections from remote hand-held terminals through sockets. Once a connection is established, we would create an instance of the Client (ActiveX EXE), which then creates it's own connection to a SQL database, so each client can communicate independently. What I'm trying to acheive is the same in .NET using C#. It was my understanding that there isn't such a thing as an ActiveX EXE under .NET, hence the reason for trying to use a webservice. Hope thats a clearer explanation.
×
×
  • Create New...