dcsimg

Search:

Type: Posts; User: Elroy

Page 1 of 13 1 2 3 4

Search: Search took 0.08 seconds.

  1. Replies
    8
    Views
    275

    Re: Option Explicit Ignored

    I get so tired of self-appointed policing. I hold at least 4 licenses to VB6, and the client I'm at holds 2 of his own. And, there are only two of us that are programmers. So, I believe the...
  2. Replies
    8
    Views
    275

    Re: Option Explicit Ignored

    Ok, no, the Sub Test is not being called anywhere.

    But, I'm still confused on a couple of counts.

    For one, I thought turning OFF the "Compile On Demand" was the same as forcing a "Start With...
  3. Replies
    8
    Views
    275

    [RESOLVED] Option Explicit Ignored

    Ok, a really weird one.

    I just installed the IDE on a Win10-64 machine (yeah, we've got plenty of licenses), I fire up a new project, start a new BAS module, and then type this:



    Option...
  4. Re: Numeric Property returns 0 although we did not assign 0

    Good point, and I totally agree. I just didn't want to complicate the answer. And yeah, if an Integer or Long isn't being passed in, Davor, you might consider throwing a Type Mismatch (#13) error....
  5. Re: Numeric Property returns 0 although we did not assign 0

    Yeah, I was going to point that out as well. You can assign an empty string to a string. Or, there is a minor (but rather useless) distinction between an empty string and an unassigned string. But...
  6. Re: [RESOLVED] ByRef argument error when calling function

    I just looked at it, and didn't see a problem with the Office automation objects. What I saw was the unusual use of the m variable. For one, I couldn't see where it was declared (which suggest you...
  7. Replies
    9
    Views
    266

    Re: wait unit finished

    Dil, that's certainly news to me. The Reset statement talks about flushing write buffers, but here's a quote from the Close MSDN:



    So, at least from trying to interpret the MSDN, Close does...
  8. Replies
    9
    Views
    266

    Re: wait unit finished

    I'm pretty certain the file is closed before the Close #1 returns. There are still many places where I read and write ASCII files. And I'll often close them and re-open them in some other mode, and...
  9. Re: Creating control arrays with nested components

    Ilia,

    Also, maybe I should have said this before, you may want to check out the Controls.Add method. That allows you to add controls from scratch (without your "first" control). There's nothing...
  10. Re: Creating control arrays with nested components

    Set Label.Container = Picture4

    EDIT1: I'm not sure what the default property of the PictureBox is, but that's all you're changing with the way you've got it.

    EDIT2: After a bit of research,...
  11. Replies
    6
    Views
    246

    Re: improve this code lags because of loop

    Doberman,

    I didn't study your code in detail, but the following procedure may help you.



    Option Explicit
    '
    Private Declare Function SendMessageW Lib "user32" (ByVal hWnd As Long, ByVal...
  12. Replies
    20
    Views
    755

    Re: Detect power outage

    I've got two APC UPS units, one runs my NAS box and the modem and routers where they come into the house. The other runs a desktop my wife uses for work. The one for my NAS box is a few years old. ...
  13. Replies
    12
    Views
    293

    Re: Timer function without decimals

    You just want a random integer?

    Here, maybe this will help you:



    Option Explicit
    '
    Private Declare Function CryptAcquireContextW Lib "advapi32.dll" (hProv As Long, ByVal pszContainer As...
  14. Replies
    29
    Views
    705

    Re: Long color to RGB

    XavSnap,

    Use GetMem4 rather than CopyMemory. It's faster. I'm not up for doing any timing, but I'd be surprised if much of anything is faster than copying 4 bytes a couple of times. You're...
  15. Re: Passing 2 dimensional array as one dimensional to a function/sub?

    And just for grins, here's how I'd possibly do it if I wanted to:



    Option Explicit

    Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Dest As Any, ByRef Source As...
  16. Re: Passing 2 dimensional array as one dimensional to a function/sub?

    If your arrays aren't dynamic arrays, and you're willing to exploit a bug in VB6, you can do it with UDT arrays (and have your actual fixed arrays in the UDTs):



    Option Explicit

    Private Type...
  17. Replies
    29
    Views
    705

    Re: Long color to RGB

    Using a UDT also does a pretty nice job of it:



    Option Explicit

    Private Declare Function GetMem4 Lib "msvbvm60" (ByRef Source As Any, ByRef Dest As Any) As Long ' Always ignore the returned...
  18. Re: VB6 - QUESTION - A good place to distribute your EXE

    I'll just share what I do. Basically, there are three ways (well four if you count email) that I share information with others:


    For my primary application, with the entire package standing at...
  19. Replies
    6
    Views
    327

    Re: VB6 Command Line Compilation on Windows 10

    From the command line (actually a batch file) is the only way I ever compile my main HUGE project. Here's the line out of the batch file (edited to take my paths out of it):



    "C:\Program Files...
  20. Re: StrPtr( ) for UDT has a strange problem

    Well, I'm gonna bow out of this thread after this post. But personally, I'd just call that copying memory.

    If Kernighan and Ritchie consider sqrt((double)n) where n is an int as an example of the...
  21. Re: StrPtr( ) for UDT has a strange problem

    It's interesting that, in C and related languages, when you put a type in parentheses before a variable, constant, or literal, that the parentheses are called cast operators.

    Here's a quote from...
  22. Re: StrPtr( ) for UDT has a strange problem

    Ahhh, that's a good article. So, to put a VB6 example on it:



    Option Explicit

    Private Sub Form_Load()
    Dim i As Integer
    Dim d As Double
  23. Re: StrPtr( ) for UDT has a strange problem

    And personally, I think it's fine to use the word "cast" as a runtime thing. If that's not the case, what's going on with:



    double d = 1234.567;
    int i = (int)d;


    It doesn't know the value...
  24. Replies
    5
    Views
    308

    Re: Pass Array between Forms

    Yes, that should help. As I understand it, that's not really a "memory" problem, but more of a "compiler" problem and how large a single module can be. Many moons ago, I took on a project to...
  25. Re: StrPtr( ) for UDT has a strange problem

    Now the following is about the only reliable way I know of doing it (using the UDT to find the fixed-length-string):



    Option Explicit

    Private Type UdtTest
    s1 As String * 5
    s2 As...
  26. Re: StrPtr( ) for UDT has a strange problem

    And, when you (think you) pass them to StrPtr(), you're just getting the address of that temporary BSTR in return, which is cleaned up once you return ... so, it's just a bogus memory address you've...
  27. Re: StrPtr( ) for UDT has a strange problem

    Ok, I'll jump in here. Fixed-length-strings are VERY weird animals. You can NOT pass them, even to something like StrPtr(). Let me say more...


    It often appears that you pass them, but you're...
  28. Replies
    5
    Views
    308

    Re: Pass Array between Forms

    *looked at that 2006 link*

    Oh wow, that's not something I'd do except as a last resort. It's easy to corrupt memory doing those things unless you are VERY careful.

    Also, you said you were...
  29. Re: CommonDialog vb6/sp6 (continuation of earlier post)

    Interestingly, I've been programming rather constantly since about 1977, and I never used the acronym "IDE" until joining these forums in mid-2014. In fact, for a while I listed the YouTube clip...
  30. Replies
    11
    Views
    329

    Re: Random Number

    Yeah, I thought about that, but I was hoping the OP knew that much. Also, I suppose it depends on whether he wants the same sequence each time.

    Also, the CryptGenRandom doesn't need to be seeded,...
  31. Replies
    11
    Views
    329

    Re: Random Number

    Or, if you want a more high precision and more random way, but slower, the following will do it for you:



    Option Explicit
    '
    Private Declare Function GetMem4 Lib "msvbvm60" (ByRef Source As...
  32. Replies
    11
    Views
    329

    Re: Random Number

    Dim f As Single
    f = Rnd * 2
    If f >= 1 Then f = f + 1
  33. Re: FYI: StdFont scaling for DPI awareness

    Knew that. :)

    I'm also starting to get worried about that value. Basically, it's going to be interpreted as twips. And, if we assume 96 DPI, basically we're shifting 5,000 pixels to the left...
  34. Re: TimerEx, hi precision timer using QueryPerformanceCounter

    Ilia, and all,

    Several people are saying several things in this thread. However, if you want simple, just take what I posted in post #1, make a class out of it, and just use it (no explicit...
  35. Re: Int64 test if can fit into Int32 w/o truncation

    I don't have time right now to test it, but I can't imagine that's true. A LongLong will fit into CPU registers whereas the weird mixed-byte-endianness of Decimals has to make using them very slow. ...
  36. Re: Int64 test if can fit into Int32 w/o truncation

    And, with care, VB6 will work with I8:



    Option Explicit
    '
    Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Dest As Any, ByRef Source As Any, ByVal Bytes As Long)...
  37. Re: Int64 test if can fit into Int32 w/o truncation

    Personally, regardless of whether it's in a LongLong or a Currency, here's how I'd think of it. We're dealing with 64 bits (0 thru 63). For this Int64, the high (63rd) bit is the sign bit. All...
  38. Replies
    21
    Views
    564

    Re: Binary Search Troubles

    I haven't done binary searches in a while, as databases have taken over most of that work, and I seldom (if ever) concern myself with how these database back-ends do their searching.

    However,...
  39. Re: Conversion Error Currency to/from 64 bit Integer

    Krool,

    I've got no idea. But I'd guess that the problem exists in those API calls as well, thinking they probably use the same underlying code. However, a test would be pretty easy. That...
  40. Re: How to write this C# line in VB6?

    I'll certainly second that.



    And regarding that one, it's just a different language. I write C code somewhat often, and I don't find it that difficult. In fact, there are quite a few things...
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Featured


Click Here to Expand Forum to Full Width