Smacker_626

Member
  • Content count

    61
  • Joined

  • Last visited

Community Reputation

126 Neutral

About Smacker_626

  • Rank
    Member
  1. SDL Help

    gameEvents::screen() is returning an SDL_Surface, are you sure you don't want to return a pointer to an SDL_Surface instead? If you do, that should solve your problem since the code you posted doesn't actually make use of the SDL_Surface. Any code that actually works with an SDL_Surface will need "SDL.h" included to bring in the definition.
  2. [quote name='thefollower' timestamp='1330810146' post='4918972'] [quote name='Smacker_626' timestamp='1330759191' post='4918800'][list=1] [*]At the beginning of the file, include "cstdlib" so that you can access rand() and srand(). [*]You have a name conflict in cDungeon. The constructor uses a local variable named aaMaze but there's a data member called aaMaze as well. Fix the name conflict. [/list] Do these 2 things and your code works fine. Hope that helps [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]. [/quote] You've lost me on number 2... can't see where you're referring to =/ EDIT: Ah i see - it works now [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] [/quote] Sorry I wasn't very clear, I've edited my post to be a bit clearer. Glad to help.
  3. [list=1] [*]At the beginning of the file, include "cstdlib" so that you can access rand() and srand(). [*]You have a name conflict in class cDungeon. At line 52 in the constructor you define a variable named aaMaze even though at line 73 you define a data member with the same name. This wouldn't normally be a problem but in this case you try to use both in the constructor and so you're really only using the one you defined at line 52. Fix the name conflict. [/list] Do these 2 things and your code works fine. Hope that helps [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img].
  4. simple problem with assigning a value

    Glad to see you fixed your problem. Just an FYI, I've always read that float comparisons such as the ones you're using are very fragile at best, see [url="http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.17"]C++ FAQ Lite[/url].
  5. Works on 98 but not on XP?

    This may not help but you could try calling "fflush(FILE *);" after every write to the file, i'm not sure if the buffer would be flushed when your program crashes. Sorry I don't have anything else to offer.
  6. Need help with try and catch blocks

    Thx petewood, fixed something else for me :) Like I said though i've never used try / catch blocks before so I didn't know :P, I rated you too :) (Maybe it would of been best if I hadn't finally realized that "Rate This User" was at the bottom of every post :P)
  7. Need help with try and catch blocks

    Thanks Zahlman (you to Doc ;) ), it works now. CException::Format() was all messed up :|, I use to use ltoa in there but I compiled the program with strTemp += x + theNum and it worked so I figured I would take ltoa out and I got all my variable names mixed up in there lol. And you were right about CException.cpp not being compiled, I had it like that for awhile so I could compile my program w/o errors until I could rewrite the class. And you were right about my macros too, you can still leave the values out as long as you don't specify the values for any of the arguments after that one right? And Zahlman what do you mean about my style? :(, i'm trying my best. I rated both of you A+ :), thx for your help. EDIT: No need for the code on my site anymore so i'm taking it down.
  8. Need help with try and catch blocks

    Yes lol, didn't think of saying that.
  9. I just started to use try and catch blocks for my new program. I made a class called CException that holds a long and 3 std::string's (Error Msg, Line, Filename, Function Name). I have the code like this try { // THROW_STR is a macro in CException.h along with THROW_NUM and THROW THROW_STR("THIS IS A TEST :P"); } catch(CException e) { // e.Format().c_str() wont work in the call to AddLog for some reason // Format returns a std::string with everything in it ;) string strError = e.Format(); // AddLog of course adds the text to the log AddLog("\nException thrown!\n%s", strError.c_str()); } ProgCleanup(); return g_iExitCode; The compiler gives an error msg for THROW_STR(); "expected primary-expression before '(' token", I was going to say it gives an error msg for catch(CException e) too but I hit rebuild all again while I was writing this and it worked :-/. Also if I comment out the try / catch blocks and put CException e("TEST", -1, __FILE__, __LINE__, __FUNCTION__); AddLog("\nException thrown!\n%s", e.Format().c_str()); before them it gives me these errors "[Linker error] undefined reference to `CException::CException(std::string, long, std::string, long, std::string)'" "[Linker error] undefined reference to `CException::Format()'" "[Linker error] undefined reference to `CException::~CException()'" "[Linker error] undefined reference to `CException::~CException()'" yes it repeated that one twice and when I just use try { throw "TEST"; } catch(string s) { string strError = s; AddLog("\nException thrown!\n%s", strError.c_str()); } ProgCleanup(); return g_iExitCode; it won't put that text in the log but the text from ProgCleanup(); gets put in :-/, any help would be really nice :D I RARed and uploaded my code to > http://www.dragonruins.com/MyCode.rar You need v2.9 or > to UnRAR it (WinRAR - http://www.rarlabs.com/ of course :) ) I'm using Dev-CPP v4.9.9.1 - http://www.bloodshed.net/ (Use's gcc as the compiler) to compile everything. And how do you get URL's to work? Thanks ;-)
  10. socket problem in visual basic

    I fixed it :) Just needed to add another vbCrLf to the end of the request to the server.
  11. socket problem in visual basic

    I'm sure someone has tried to do this before, can anyone help me out here? :)
  12. I'm trying to connect to a Web Server and do a simple request for a PHP script passing it a variable in the URL, I used Internet Explorer to connect to another one of my programs to get the HTTP headers, I can connect to the Server and send the headers but the Server never sends any data back, my requests show up in the log so I know it's getting through. I tried going through the "Hypertext Transfer Protocol -- HTTP/1.1" document at w3.org but all it helped me with is the Connection header. I compressed the VB project with WinRAR and uploaded it to my site http://www.dragonruins.com/Update_IP.rar Sorry if my code is messed up lol, I don't use VB much, i'm just trying to get this working so my friend won't have to give me his IP everytime he restart's so I can access his Web Server. Thanks for any help :) Edit: I don't know how to make URL's lol [Edited by - Smacker_626 on January 19, 2005 11:43:34 PM]