Search results

  1. M

    C++ class to VB

    Figured it out! In my VB code, I was passing the class pointer ByRef instead of ByVal. So I changed all three params to ByVal, and viola! It works. My only guess about that assertion error was that I was attempting to free/overwrite memory currently in use (In this case, the actual IntPtr...
  2. M

    C++ class to VB

    I've been trying to pass class pointers back and forth between a VC++ DLL and a VB application. In my C++ project, I have the following: MyClass.h: #include <Windows.h> #pragma once #ifdef MYDLL_EXPORTS #define MYDLL_API __declspec(dllexport) #else #pragma message("Automatic link to...
  3. M

    Threading issues

    Nevermind. I've decided to knock out the middle man and create my own window via CreateWindowEx, so there's no more need to rely/wait on the paint event and there's much less weight involved overall.
  4. M

    Threading issues

    If it helps, here's a (poorly) illustrated example of how things are currently set up. Kinda.
  5. M

    Question Finding the heading (NSEW) given two points

    Thanks, I figured it out using Math.Atan2() and a few online references regarding the proper formulas.
  6. M

    Question Converting from C# to VB.NET

    Have you tried pasting the code into a converter to see if it works correctly? Here's one that I use from time to time: Convert C# to VB.NET - A free code conversion tool - developer Fusion
  7. M

    Threading issues

    This is gonna be difficult to summarize, but I'll try my best... I'm developing a graphics engine as extra credit for one of my classes. I'm using a balanced mixture of managed objects, GDI+, and Win32 API methods. Some of the classes I have are as follows: - Canvas (Device context/Memory...
  8. M

    Question Finding the heading (NSEW) given two points

    A 2D object has an x/y location, x/y direction, and a velocity. During each update, its location = (location + (direction * velocity)). This enables it to travel in any and all directions at varying speeds. Using this information, how would you find the angle (in degrees, from 0 to 360) between...
  9. M

    Transparency using old school BitBlt masking techniques: Broken?

    Okay so I figured it out, though it's definitely not how I remembered it being done in the past and it even seems a bit slower... Turns out, you need to condition the original image to contain white pixels for transparent regions, and condition the mask image to contain black pixels for...
  10. M

    Transparency using old school BitBlt masking techniques: Broken?

    I'm guessing people need some code to see what I'm talking about... [VB.NET] Win32API.vb - Pastebin.com [VB.NET] Canvas.vb - Pastebin.com [VB.NET] Sprite.vb - Pastebin.com Mainly, look at the last Render() function in Sprite.vb to see what I mean. And here's an example of how to use these...
  11. M

    Transparency using old school BitBlt masking techniques: Broken?

    I remember way back in my VB6 days, I wrote a module that would create a device context in memory, load and select a compatible bitmap, and create a mask for the image, given a color to be marked as "transparent" (white) in the mask. Then all you had to do was BitBlt the mask to the target DC...
Top Bottom