Jump to content
  • Advertisement

Archived

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

Bruno

Initializing WGT95 in VC++

This topic is 6688 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

Hi I''m tryng to initialize the WGT95 under VC++ 6. Before i make the call to vga256, i must create the directdraw object, and configure the system or something. The examples that came with WGT95, demo1 to demo4, in all of them i get an error when compiling. Anyone knows, how to initialize the system, so i can start using all the functions of WGT95?? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Have you checked your library directories.
In MSVC under Tools/Options, Directories tab, should have the directory with the WGT Lib Files in & at the top of the list the directory with the DirectX libs - same for headers.

Cheers
Darrin

Share this post


Link to post
Share on other sites
Thanks for posting Darrin, but the configuration of MSVC it''s not the problem, i already made that with all the include and lib files.
I believe i must initialize directdraw or something before calling vga256(), but i just don''t know how..
Look at the help of vga256(), from the wgt reference:

Remarks:This command will create a palette object using the wgtddpal structure. DirectDraw will create a palette which is initially composed of all blackentries, then associate this with the primary DirectDraw surface in wgtpdds. You must use this function after declaring your DirectDrawobject and primary surface, but before you call any other WGT functions.

You understand what do i mean?? He says that first i must declare my primary surface and make a declaration onirectdraw object or something....
Can you help???
Thanks
Bruno

Share this post


Link to post
Share on other sites
HI
The errors i get are this:Compiling...
Demo1.cpp
C:\esoft\Wgt95\original\Demo1\Demo1.cpp(590) : error C2440: ''='' : cannot convert from ''void *'' to ''struct HINSTANCE__ *''
Conversion from ''void*'' to pointer to non-''void'' requires an explicit cast
C:\esoft\Wgt95\original\Demo1\Demo1.cpp(615) : error C2664: ''CreateWindowExA'' : cannot convert parameter 11 from ''void *'' to ''struct HINSTANCE__ *''
Conversion from ''void*'' to pointer to non-''void'' requires an explicit cast
Error executing cl.exe.

Demo1.exe - 2 error(s), 0 warning(s)


Share this post


Link to post
Share on other sites
Just cast the void pointer with the types specified:

i.e.
HInstanceTypeVariable = (HINSTANCE *)WhatEverVoidPointerThisIs;

CreateWindowEx(0,blah blah blah... , hwndParent, hmenu,*((HINSTANCE *)InstanceInsideaVoid), etc...);

IMO, as useful as a void pointer is, it's also very dangerous due to its lack of type and should be handled with at least some care (And they're especially bastards for errors like the ones you've posted.)


Oh yeah, my code may not be 100% accurate, but it's roughly correct... I've just got a real bad headache and can't possibly concentrate enough




----
Windows and Unix suck, I'm going back to CP/M.

Tape_Worm

Edited by - Tape_Worm on 4/24/00 5:36:07 PM

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!