Skip to main content
gamedev.net
🔒 Locked

COM problem

Started by Kryptus Mar 15, 2005 at 4:25 AM 0 replies 600+ views
Original Post
Kryptus
Kryptus
I know DirectX 9 and C++ and I've played around with them quite a bit over the years but now I've decided to move onto COM. I found a tutorial here on GameDev which was quite helpful. I'm starting out by making a small engine that I can use in VB but made in C++. I've now discovered that I need different variant types to be converted though that's where I am having the trouble. I have made a method that initialises DirectX 9 but it has a reference to a HWND data type and I have included an optional BOOL for using hardware vertex processing. When I compiled it didn't work in VB. I made another function as a test - Hello(BOOL Msg) and in VB is came out as Hello(Msg As Long). What's up with this? And how to I use a HWND reference in VB?
Wan
Wan
In VBAPI, booleans are always 'converted' to longs, but I must say I don't know exactly why. Still, it should work with 0 for false, >0 for true.
Window handles can be referenced by a long data type. This works for most handles (HINSTANCE, HDC, etc.).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.