Search:

Type: Posts; User: Niya

Page 1 of 13 1 2 3 4

Search: Search took 1.45 seconds; generated 49 minute(s) ago.

  1. Re: [RESOLVED] Need help with crazy C++ pointer macro

    I think the idea is that we're not supposed to know really sits behind any specific handle. Even with this DPA thing it seems MS went through a bit of trouble to hide the actual struct. Why even use...
  2. Re: [RESOLVED] Need help with crazy C++ pointer macro

    I was looking at the naming convention. Microsoft likes to tag handles with H as the prefix. HWND, HBITMAP, HBRUSH, HDPA.

    I'm not saying you're wrong but I think both can be true. You can call it...
  3. Re: [RESOLVED] Need help with crazy C++ pointer macro

    It doesn't compile and I think it's because the indexing operator has higher precedence than the cast. It indexes hpda first, which evaluates to the DPA structure which cannot be cast to a pointer...
  4. Re: [RESOLVED] Need help with crazy C++ pointer macro

    No problem.



    I think you got really lucky that someone decided to reverse engineer this specific handle. As I understand it, all handles in Windows are either an index into an array somewhere...
  5. Re: [RESOLVED] Need help with crazy C++ pointer macro

    I think 2kaud was moreso addressing the discussion between VanGogh and myself.



    I might be able to help with that. The very first thing I did when I came to this thread was to copy this into...
  6. Re: [RESOLVED] Need help with crazy C++ pointer macro

    Ideally, yes. But many times we just have a snippet of code that is referencing things not included in the snippet which makes compilation a chore at best and impossible at worse.
  7. Re: Scanline flood fill algorithm in pure VB.Net code

    Here's the original C code in case that page gets lost to time before VBForums:-

    void floodFillScanlineStack(int x, int y, int newColor, int oldColor)
    {
    if(oldColor == newColor) return;

    ...
  8. Replies
    46
    Views
    2,138

    VS 2010 Re: how convert VB6 to VB2010 code?

    That's actually understandable. Back in the day no one really took Visual Basic seriously as a language of performance so all the super optimized algorithms were were written in the "elite" languages...
  9. Replies
    46
    Views
    2,138

    VS 2010 Re: how convert VB6 to VB2010 code?

    :D

    BTW, I found where you got that algorithm from. You found it here most likely:
    http://vb-helper.com/howto_net_unsafe_flood.html

    I also just release that CodeBank entry I was talking about:-...
  10. Scanline flood fill algorithm in pure VB.Net code

    https://www.vbforums.com/images/ieimages/2024/02/20.png

    A recent discussion in this thread led me to the discover that a decent flood fill implementation was somewhat difficult to find online,...
  11. Re: [RESOLVED] Is this a VB Bug? Decimal Point < 0

    I see. Currency is a fixed point type then.

    That's very old school. The Doom engine for example uses fixed point math because of how slow or non-existent FPUs were back then. If I remembered...
  12. Re: [RESOLVED] Need help with crazy C++ pointer macro

    Oh it can get much worse. Try to imagine the pain when typedefs of typedefs of typedefs get involved. You could make a lot of mistakes if you're not paying close attention.
  13. Re: [RESOLVED] Is this a VB Bug? Decimal Point < 0

    I think the Currency type in VB6 is also a scaled integer. I'm not sure where or how it differs from a Decimal but the name of the type suggests it's purpose in financial calculations.
  14. Re: [RESOLVED] Is this a VB Bug? Decimal Point < 0

    He is talking about the Decimal type which is ubiquitous in Microsoft products. You can find them in VB6, SQL Server and .Net.

    They are basically scaled integers and not true floating point...
  15. Re: [RESOLVED] Need help with crazy C++ pointer macro

    Actually assembly code is clearer. As low level as C is, it still has abstractions that can obfuscate the truth. Assembly has near zero abstractions. You don't need to guess what assembly code is...
  16. Re: [RESOLVED] Need help with crazy C++ pointer macro

    I am still curious why you said it's not what seemed obvious. It makes me wonder what else someone might think when they look at it.
  17. Re: Need help with crazy C++ pointer macro

    Well the original macro is dereferencing a void*** evaluates to void**. You can even test this in the IDE:-


    void*** p;

    auto x = *(p);


    If you hover the mouse pointer over the x...
  18. Re: [RESOLVED] Is this a VB Bug? Decimal Point < 0

    I think it's easy for us to forget that floating point numbers like all numbers on a computer have a finite amount of bits. However unlike Integers, errors are not thrown when we run out of bits to...
  19. VS 2010 Re: VB2010 - how draw Bitmap correctly on control?

    VB6 is a fine language but you're right, VB.Net does make a lot of things far easier out of the box.

    I must warn you though, if at some point you get comfortable with VB.Net, you may find it very...
  20. VS 2010 Re: VB2010 - how draw Bitmap correctly on control?

    I'm curious about something joaquim. You are pretty prolific in VB6 so why the sudden move to VB.Net?

    The reason I ask is because jumping from VB6 to VB.Net is not that straightforward. There are...
  21. Replies
    10
    Views
    686

    VS 2010 Re: VB2010: how can i get all API functions?

    By the way, As Any and As Object are not even remotely the same thing.

    As Object in .Net says to expect any type derived from Object which coincidentally is every type in .Net. If it were...
  22. Replies
    10
    Views
    686

    VS 2010 Re: VB2010: how can i get all API functions?

    I don't think most VB6 programmers realize just how strange VB6 actually is. As Any breaks the contracts of the type system which is something you will almost never find in any statically typed...
  23. Re: Need help with crazy C++ pointer macro

    Damn it! I actually had this in a follow up post I was going to make but didn't bother posting it since I was doing it all in my head and wasn't sure I had it correct. I like to avoid posting...
  24. Re: Need help with crazy C++ pointer macro

    That entire thing in the C code is really just a dereferencing operation when you get right down to it. It takes a value hpda casts it to a BYTE pointer, advances that pointer by 4 or 8 bytes...
  25. Replies
    46
    Views
    2,138

    VS 2010 Re: how convert VB6 to VB2010 code?

    The idea is actually quite simple. From the point where the fill begins, you observe the pixel to the top, left, bottom and right of it and if you find "unfilled" pixels, do the same thing with each...
  26. Replies
    46
    Views
    2,138

    VS 2010 Re: how convert VB6 to VB2010 code?

    While I appreciate the compliment, I don't consider myself an expert. ;)

    I do have a lot of experience with image processing but I still don't possess anywhere near the talent of true gods of...
  27. Replies
    46
    Views
    2,138

    VS 2010 Re: how convert VB6 to VB2010 code?

    Well I hope it works well for you when you do get around to it eventually.

    In the meantime, I think I will make this a CodeBank entry. It's very surprising how hard it is to find a decent flood...
  28. Replies
    46
    Views
    2,138

    VS 2010 Re: how convert VB6 to VB2010 code?

    Ah ok. Well I tested it on some relatively complicated and gargantuan images. For example this one:-
    https://www.vbforums.com/images/ieimages/2024/02/19.png

    That one is 4840x2408 in size.

    In...
  29. Replies
    46
    Views
    2,138

    VS 2010 Re: how convert VB6 to VB2010 code?

    Are you saying you're seeing similar performance on your end for both methods?
  30. Replies
    46
    Views
    2,138

    VS 2010 Re: how convert VB6 to VB2010 code?

    Sorry I took so long. I had to hammer away at this on and off for a couple days as I was a bit busy. It was pretty obvious when I saw the code why it was slow, but it wasn't so obvious what the best...
  31. Re: Feeling nostalgic I fired up QuickBASIC and wrote a Brain***** interpreter!

    DOS had drivers but it was also a real mode operating system. Drivers in DOS were in the form of something called a TSR which is most closely equivalent to a modern Windows service or a Linux/Unix...
  32. Replies
    46
    Views
    2,138

    VS 2010 Re: how convert VB6 to VB2010 code?

    Yea, I think I'd need to see the code.
  33. Replies
    46
    Views
    2,138

    VS 2010 Re: how convert VB6 to VB2010 code?

    One more thing. I noticed your use of SAFEARRAYs, VarPtr and such in your VB6 version. If you feel more comfortable with that, you can even do similar things in VB.Net.

    Now VB.Net doesn't use...
  34. Replies
    46
    Views
    2,138

    VS 2010 Re: how convert VB6 to VB2010 code?

    Unlike VB6, we don't need all this song and dance to handle bitmap images in .Net. It's far simpler. We don't even need to import even a single Win32 API, constant or structure. Everything we need...
  35. Replies
    27
    Views
    1,439

    Re: How to extract text from HTML

    Like I said, .Net Framework is different from .Net Core so it makes sense they will have different version numbers. 4.8.1 is the latest version of the Windows only .Net Framework and .Net 8 is the...
  36. Re: Feeling nostalgic I fired up QuickBASIC and wrote a Brain***** interpreter!

    Don't take this as gospel but when I see LPRINT it evokes memories of writing directly to a parallel port like LPT1. It's been far too long since I touched a classic BASIC variant like QuickBasic. I...
  37. Replies
    46
    Views
    2,138

    VS 2010 Re: how convert VB6 to VB2010 code?

    This works:-

    Private Const BI_RGB As Integer = 0
    Private Const CBM_INIT As Integer = &H4
    Private Const DIB_RGB_COLORS As Integer = 0

    Private Structure BITMAP '14 bytes
    ...
  38. Thread: Something UP?

    by Niya
    Replies
    13
    Views
    737

    Re: Something UP?

    "Replay with Quote" hasn't been working so well for me since last night. I have to double click it and go to the advanced screen to quote a post now. I don't know if this is related to your problem...
  39. Replies
    43
    Views
    49,520

    Re: "continue" in vb6?

    If I faced this in VB6 or any older language, I'd just use the GoTo and be done with it, even if it's not personally to my liking. Sometimes, the solutions you don't like really are the best...
  40. Replies
    43
    Views
    49,520

    Re: "continue" in vb6?

    Oh yea, here's another trick you can use to escape nested loops without using GoTo or refactoring as a function/sub:-


    For i = 0 To Ubound(Matrix, 1)
    For j = 0 To Ubound(Matrix, 2)
    ...
Results 1 to 40 of 496
Page 1 of 13 1 2 3 4



Click Here to Expand Forum to Full Width