Search:

Type: Posts; User: wqweto

Page 1 of 13 1 2 3 4

Search: Search took 0.47 seconds.

  1. Thread: Crc32q

    by wqweto
    Replies
    9
    Views
    242

    Re: Crc32q

    0x554D = _byteswap_ushort(0xB2AA ^ 0xFFFF)

    So it's derived from init value with all bits reversed and both bytes swapped.

    Probably this transformation has to do with the way the calculation...
  2. Thread: Crc32q

    by wqweto
    Replies
    9
    Views
    242

    Re: Crc32q

    This


    Dim b() As Byte
    b = StrConv("123456789", vbFromUnicode)
    Debug.Print Hex$(Crc16_RIELLO(b))
    . . . prints 63D0 here.

    What are you testing with?
  3. Thread: Crc32q

    by wqweto
    Replies
    9
    Views
    242

    Re: Crc32q

    Try something like this


    Public Function Crc16_RIELLO(B() As Byte) As Long
    Dim i As Long, crc As Long: Static crcTab(0 To 255) As Long
    If crcTab(1) = 0 Then CreateLookupTable crcTab, 16,...
  4. Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    LGTM!

    I like the declarative XAML approach and the anonymous functions for the event handlers.

    cheers,
    </wqw>
  5. Thread: Crc32q

    by wqweto
    Replies
    9
    Views
    242

    Re: Crc32q

    Try something like this


    Public Function Crc32_Q(B() As Byte) As Long
    Dim i As Long, crc As Long: Static crcTab(0 To 255) As Long
    If crcTab(1) = 0 Then CreateLookupTable crcTab, 32, False,...
  6. Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Why no? I thought this is super simple in WPF, as easy as this


    <Button>
    <Button.Resources>
    <Style TargetType="Border">
    <Setter Property="CornerRadius" Value="5"/>
    ...
  7. Replies
    6
    Views
    321

    Re: How to detect loaded dll

    Here is an API declare that can be useful


    Private Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long

    Just use...
  8. Replies
    3,181
    Views
    217,869

    Re: What song are you listening to right now?

    https://www.youtube.com/watch?v=jdYJf_ybyVo
  9. Replies
    24
    Views
    2,459

    Re: HEIC picture files

    It's not obvious if anything is wrong with thse two lines of code.

    It looks like a whole horizontal line + 2 pixels are white. About the size of BITMAPINFO header. (Though these should have been...
  10. Re: Transition VB 6.0 --> C hopefully in Windows

    You can try using gcc on Windows nowadays. The port of gcc to Windows in called Mingw. This original projecty is now abandoned but you can use Mingw-w64 fork which is very much alive and kicking.
    ...
  11. Re: Complied app hangs on Exit Function statement

    Btw, there is no problem with VB6 codegen on With MyUdtArray(5) ... End With blocks with any GoSub/GoTo shenanigans one might use.


    004019A5 8B EC mov ebp,esp
    004019A7...
  12. Replies
    24
    Views
    2,459

    Re: HEIC picture files

    Btw, now seeing the final code hMemDC + hDIB seems redundant in this case -- you can allocate a 4 * lImageWidth * lImageHeight byte-array and use this as target for IWICBitmapSource_CopyPixels_Proxy...
  13. Re: Printer.DeviceName gives wrong answer in Win10

    Btw, Printers collection under Terminal Server lists printers from all users sessions i.e. you might have Printers.Count > 0 still no printers in current session for current user.

    I've been...
  14. Replies
    24
    Views
    2,459

    Re: HEIC picture files

    WicLoadPicture[Array] + pvLoadPicture prepare a normal GDI device-independant bitmap DIB + lpBits which is then stuffed as an icon inside an StdPicture.

    In pvLoadPicture easiest would be to use...
  15. Re: Complied app hangs on Exit Function statement

    In subTestGoTo the local array a() As MyUDT is not deallocated as it's locked because of an early break by GoTo HELL inside With block.

    Just put a ReDim a(1 To 20) right before Exit Sub to...
  16. Re: Complied app hangs on Exit Function statement

    You might be right the issue is more generic and it's been discussed here in these forums.

    The problem is when a With statement execution is not matched by its End With statement execution.

    So...
  17. Re: Complied app hangs on Exit Function statement

    Does the repro fail in your IDE?

    I can pinpoint exactly the same "GoSub + GoTo without Return" interaction in your code if you can't see it.

    cheers,
    </wqw>
  18. Re: Complied app hangs on Exit Function statement

    Check out my repro above.

    The original code might have different issues altogether but this one (not executing Return from GoSub) I'm positive is present too.

    cheers,
    </wqw>
  19. Re: Complied app hangs on Exit Function statement

    Ooops, you have a point! Apparently JET differs than SQL Server bahavior with nested transactions and your code is fine.


    The conclusions are not correct. The problem with you code is actually...
  20. Re: [RESOLVED] Corona virus, China major city lockdowns, etc.

    False and false -- there were no potatoes in the Middle Ages because literally Middle Ages end in 1492 with Columbus, you know what he did then.

    cheers,
    </wqw>
  21. Re: [RESOLVED] Corona virus, China major city lockdowns, etc.

    https://www.vbforums.com/images/ieimages/2021/10/7.jpg
  22. Replies
    8
    Views
    320

    Re: [SQL Server 2016] Looping Over Records

    For simple tasks looping with cursors or temp tables can be rewritten in set-oriented fashion which is the fastest. For RBAR looping obviously there is something more happening inside the loop, e.g....
  23. Replies
    3
    Views
    215

    Re: VirtualProtect use in vtable swapping

    You need R/W access only to copy from/to the pfn array.

    Execute access (for DEP) is not needed as the vtable does not contain executable code.

    cheers,
    </wqw>
  24. Re: Complied app hangs on Exit Function statement

    Once again, just a friendly warning: there is a problem with transaction handling on *failure* in this code. I'm not talking about the happy path where nested transactions are commited just fine.
    ...
  25. Replies
    64
    Views
    1,481

    Re: Can anyone write an array module?

    You mean F12 and Ctrl+- do not work in VB.Net code editor?

    cheers,
    </wqw>
  26. Re: Complied app hangs on Exit Function statement

    Btw, fnDT_ASSETS_CT_ASSETS_02 is called inside a transaction opened by fnProcessAssets_02.

    fnDT_ASSETS_CT_ASSETS_02 still opens nested transaction on its turn and calls Rollback on failure which...
  27. Re: Complied app hangs on Exit Function statement

    Suppose you have this routine in a .bas module


    Function funcCHILD() as Boolean
    Dim o As MyBusinessObject
    Set o = New MyBusinessObject
    'A lot of stuff here
    funcCHILD =...
  28. Re: Complied app hangs on Exit Function statement

    In IDE break on Exit Function and press F8 (Step Into) to observe all the Class_Terminate called when local objects are getting out of scope.

    cheers,
    </wqw>
  29. Re: Making an executable file with the .vb extension?

    Both files are the same native portable executable here. Seems like target file extension does not matter.

    cheers,
    </wqw>
  30. Replies
    2
    Views
    202

    Re: Calling Public Method of lightweight Class

    You need a real interface declared in a typelib for this to work.

    Your Dim unk As IUnknown must be changed to Dim unk As IMyInterface so that unk.MyMethod is available in IDE and the compiler...
  31. Replies
    2
    Views
    163

    Re: Native Client 11

    You have to download and install the 32-bit version ENU\x86\msodbcsql.msi not the 64-bit version ENU\x64\msodbcsql.msi

    Not that this is not the Native Client 11 as the title of the thread suggests...
  32. Re: [VB6] IEnumVARIANT / For Each support without a typelib

    This struct is entirely user-defined internal object state with only requirement for the first member to be a pointer to interface VTable to be considered (a pointer to) a valid COM interface.
    ...
  33. Replies
    7
    Views
    257

    Re: Semicolon in Connection String

    This one


    cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties='Text;CSVDelimited=True;Hdr=True';Data Source='test;123'"

    . . . and this one


    cn.Open...
  34. Thread: Extending VB6

    by wqweto
    Replies
    65
    Views
    2,543

    Re: Extending VB6

    Acquainting VB6 developers with VS Code is probably the best gift TwinBasic can give to any of them.

    Opening up to this alien world of JS, React, Rust and Golang can introduce (and convert) some...
  35. Replies
    9
    Views
    242

    Re: AlphaImage control question

    LaVolpe is not frequenting these forums anymore. You are on your own with whatever control of his you fiddling with.

    Or you can summon other regulars here to the rescue -- your call, but talking...
  36. Replies
    64
    Views
    1,481

    Re: Can anyone write an array module?

    Exactly. The future is using web technologies for desktop development. Everything running on the desktop will be re-written in JS using Electron, not .Net and not VB6.

    This means shipping large...
  37. Replies
    7
    Views
    257

    Re: Semicolon in Connection String

    As OP stated what's going on -- there is a value with a semicolon which breaks OLEDB connect string parsing if not quoted as far as I understand the original problem.

    I just confirmed that such...
  38. Replies
    2
    Views
    189

    Re: Default Connection Timeouts

    Is this scenario for HTTP/1.1 with Connection: Keep-Alive header send by the client? (So that subsequent requests can be multiplexed on the same TCP connection?)

    Then there is Keep-Alive:...
  39. Thread: Like Operator

    by wqweto
    Replies
    7
    Views
    278

    Re: Like Operator

    You can stack multiple LIKE checks like this


    If z Like "[0-9]*. " Then

    '--- do something
    ElseIf z Like "[A-Z][0-9]*. " Then

    '--- do the same
    ElseIf z Like "..." Then
  40. Replies
    7
    Views
    257

    Re: Semicolon in Connection String

    This


    cn.Open "Provider=SQLOLEDB;Data Source=UCSDB;User ID=test;Password='test;123'"

    bombs out with


    Format of the initialization string does not conform to the OLE DB specification.
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Click Here to Expand Forum to Full Width