Search:

Type: Posts; User: Niya

Page 1 of 13 1 2 3 4

Search: Search took 0.06 seconds.

  1. Replies
    3
    Views
    87

    VS 2022 Re: Getting bit from Byte

    I'd go with this:-


    Public Function GetBit(value As Byte, index As Integer) As Boolean
    Return CBool((value And (1 << index)))
    End Function


    The JIT produces cleaner, and by...
  2. Re: [RESOLVED] Renaming of overloaded functions from .NET

    Yea, I get what you're trying to say. I sometimes forget that the BASIC language enforces a lot of bad habits and thought patterns. BASIC encourages programmers to think that there is some big...
  3. Re: [RESOLVED] Renaming of overloaded functions from .NET

    This is also a very good point. I didn't even think of this one. So it seems it's problematic even without involving types like object.
  4. Re: [RESOLVED] Renaming of overloaded functions from .NET

    You mean the reason overloads can't be differentiated by their return types alone? If that is what you mean, the reason is actually for situations like this:-

    object x = Foo(12.0f, 7.0f);

    In...
  5. Re: [RESOLVED] Renaming of overloaded functions from .NET

    While there is, strictly speaking, nothing wrong with involving return types in the process of resolving overloads, it should be noted that generally speaking, overloaded functions must differ by at...
  6. Re: [RESOLVED] Renaming of overloaded functions from .NET

    Typically compilers resolve which function to call by their signature. A function signature consists of the order and type of each parameter. The signature is combined with the name of the function...
  7. Re: How to convert this C style UNION in a UDT to VB ?

    Unions are just a convenient way to perform casting or even aliasing. Whenever you encounter a union, just translate it to a single UDT field with the size of the largest member of the union.
  8. Thread: Stuff to watch

    by Niya
    Replies
    178
    Views
    11,627

    Re: Stuff to watch

    Yea, it is. It's unavailable to me because it's restricted from my country.
  9. Re: Create an object array with a length of zero (or UBound = -1)

    Lots of impressive wizardry in this thread. Nonetheless, I'm going to take a shot in the dark here and assume that this is about your transpiler again SDO. If it is not about that feel free to ignore...
  10. Re: Renaming of overloaded functions from .NET

    This would absolutely murder the performance of the translated code. It's better to go with DoSomething1, DoSomething2 etc as he originally intended. It is the best way to convert overloaded methods....
  11. Re: Renaming of overloaded functions from .NET

    This is normal for compilers. You should take a look at how C++ compilers mangles class method names, now that is ugly. What's important is that the user writing the code doesn't see these things.
    ...
  12. Re: Renaming of overloaded functions from .NET

    This is basically what modern compilers do internally to implement overloading so you're already on the right track.
  13. Thread: Stuff to watch

    by Niya
    Replies
    178
    Views
    11,627

    Re: Stuff to watch

    Ah ok. I completely missed that one. Gonna have take a look at it soon.
  14. Thread: Stuff to watch

    by Niya
    Replies
    178
    Views
    11,627

    Re: Stuff to watch

    Really? I was unaware they made a movie for Brotherhood. I'll have to look that one up.
  15. Thread: Stuff to watch

    by Niya
    Replies
    178
    Views
    11,627

    Re: Stuff to watch

    I liked Brotherhood way more than I liked the original anime. The story in Brotherhood was just way more compelling to me. For example, the main villain in Brotherhood, Father, was just far more...
  16. Replies
    9
    Views
    202

    Re: CreateCompatibleDC

    One of the things you will slowly realize about device contexts in GDI is that they are more about the objects selected into them than they are about the DC itself. The documentation will never tell...
  17. Thread: TwinBasic

    by Niya
    Replies
    1,059
    Views
    395,703

    Re: TwinBasic

    I was 100% aware of this even back then. Thing is though, scared as I might have been of C/C++, I felt it was just easier and far better to learn C than to learn these VB6 hacks that many times had a...
  18. Thread: Stuff to watch

    by Niya
    Replies
    178
    Views
    11,627

    Re: Stuff to watch

    Lol....I almost forgot Covid was a thing. I got two shots back in the middle of the "pandemic"(yea I put it in quotes because I'm almost convinced now it was a hoax or an over-reaction at the very...
  19. Thread: Stuff to watch

    by Niya
    Replies
    178
    Views
    11,627

    Re: Stuff to watch

    This is soooo true.
  20. Thread: Stuff to watch

    by Niya
    Replies
    178
    Views
    11,627

    Re: Stuff to watch

    Hmmm...That looks interesting. I have room for a movie or two tonight and I need something to watch. I might watch that.
  21. Re: Make hGdipImage, hGraphics, and other GDI+ "objects" into true VB6 COM objects

    Hey BTW Elroy, I saw in another thread you were asking about keeping track of object counts and shutting down GDI+ when they were all destroyed. You wanted a way to keep it fully contained in the...
  22. Re: Make hGdipImage, hGraphics, and other GDI+ "objects" into true VB6 COM objects

    My guess is that people figured if they were going to spend enormous effort to wrap a graphics a libraries, it should be something other than GDI+. Olaf chose to wrap Cairo for his RC6 library and...
  23. Replies
    47
    Views
    760

    Re: VBForums most active sections stats.

    hehe :D
  24. Re: Make hGdipImage, hGraphics, and other GDI+ "objects" into true VB6 COM objects

    Actually GDI+ is native graphics library of WinForms in .Net and it is exposed through .Net's object model. GDI+ could be used in .Net applications through normal every day .Net classes.

    Point is,...
  25. Replies
    47
    Views
    760

    Re: VBForums most active sections stats.

    I'd say to me Python was like that ugly girl next door you spent years avoiding. Then one day you couldn't avoid her and you found out she has a great sense or humor, her skin is perfect and her bum...
  26. Replies
    47
    Views
    760

    Re: VBForums most active sections stats.

    Hahaha....comment of the year! :D
  27. Replies
    6
    Views
    400

    Re: Optical Character Recognition

    This might be too specific a question to get a good answer on such a small forum. You'd have to hope that among the limited membership here that someone has experience with this.

    In case it...
  28. Replies
    47
    Views
    760

    Re: VBForums most active sections stats.

    I have to say, I completely understand where you're coming from. I have known in my bones for years that I should be using C# yet here I am today still using VB.Net. When I do some introspection I...
  29. Replies
    47
    Views
    760

    Re: VBForums most active sections stats.

    I actually hated this so passionately when I first heard about it. But after writing some Python code myself(mostly very simple newbie stuff), I have to say I never thought I'd reach a point where it...
  30. Replies
    47
    Views
    760

    Re: VBForums most active sections stats.

    Look at that. What's not to love about C# ;)
  31. Replies
    47
    Views
    760

    Re: VBForums most active sections stats.

    Not so fast. I really had no love for Python when I first learned about it but I have to admit my opinions have been softened quite a bit over time.

    Python is very very good for quickly...
  32. Replies
    47
    Views
    760

    Re: VBForums most active sections stats.

    That is inherited from C and it's a pretty ancient as far as C features go. But yea, there are quite a few things like that inherited from C and C++ that make the language more terse. One of my...
  33. Replies
    47
    Views
    760

    Re: VBForums most active sections stats.

    Isn't he determined to get the most posts or something like that?



    I can't write a program to test this one but I believe it's because VB.Net is dying in favor of C# becoming the dominant .Net...
  34. Re: Len vs LenB for specifying API structure lengths, and internal vs end padding

    I said you should never be using Len to measure structures because there are situations where it would not work. I also presented this structure as a test case:-


    Private Type MYUDT
    strVal...
  35. Re: Len vs LenB for specifying API structure lengths, and internal vs end padding

    This is overly complicated and very error prone. Here's a much simpler set of rules.


    Use LenB only. Never use Len
    For Unicode structures, fixed length Strings should be declared as String *...
  36. Re: Len vs LenB for specifying API structure lengths, and internal vs end padding

    LenB always tells you the exact size of a structure in memory. The reason you think it doesn't sometimes is because you're expecting it to correctly measure the structure after it's been passed to an...
  37. Re: Len vs LenB for specifying API structure lengths, and internal vs end padding

    I see that you've used LenB in your code. Why did you do that after insisting that Len was the only way? I wanted to see you copy the entire UDT after measuring it with Len because you claimed Len is...
  38. Re: Len vs LenB for specifying API structure lengths, and internal vs end padding

    What do you mean?
  39. Re: Len vs LenB for specifying API structure lengths, and internal vs end padding

    Prove me wrong then. Show me how to copy this structure correctly using Len and passing by reference through an external API like RTLMoveMemory.


    Private Type MYUDT
    strVal As String * 6
    ...
  40. Re: Len vs LenB for specifying API structure lengths, and internal vs end padding

    Here is proof that using Len is wrong:-


    Private Declare Sub MemCpy Lib "Kernel32.dll" Alias "RtlMoveMemory" (ByRef dest As Any, ByRef src As Any, ByVal cb As Long)

    Private Type MYUDT
    ...
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Click Here to Expand Forum to Full Width