• 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.

Tac-Tics

Errors + Syntax Q's

8 posts in this topic

I''m starting Windows programming in c++ and I have a few questions. I tried to compile some sample code from my book and it''s giving me some erros.
#include <windows.h>

LRESULT CALLBACK fnMessageProcessor (HWND, UINT, WPARAM, LPARMA);

int WINAPI WinMain (HINSTANCE hInstance, HINTANCE hPrevInstance,
					PSTR szCommandLine, int iCommandShow)
{
....
}
I hope HTML works here =-) It gives me an error saying "return type expected" for those two lines. Can anyone help me here? Also, why does the code implement that kind of syntax (like "int WINAPI WinMain"). I''m sure there something here I haven''t learned about. "I''''m not evil... I just use the power of good in evil ways."
0

Share this post


Link to post
Share on other sites

there are about a billion ways to declare WinMain

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
return 0;
}


return type expected means it wants to see a return type somewhere.

the APIENTRY or PASCAL or CALLBACK all set how parameters are pushed on the stack.
0

Share this post


Link to post
Share on other sites
>> return type expected means it wants to see a return type somewhere

Obviously, but aren''t LRESULT and int both the return types it''s asking for?

I also tried your example:

#include <windows.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
return 0;
}

and it''s now giving me an error: "unresolved external ''_main'' referenced from...."

I''ve seen this error a few times and I don''t know what it means.
Why can''t they make this as easy as it is in Java =-(

"I''''m not evil... I just use the power of good in evil ways."
0

Share this post


Link to post
Share on other sites
@Tac-Tics

Have you chosen the right application for your programm?
(i think wou need win32-app not win32-console-app)


The Wild Wild West - Desperado!
0

Share this post


Link to post
Share on other sites
When you created your project you chose console app, which means your compiler is looking for main(), and since this is a windows app, it''s not finding it, and is complaining appropriately.

Recreate your project/workspace and be careful to chose win32 app, not console. it will compile fine then.

0

Share this post


Link to post
Share on other sites
In the declaration of fnMessageProcessor you misspelled LPARAM, and in the declaration of WinMain you misspelled HINSTANCE. This probably confuses the parser (though you should have received other errors as well, complaining about the unknown names).
0

Share this post


Link to post
Share on other sites
Hrmm... I don''t know where that misspelling came in (I really hate the MS abbriviations for everything >=-( I think I tried compiling it correctly spelled at one point. It''s still giving me the _main reference error.

As for WildWest and AbsoluteDew, I thought I wrote this, but I''m using Borland''s C++ compiler and a text editor called Textpad. I at no point got to decide to make it a console app or a window app =-|

"I''''m not evil... I just use the power of good in evil ways."
0

Share this post


Link to post
Share on other sites