Search Results - VBForums

Search:

Type: Posts; User: Ben321

Page 1 of 13 1 2 3 4

Search: Search took 0.04 seconds.

  1. Re: This allows you to convert any normal array into a byte array.

    In the case I used the code that I wrote, when data needed to be input as any number of different possible types of arrays, but the output format didn't matter, as it was simply going to be saved to...
  2. This allows you to convert any normal array into a byte array.

    It uses a Variant for the input parameter so that you don't need to have a specific array type (Byte, Integer, etc) when putting the array into the parameter. It then uses API functions, rather than...
  3. Re: Here's my non CopyMemory based solution for swapping byte order

    Yeah, I eventually figured that out. Again, I'm not sure why, but it did seem that under those circumstances it had problems. I guess there's just some magic going on behind the scenes.
  4. SafeArrayLock versus SafeArrayAccessData?

    Based on the MSDN descriptions of these, it sounds like they both give you a pointer you can use to access the data stored in a SafeArray. So what exactly is the difference?
  5. Replies
    11
    Views
    246

    Re: How does VB6 store Decimal data type?

    I never said you could directly create a Decimal type variable. I specifically said that you could create a Variant of type Decimal. Big difference. I just was wondering, how many bytes are used to...
  6. Replies
    11
    Views
    246

    How does VB6 store Decimal data type?

    I know that you can create a Variant of type Decimal. The Variant stores the type, and a pointer to the actual value. But how is the Decimal value itself stored in memory? How many bytes long is it?...
  7. Re: Here's my non CopyMemory based solution for swapping byte order

    Then I think you can rid of the first And. I think you can turn this:
    ((inLong And &HFF000000) \ &H1000000) And &HFF&
    into this:
    (inLong \ &H1000000) And &HFF&

    You are right that the second And...
  8. Re: Here's my non CopyMemory based solution for swapping byte order

    Mine used only 2 IFs. Does that really present a significant slowdown? Also I prefer to understand how the code works, not just use "black box" code that works but I have no idea why. The code you...
  9. Here's my non CopyMemory based solution for swapping byte order

    Often times I find myself trying to write a file for another program to read, or read a file written by another program, in which that other program uses Big Endian byte order, even though VB6 uses...
  10. Replies
    0
    Views
    163

    Here's my functions for fixing endianness

    This is the ASM code needed to compile a DLL file that provides functions for swapping byte order (BigE to LittleE, or visa versa). The resulting DLL file is very useful in VB6 for code that reads or...
  11. Re: What's wrong with my usage of WriteConsoleOutputCharacter?

    In the case of my test. All methods took about 100ms to perform from VB6 when copying a large chunk of data from one array to another, even though theoretically some of them should have been faster...
  12. Re: What's wrong with my usage of WriteConsoleOutputCharacter?

    I was just looking at how VB6 runs a function that is declared with the Declare statement. I analyzed some code in OllyDbg, which was compiled by VB6 into a Native code EXE (not P code).

    At...
  13. Re: What's wrong with my usage of WriteConsoleOutputCharacter?

    The easiest way to make a fast memory copy is to write your own DLL file. It doesn't worry about overlapping memory regions, but rather makes use of the opcode "rep movsb" in ASM code to quickly...
  14. Re: What's wrong with my usage of WriteConsoleOutputCharacter?

    Isn't that going to have a problem though if either HiWord or LoWord are 0x8000? VB6 treats these as negative numbers. I think what you are trying to do can be done, but it takes a lot more code to...
  15. Re: What's wrong with my usage of WriteConsoleOutputCharacter?

    Yeah, I eventually figured that out. I made a separate function called CoordsToLong, that took 2 Integer parameters, and returned a Long. It used two CopyMemory calls to combine them, like this:
    ...
  16. What's wrong with my usage of WriteConsoleOutputCharacter?

    Here's my code.

    Private Declare Function AllocConsole Lib "kernel32.dll" () As Long
    Private Declare Function FreeConsole Lib "kernel32.dll" () As Long
    Private Declare Function GetStdHandle Lib...
  17. How do I set scroll increment on HScroll bar?

    I see that I can set LargeChange and SmallChange. LargeChange is the amount changed when you click on a part of the bar that is not the scroll position indicator and also not the end arrows....
  18. So what exactly does DSBCAPS_STATIC do in DirectSound buffer?

    So when I use a Direct Sound buffer descriptor, and in the flags field assign it to DSBCAPS_STATIC, what exactly does that do? According to...
  19. Re: How do I pass WAVEFORMATEX to API functions?

    Interesting padding rules. It would seem that no padding should be used, so that VB6 UDTs would be equivalent with C and C++ Structs. After all, Windows APIs are expecting unpadded structures as...
  20. Re: How do I pass WAVEFORMATEX to API functions?

    Interestingly enough, the article at https://support.microsoft.com/en-us/kb/137729 is incorrect in describing it as DWord (4 bytes) Aligned. As seen in their examples, it is QWord (8 bytes) aligned....
  21. Re: How do I pass WAVEFORMATEX to API functions?

    So, just how does VB6 decide under what conditions padding is required, how much padding to use, and where to place it? Is this some kind of trade secret, that nobody has yet figured out?
  22. Re: How do I pass WAVEFORMATEX to API functions?

    I may be wrong but I think that cbSize must be set for this api call to work.
  23. How do I pass WAVEFORMATEX to API functions?

    In the function waveOutOpen, you need to pass a WAVEFORMATEX, yet if you do Len and LenB on WAVEFORMATEX, you'll notice that LenB is bigger than Len, indicating that the in-memory copy of a...
  24. Replies
    1
    Views
    303

    Re: Binary Code Thunk Experiment

    To draw a 256x256 pixel black square on the form, you can use the below thunk string constant in place of the one in the code sample in this thread's opening post.

    Private Const ThunkStrConst As...
  25. Replies
    1
    Views
    303

    Binary Code Thunk Experiment

    Here's the VB6 code for Form1

    Private Declare Function CallProc Lib "user32.dll" Alias "CallWindowProcA" (ByVal ProcAddr As Long, ByVal Param1 As Long, ByVal Param2 As Long, ByVal Param3 As Long,...
  26. Simple method for checking primality of number

    This checks every positive integer between 2 and the Floor of the Squareroot of the number to be checked, to see if the Mod = 0. If it equals zero, then it is not prime. If it never is zero, then it...
  27. Here's a simple function for calculating the GCD of any 2 positive integers.

    This can be useful component of a number of other algorithms.


    Private Function GetGCD(ByVal a As Long, ByVal b As Long) As Long
    Dim r As Long
    Dim q As Long

    ' Make sure that a >= b, by XOR...
  28. Replies
    14
    Views
    311

    Re: Problem with InitProperties event

    Turns out that in my actual program, I was mistakenly using PropBag.WriteProperty in the ReadProperties event, and PropBag.ReadProperty in the WriteProperties event. The sample code I posted here in...
  29. Replies
    14
    Views
    311

    Re: Problem with InitProperties event

    In notice your sample code doesn't include any use of the InitProperties event. Can you explain proper usage of that event in the example code that I've given?

    And as for it not being all the code...
  30. Replies
    14
    Views
    311

    Re: Problem with InitProperties event

    So here's the code I have so far.

    Private MyInternalProp As Long
    ' MyInternalProp is a property that is not to be changed by anything outside the user control, but may be changed internally by...
  31. Replies
    14
    Views
    311

    Re: Problem with InitProperties event

    Indeed it does only occur once. On account of this, it is supposed to remember what it was initialized to, unless it is specifically changed by another line of code to something else later on....
  32. Replies
    14
    Views
    311

    Problem with InitProperties event

    My control doesn't remember the properties it was "inited" with. Lets say I have an internal property defined and initialized like this:

    Dim MyProp As Long
    Private Sub...
  33. Replies
    7
    Views
    952

    Re: DrawText Formatting String

    What does DT_FORUM constant actually do. Microsoft's MSDN website does not provide any information about what this text formatting mode does. Absolutely none/zip/zero/zilch. It's like they don't want...
  34. Replies
    22
    Views
    1,055

    Re: BSTR2LPSTR and LPSTR2BSTR conversions for VB6

    Another thing that I notice a mistake in is with pointers to UDTs. For example if something called for a pointer to a UDT called MYUDT, the API Viewer 2004 program will often have the correct type...
  35. Replies
    22
    Views
    1,055

    Re: BSTR2LPSTR and LPSTR2BSTR conversions for VB6

    Those params with it declared ByRef as Byte, for a byte array, are actually good declarations. It prevents the programmer from mistakenly passing a pointer to an array of Integers or Longs (as would...
  36. So is this supported under a WinXP SP or not?

    I notice on the MSDN page for CryptBinaryToString there's this bit of info about one of the flags that can be used with this function:



    One thing that stands out is the fact that it says that...
  37. Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Where is the download link to get the latest version this oleexp.tlb file? There's a very very very long description of what it can do in the opening thread, but I can't find the download link. It...
  38. Replies
    22
    Views
    1,055

    Re: BSTR2LPSTR and LPSTR2BSTR conversions for VB6

    On modern computers, the amount of processor time used on the conversion is so small as to be insignificant when using ANSI API functions. However the advantage to the programmer of using ANSI API...
  39. Replies
    3
    Views
    234

    Re: Need some help with clipboard access

    But if it is being managed by the system, wouldn't attempting to, as you said "be released/destroyed by you", end up causing a problem? If the system is supposed to have control of it, but I call...
  40. Replies
    22
    Views
    1,055

    Re: BSTR2LPSTR and LPSTR2BSTR conversions for VB6

    I have in fact heard of it. This is why I said about having it work "without extra code". If you have to use StrPtr, instead of just passing the BSTR variable, then that's extra code. If you just...
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.