Jump to content
Xtreme .Net Talk

kejpa

Avatar/Signature
  • Posts

    321
  • Joined

  • Last visited

Everything posted by kejpa

  1. Hi, Should be simple but I'm stuck! I want to retieve the selected text of a DBGrid-field. The field contains a number of words and I want to select one of them and then click on "Filter" to filter out records containing that word (in that field) but I cannot get the selected text. Any help or directions appreciated /Kejpa
  2. Hi, I am reading external devices which at an end point gives me Integer.MinValue and at the other end point is giving me Integer.MaxValue. Both are valid values and so is any value in between, thus when I don't get a signal (or the checksum is invalid) I can't return MinValue nor MaxValue nor any other. That's why NaN would come in handy. With VB6 you could trick the program to return 1.#INF using "On error resume next" and do some overflow arithmetic. Any calculations would result in 1.#INF and when showing the value I could have a quick check for 1.#INF and either show the correct value or "NaN" Best regards /Kejpa
  3. No, the max/min values _could_ be valid values although very rare. Just like using 0. What I need is to return a value that is not valid, just like System.Double.NaN is a valid double return value but you cannot use it for further calculations
  4. Hi, passing System.Double.NaN is wonderful for stating that the value is not available or not possible to calculate. How can I implement this on integers and longs? Regards /Kejpa
  5. kejpa

    Why 'Finally'

    SO, the Finally block executes even if I return in the catch or try blocks. Great! Alright, finally I get it ;) Thanx a bounch. /Kejpa
  6. kejpa

    Why 'Finally'

    That's something more that I didn't think about. Makes sense... Thanx for the lecture ;) Best /Kejpa
  7. Hi there, can you Masters explain why I should use 'Finally' in my exception blocks? Try ' ... Some code .... Catch ee as Exception msgbox ("Repent") Finally ' ... Huh? Why? End Try ' More code Anything after the End Try block will be executed, won't it? As well as anything in the Finally block. Or am I missing something cruisial Confused, but struggling /Kejpa
  8. Thanx JABE, I'm still not satisfied though. I know I can use collections, Arrays, lists (and now DataViews) but I'm not sure which is the best approach. In VB6 you couldn't sort anything but Recordsets without creating your own sort routines, now that you can I'm curious to what the benefits and sraw backs are of the different containers. Point of directions wanted. Regards /Kejpa
  9. Hi, I have a number of objects I need to sort and to filter in order to get the best match for the current situation. In my old VB6 app I used a disconnected recordset. Basically because it allowed me to filter the records and sort the result. The record was added and removed dynamically and never saved. In my new design I'm not sure how to best change this. It dosn't seem too clever to use old ADO when there's so many new options. Arrays, Lists, Collections all of them is sortable, no? Any ideas of the best way to solve this? Regards /Kejpa
  10. Hey there, monday and back at work ;) You're right about who's acting and who's just keeping an eye in the User case. I'll change my view on that. Still... I'm listening to a number of serial ports where I get online values that will be used for further calculations. Which ports and the number of ports are dynamic depending on the location (and so I set that up in a database). The handling though has to be done in a central dedicated object, not in the communication objects. And so we're back, one container object that will respond on child objects. If I knew that there were only to be a fixed number of ports I need to listen to, I'd declare them using WithEvents. For flexibility I'm using an array but I still needs get the events, don't I? Should I have a closer look at delegates, maybe? Have a great day /Kejpa
  11. Well Joe, I don't know about your boss, my my boss acts on the event of my arrival at the desk with a "Greetings to thee, oh impressive Kejpa", of course, that is after offering me coffee ;) See, the container acts on events of the contained object. Different actions for different object, I'm the only one who gets coffee but some others get tea. ArrayList, I'll have to have a look at that. Thanx a bunch. /Kejpa
  12. Hi, No, the array doesn't time out. It's the objects in the array that is timing out. Maybe I was unclear about that. I can't see how changing from an array of user objects to an array of userSession objects will help me raising an event in the collection class. :confused: It's an array of objects (User or UserSession or something else) where something (timeout or log out or arrival of new data) happens in one of the objects in the array and the class keeping the objects needs to respond on that action. Have I made myself better understood? TIA /Kejpa
  13. Hi, I have a collection of Users object, in each of those objects I want to raise an timeout event when the user has had a period of inactivity. In the collection class I want to raise an event when a user gets timed out. I've tried using withevents on the array of objects but that's not allowed, so how do I solve this? TIA Kejpa
  14. Hi all, how do you get the size of a folder in vb.net? With vb6 you could use the FileSystemObject and... Set fso = New FileSystemObject Set fsoFolder = fso.GetFolder(sPath) lDirSize = Val(fsoFolder.Size) isn't there a better way nowadays? /Kejpa
  15. On the other hand... Why can't I use the c-header file? .NET _is_ multilingual, isn't it? Just a thought. /Kejpa
  16. Hi there, I'm trying to call a DLL (non-COM) and I need to convert some structs from C notation to VB.NET I have it working in VB6 but since we're moving on we need it in .NET too typedef struct { long id; /* id */ unsigned char len; /* length of message: 0-8 */ unsigned char msg_lost; /* count of lost rx-messages */ unsigned char reserved[2]; /* reserved */ unsigned char data[8]; /* 8 data-bytes */ } CMSG; typedef struct { long evid; /* event-id */ unsigned char len; /* length of message: 0-8 */ unsigned char reserved[3]; /* reserved */ union { unsigned char c[8]; unsigned short s[4]; unsigned long l[2]; } evdata; } EVMSG; typedef struct { unsigned short hardware; unsigned short firmware; unsigned short driver; unsigned short dll; unsigned long boardstatus; unsigned char boardid[16]; } CSTATUS; When using the upgrade tool I get some strange suggestions and TODO's and it has to be possible to do this in a simple matter. No? Any help appreciated /Kejpa
  17. As I feared, you'll have to code your own format and you have to do your own checking for valid times :( It would have been soooo much easier to be able to use the format function, say "hhh:mm" would have resulted in hours and minutes, not limited by the length of the day, "mmm:ss" would have made the same thing giving the number of minutes and seconds not limited by the 60 minutes of an hour. Thanx anyway. /Kejpa
  18. Hi, I'd like to be able to show times over than one day in a textbox. I'd like a format that is capable of showing hours and minutes like 99:49 and not like 4d 03:49 Does I have to make this myself or is there a way of using the format function?
  19. Does the file "C:\DBs\CDColl.mdb" exist? My wild guess is that it's missing! The server in this concept is the database server, which more or less is the database. Do NOT overpost, just the information you supplied where enough. We do not want your complete source. Regards /Kejpa
  20. You could have a global variable that you increment everytime you create a new object from the specific class. /Kejpa
×
×
  • Create New...