Initializing WGT95 in VC++

Started by
6 comments, last by Bruno 23 years, 12 months ago
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
Advertisement
Anyone??? Chris??
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
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
Can''t anyone help me ???
What error do you get when compiling? I have compiled the examples without problems using MSVC 5.
º¿º
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)


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

This topic is closed to new replies.

Advertisement