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

Ratman

Learning DirectPlay

6 posts in this topic

Im trying to learn directplay with the tutorial here on gamedev, and the directx helpfile. But the code is already not working (compiling). heres whats wrong: if(CoCreateInstance(CLSID_DirectPlay, NULL, CLSCTX_INPROC_SERVER, IID_IDirectPlay3A ,(LPVOID*)&lpdp ) != S_OK) { ErrorMessage("Error creating Directplay object"); CoUninitialize(); return; } // creating lobby object DirectPlayLobbyCreate(NULL, &lpdp, NULL, NULL, 0); // get new interface of lobby lpdp->QueryInterface(LPDIRECTPLAYLOBBY2A, (LPVOID *)&lpdplobby); //error C2275: ''LPDIRECTPLAYLOBBY2'' : illegal use of this type as an expression lpdp->Release(); I get errors with QueryInterface... any ideas? thanks dave ratti
0

Share this post


Link to post
Share on other sites
<disclaimer>I have never used DirectPlay.</disclaimer>

quote:
Original post by Ratman

// get new interface of lobby

lpdp->QueryInterface(LPDIRECTPLAYLOBBY2A, (LPVOID *)&lpdplobby); //error C2275: ''LPDIRECTPLAYLOBBY2'' : illegal use of this type as an expression



You have passed ''LPDIRECTPLAYLOBBY2A'' to QueryInterface. This is not valid, as ''LPDIRECTPLAYLOBBY2A'' is a typename (ie. just like int, or char). You need to pass an object of that type, not the type itself.

Also (and I am not at all sure about this), you are using the same pointer (lpdp) for your DirectPlay interface -and- your DirectPlayLobby interface. I believe you need a different pointer as they are not the same thing. Maybe someone with more experience than I can point out what t do here.
0

Share this post


Link to post
Share on other sites
It is perfectly fine to use the LPDIRECTPLAYLOBBY2A

but your problem is you are using the directplay pointer (LPDIRECTPLAY3A) instead of the directplay LOBBY pointer (LPDIRECTPLAYLOBBY2A) to query..

Check out the DirectX section. There is a directplay tutorial I have written before.
0

Share this post


Link to post
Share on other sites
I don''t know much about DirectPlay either, but this is a COM problem after all, isn''t it?

How can it be fine to use a type there? How does the compiler pass a type as a parameter of a function? And, to boot, the error message explicitly states that''s he''s "illegally using a type as an expression".

Anyway, the first parameter of the QueryInterface is an "interface ID" (that''s what they''re called isn''t it?). These usually start with "IID_". E.g., in DirectDraw: IID_IDirectDrawSurface, etc.

So he should try:

lpdp->QueryInterface( IID_IDirectPlayLobby2A, (LPVOID *)&lpdplobby);

Well, try that and see how you go, anyway.

-Hotstone

0

Share this post


Link to post
Share on other sites
Void:

that code is copied directly from your tutorial. There were a few other errors to....
0

Share this post


Link to post
Share on other sites
Hotstone is right..

I must be sleeping while typing that up..

Sorry about that.. I will go back and check for errors and post an updated copy..
0

Share this post


Link to post
Share on other sites
Ok.. I have checked and ask gamedev to update the errors.

So far there are two errors reported..

I have checked and there doesn''t seem to be more.. but then my eyes are really tired..zz..

Please inform me if there are more errors.
0

Share this post


Link to post
Share on other sites