Jump to content
  • Advertisement

KrazeIke

Member
  • Content Count

    215
  • Joined

  • Last visited

Community Reputation

256 Neutral

About KrazeIke

  • Rank
    Member
  1. KrazeIke

    details on memory chips

    On x86, each byte can be addressed individually.
  2. KrazeIke

    Win32 programs without global variables

    You can effectively pass arguments to your WindowProc using SetWindowLongPtr and GetWindowLongPtr with the GWLP_USERDATA flag. It's not exactly pretty, but it works.
  3. This thread may be relevant. However, if that's all your program does, then it's probably easier to just post your code than to have us speculate.
  4. KrazeIke

    CPU usage

    Build it in release mode instead of debug.
  5. For future reference: downforeveryoneorjustme.com
  6. KrazeIke

    Stop win32 window from dissapearing

    Actually, on my machine, what happens when I run that code is the window shows up just fine, but the process does continue to run after I've closed the window. I can tell you why that part of it is happening. If you look at the documentation for PostQuitMessage, it says "The PostQuitMessage function posts a WM_QUIT message to the thread's message queue". The key thing here is that the message is posted to the thread's message queue, not the window's message queue (which makes sense because you're not passing a window handle to PostQuitMessage). But when you call PeekMessage, you're passing in the window handle, which causes it to only retrieve messages for that window. What you may want to do is pass NULL for the window handle, because according to the documentation for PeekMessage, "if hWnd is NULL, both window messages and thread messages are processed". Passing in NULL instead of the window handle causes this program to work correctly for me. Now, I don't know why the window would be disappearing on your system. As I said, it doesn't do that on my system. However, I do have one other comment. In your code, you have if(PeekMessage(...) > 0). Even though PeekMessage appears to return a value of 1 when there's a message (based on looking at the return value in a debugger on my system), that's probably not the safest way to check the return value because the documentation says: Quote: Return Value If a message is available, the return value is nonzero. If no messages are available, the return value is zero. So, you may want to change it to if(PeekMessage(...) != 0) instead.
  7. KrazeIke

    [C++] TryGetObject()

    You have to remember that even if you are passing a pointer to an object, the pointer itself is passed by value. If you want to modify the pointer in the calling function, the parameter needs to be a pointer to a pointer or a reference to a pointer.
  8. KrazeIke

    How to get ListIndex value?

    Looking at the documentation, it appears that there is indeed no such member of the ListBox class. Try the SelectedItem property.
  9. KrazeIke

    Enum functions

    Edit: beaten. You need to put the itsState declaration before any places where you use the itsState type. Right now, you're using the type before it is declared (as the return type for the State function, for example). Also, in some places you are using itsState as though it were an instance of the itsState type, which is not correct.
  10. Maybe these are dumb questions (I haven't done this kind of stuff in a while), but I'm asking them anyway. What's with the (HMENU) 100 in the CreateWindow for the button? Where is this WM_PAINT code? Is it inside gsp_MainWndProc? Are you trying to draw the button yourself? If so, shouldn't you be using BS_OWNERDRAW and handling the WM_DRAWITEM message? Or are you subclassing the window?
  11. I've never tried to do that, so this is just an idea, but maybe you could try sending a BN_CLICKED message to the parent window of the button instead. You'd need a handle to the button itself to do that.
  12. The problem is that one of those classes will have to be defined before the other, so the first one to be defined won't know about the other one. You need to use a forward declaration. In other words, instead of including Actor.h, just do: class ACTOR; And instead of including Weapon.h, just do: class WEAPON; You'll need to eventually include those headers in the .cpp files, but not in the .h files.
  13. KrazeIke

    wiki.gamedev.net down?

    Doesn't load for me either.
  14. KrazeIke

    Unresolved external on one build config?

    Double check that it's set to windows for both the release and debug configurations. I don't know what else could cause that error. If that doesn't work, maybe you should show us what command-line options the compiler and linker are using (Configuration Properties -> C/C++ -> Command Line and Configuration Properties -> Linker -> Command Line) for both the release and debug configurations.
  15. KrazeIke

    Unresolved external on one build config?

    That means you don't have a main function. Probably you have a WinMain function instead but your project is set as a console application. Look at Project -> Properties -> Configuration Properties -> Linker -> System -> SubSystem. Change it from Console to Windows.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!