• Advertisement
Sign in to follow this  

COM problem

This topic is 4729 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement