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...
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...
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.
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
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...
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...
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...
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.