Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. Returning 0 simply means the two items you are comparing are equal, this however doesn't make any claims about the items position in the sorted list. i.e. If you say "Mouse" and "Manatee" are to be treated as equal by your sorting routine then Mouse, Manatee or Manatee, Mouse are both valid orderings for the results. The exact order would depend on the internal sorting algorithm used by Array.Sort - which is really an implementation detail and cannot be relied upon as this could change in future anyway. If you want to maintain an explicit order you would either need to handle this yourself or include the current position in the IComparer comparison.
  2. Make the method protected rather than private and it should be fine.
  3. Are you increasing the version number of the setup package each time? It will only work if you do.
  4. If you are creating the setup package through visual studio then check the properties of the setup package - there is an option to uninstall previous versions.
  5. If you build a release version you can still generate debug symbols to help. When it crashes if the PC has Visual Studio (or other registered debugger) you should be prompted to debug on a crash - do so and at the very least you will get a stack trace that can identify the source of the problem.
  6. Are you using these APIs just within your own windows or are you accessing the pixels of other process' windows? You could always call the DwmEnableComposition API and disable it while your application is running.
  7. If you have a debug build running you can always attach a debugger once the application has crashed - this could indicate where the problem is occuring. The fact it looks like a memory access violation though would indicate the problem lies outside of .Net itself so I would look at the MODI ActiveX component as a possible source. Are you reusing the component in the loop or creating and destroying it each time the loop executes? Does it crash doing anything in particular or is it just based on the uptime?
  8. The two decimal points would prevent the numbers being stored as a single, double or decimal. You might find the easiest way is to split the strings by the "." character and then convert each of the sections into an integer similar to the following... Dim NumberOne As String Dim NumberTwo As String NumberOne = "1.2.3" NumberTwo = "3.2.1" Dim nums1() As String nums1 = Split(NumberOne, ".") Dim nums2() As String nums2 = Split(NumberTwo, ".") Dim v1 As Integer Dim v2 As Integer Dim i As Integer For i = 0 To Len(nums1) v1 = CInt(nums1(i)) v2 = CInt(nums2(i)) If v1 > v2 Then 'v1 is biggest ElseIf v2 > v1 Then 'v2 is biggest End If Next 'both are same That might not be exact as I don't have vb6 on this pc so it is a bit from memory. It might be easier still though if you created either a class or a type to hold the version information as three separate integers and have a function that would compare the these types.
  9. Could you post the code you have so far? It is a lot easier for people to offer help if they have something to go on. As a pointer though .Net provides the Date and TimeSpan classes that allow you to work with dates and durations.
  10. Have you considered implementng the server side process as a web service? That way you could use xml as a transport format and the issue of binary compatability between the different platforms wouldn't be an issue.
  11. Do these numbers match up with a particular field or would they simply be based on the data returned? Out of interest what database are you using?
  12. Do the records have a sequential identifier or similar? How would you normally identify which record you want to start at?
  13. DataReaders are designed to be accessed in a sequential manner, there is no way to skip to a certain row without reading all the rows before it. Personally I would change the select statement to just bring back the rows I am interested in rather than all rows. You might alslo want to look at parameterising the query as building a string that way can open you up to security risks.
  14. Could you not just simply load the image into the control at runtime rather than changing it's position?
  15. How large are the files you are looking at hashing? Could the hash / comparison not be done in a background thread while the UI is doing something useful? Given any reasonably large file size you are going to struggle to get a hash under 1 second, disk IO alone could account for more than that.
  16. It really depends on exactly what you want to do as which method may be best, are you using the timer to drive some animation or is it being used for some other reason? SetLeft and SetTop (methods of the Canvas object) will certainly give you control over the position of a visible element however if you are looking at just doing animation then WPF has a pretty sophisticated system built in that may better suit your needs. Out of curiosity could you give a bit more detail about what you are trying to do?
  17. Roughly how many properties are you looking at and how many of them would be used in a typical object? If there are a great deal of 'optional' properties then it may be worth considering a different approach. Would it be possible to group related properties into classes of their own? e.g. a file class could expose a path property and a crc property. These could then be properties of the parent object - this would give a more obvious grouping of properties and still provide compile time validation of the syntax. e.g. variable.File.Path type of syntax. If there isn't a common set of properties then you may find defining one or more interfaces that group the properties into a logical group and then having one or more classes that implement the relevant interfaces. Without knowing more about the system and existing design though it is quite difficult to be sure what would work best, relying on runtime interpretation of strings might not be the best solution though.
  18. Updating the UI from a non-UI thread is a no no anyway, perhaps win64 is less tolerant than win32 on these matters.
  19. Depending on how happy you are about false positives or not then a simple check like a crc-32 may be good enough http://groups.google.co.uk/group/microsoft.public.dotnet.languages.csharp/msg/cd16c628369cfa4e?dmode=source has some example code that might be worth investigating. One possible solution is to compare crcs and if you get a match then use a more accurate hashing routine like md5 or sha. Alternatively you could generate hashes over a small part of the file (take a particular amount of bytes from the start) and if you get a match then generate a hash over the next chunk from the file. For a file of any size however you are always going to get a potential delay when doing this kind of thing.
  20. I've raised the issue with iNet interactive and will keep you informed of any further development.
  21. Have you tried including the crystal reports merge module in your setup package?
  22. You could create a DLL in straight C and therefore avoid the name mangling issue entirely, alternatively if you are creating a C++ DLL you could expose C functions that expose the functionality and call into the underlying C++ objects. Have you tried creating a managed C++ project and seeing if you can use assembly code that way?
  23. How did you create the vb.net dll? You need to make sure the dll itself is also made COMVisible (there should be an option from the property pages somewhere or in the assemblyInfo.vb file add a line.. and see if that helps.
  24. Under what situation have you managed to get this exception thrown? Also have you tried handling it in the MyApplication_UnhandledException event?
  25. The thread would need to check if the form has InvokeRequired = true not the radio button itself. Could you not just set the status of the textbox from the radio button's click event rather than rely on the thread doing this though?
×
×
  • Create New...