Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Promit

Making a struct HWND* compatible with VB hWnd?

This topic is 6012 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 have a window in C++ which has a regular struct HWND* for its hWnd. When I try to pass this to a VB DLL however, It throws an exception. I can''t debug into VB(don''t ahve the source anyway), and I suspect that something in the change is wrong. Right now, I''m just casting the HWND* to long, and I highly suspect that this is not resolvable by a simple cast... ____________________________________________________________ Direct3D vs. OpenGL

Share this post


Link to post
Share on other sites
Advertisement
I am no VB expert, but I think the problem is, as you say, a simple casting error. If the VB function needs a plain HWND, then that''s what you want to send it. Since your variable is a pointer to an HWND, I believe you would want to cast it using (HWND *), not LONG.

Share this post


Link to post
Share on other sites
All handles are 32 bit... So casting with a long should work fine. 4 bytes is 4 bytes... Even if its long, handle, pointer, etc...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!