• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

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

Moe

help this pitiful soul

19 posts in this topic

i as a beginner programmer, i have just been getting into windows 98 programming. i am using borland C++ 5 (or so). i tried to write a simple program that displays a window (with no menus, or anything). i copied the code right out of the book, but i get 7 error messages. it seems to me that borland c++ won''t recognize the windows 98 functions. does bc++ only work with win 95? -Moe- (someone said that there should be more rhymes in posts so i will give it a try) complain, complain, thats all i get its a problem, i will bet, can borland do it? did i blew it? oh help this soul so it can rest from this problem the dang pest just let me do it cuz i know i can do it and if i cant there''ll be no show
0

Share this post


Link to post
Share on other sites
I would be glad to help you, but you have not told me what is wrong. When you post to a board and say, my code does not work, it is not very helpful. Post the error messages you got, also the book you are copying code from would be helpful.
Later,
Eck
0

Share this post


Link to post
Share on other sites
I bet you it''s because you chose the wrong project from the New.. menu. It should be "Win 32 Console" .

JoeG
0

Share this post


Link to post
Share on other sites
Okay here is the problem (sorry for not posting it before)

I am trying to get a win98 skeleton program to work. When I try to compile i get the following errors:

Type name expected
Undefined symbol WindowFunc
wrong number of arguments in call of macro CreateAWindow
expression syntax
Undefined symbol nWinMode
type name expected

Now here is the code i copied from the book:

//a minimal win98 skeleton

#include

LRESULT CALLBACK WIndowFunc(HWND, UNIT, WPARAM, LPARAM);

char szWinName[] = "MyWin"; //name of windows class

int WINAPI WinMain(HINSTANCE hThisInst, HINSTANCE hPrevInst, LPSTR lpszArgs, int nWimMode)
{
HWND hwnd;
MSG msg;
WNDCLASSEX wcl;

//define a window class
wcl.hInstance = hThisInst; //handle to this instance
wcl.lpszClassName = szWinName; //window class name
wcl.lpfnWndProc = WindowFunc; //windows function
wcl.style = 0; //default style

wcl.hIcon = LoadIcon (NULL, IDI_APPLICATION); //standard icon
wcl.hIconSm = LoadIcon (NULL, IDI_WINLOGO); //small icon
wcl.hCursor = LoadCursor (NULL, IDC_ARROW); // cursor style

wcl.lpszMenuName = NULL; //no menu
wcl.cbClsExtra = 0; //no extra info needed
wcl.cbWndExtra = 0; //no extra info needed

//make the background brush white
wcl.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);

//register the window class
if (!RegisterClassEx(&wcl)) return 0;

//now that a window class has been registered, a window can be created.
hwnd = CreateWindow(
szWinName, //name of window class
"Windows 98 Skeleton", //title
WS_OVERLAPPEDWINDOW, //window style normal
CW_USERDEFAULT, //x coord - let windows decide
CW_USERDEFAULT, //y coord - let windows decide
CW_USERDEFAULT, //width - let windows decide
CW_USERDEFAULT, //hight - let windows decide
HWND_DESKTOP //no parent window
NULL, //no menu
hThisInst, //handle of this instance of the program
NULL //no additional arguments
);

//display the window

ShowWindow(hwnd, nWinMode);
UpdateWindow (hwnd);

//create the message loop
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg); //translate keyboard messages
DispatchMessage(&msg); //return control to windows 98
}
return msg.wParam;
}

//this function is called by windows 98 and is passed messages from the message queue
LRESULT CALLBACK WindowFunc(HWND hwnd, UNIT message, WPARAM wParam, LPARAM lParam)
{
switch (message) {
case WM_DESTROY: //terminate the program
PostQuitMessage(0);
break;
default:
//let windows 98 process any messages not specified in the proceeding
//switch statement
return DefWindowProc(hwnd, message, wParam, lParam);
}
return 0;
}

Any ideas that could be causing those errors?
(i dont think it is from selecting console (i am sure that i hit GUI)

0

Share this post


Link to post
Share on other sites
well I''m not sure if this is a large part of your problem but this bit:
LRESULT CALLBACK WIndowFunc(HWND, UNIT, WPARAM, LPARAM);
the I in WIndow is capitalized, and I don''t think you want it to be. (maybe that''s just a typo the the message board)
0

Share this post


Link to post
Share on other sites
I had this problem b4. Try
#define WIN32
or
#define _WIN32
or add it to your project-compiler-preprocessor
or something like this before including windows.h

Happy trying.
0

Share this post


Link to post
Share on other sites
Is it just me, or is there nothing following the #include statement... I might have missed something or looked at it wrong, no time now for reading posts...

--the Rabid_Stick

P.S. does anyone know the Magic Knight Rayearth theme song? if so, how did you get it out of your head?
0

Share this post


Link to post
Share on other sites
You''ve also spelt nWinMode wrong in the declaration of WinMain

No sense being pessimistic. It wouldn''t work anyway.
0

Share this post


Link to post
Share on other sites
I found the place where i spelled nWinName wrong. Is it just me or is windows programming a big pain in the butt?
0

Share this post


Link to post
Share on other sites
no Moe, it isn''t just you.. windows programming is a pain in the.. uhh, butt...
i''m a bit new to it myself, though i''m starting to get a handle on it.. (i''ve found Tricks of the Windows Game Programming Gurus very useful) i use VC++ 6, though, and i''m not sure how much is compiler specific, so i don''t know if i can help..
as a suggestion, if you could include which line each error was referenced too, it''d make it alot easier to find the problem.
just know that you''re not alone. dos/unix programming is so nice and pure. windows is the spawn of satan. but DirectX is so sexy...
0

Share this post


Link to post
Share on other sites
by the way, Moe, the Game Design Corner probably wasn''t the best place to post this. you''d probably get more responses (and help) is you posted it somewhere in the technical/programming section, or the lounge.
0

Share this post


Link to post
Share on other sites
Saruman, i''m sure there was something after the #include.. i think the message board supports HTML tags, so anything contained in less than and greater than will be interpretted as a tag, and therefore ignored if the browser doesn''t recognize it.. someone previously mentions the code tag..
an example:
(without the code tag)
#include
(with the code tag
#include
0

Share this post


Link to post
Share on other sites
i suppose i should use code tag next time, and i will be sure to post it somewhere like graphics theory, or something.

there was a windows.h after the #include

- Moe -

0

Share this post


Link to post
Share on other sites
I still couldn''t see what you included. I''m using IE5, maybe it''s just stupid that way.

How about the "pre" tag? I''ll try it...


#include


could you see that?

E:cb woof!
0

Share this post


Link to post
Share on other sites
it seems to work fine with IE4. maybe there is some glitch in IE5. who knows...

i thought this post would have been long dead by now...

- Moe -
0

Share this post


Link to post
Share on other sites