Kryptus

Members
  • Content count

    281
  • Joined

  • Last visited

Community Reputation

100 Neutral

About Kryptus

  • Rank
    Member
  1. Hello, I have made a network-based application that uses asynchronous calls. In the Receive data callback function, I have it so that if it receives login verification then it creates a system tray icon that can then access the rest of the program. The problem is that the icon appears but is not functional. As far as I know, it's because this create tray icon function is created on a different thread (the one receiving the asynchronous calls). How would I access this function from the asynchronous call but get it to run on the main (or GUI?) thread?
  2. Hello, I've been trying to research possible ways of skinning applications in C#. I've searched and searched but there's so little information out there. I heard that you could do it by overriding the Paint function for various controls? Right, wrong? Any links to resources would be helpful too. Thanks in advance.
  3. I've seen MS DX9 sample code where they put an "m_" before the variables. Why is it? Also, why is there sometimes a "p" as well? I understand that if it was an "i" it would be and integer or if it was a "b" it would be a boolean, but what does "p" mean? this is simple enough: int iMouseX, iMouseY; but would I ever do this? int m_iMouseX, m_iMouseY Of course, I know there are no rules on variables, but I'm just asking.
  4. I'm just finalising the planning of the game I am going to make. The problem is I do not know what sort of file formats to use for all of my data (models, maps, music, movies, images, etc.). Is it wise to just leave the images as TGA, or zip them? or to even make my own file formats? This goes for the other files as well. I don't particularly want ppl editing my stuff. What are the advantages of custom file formats? For example, Unreal Tournament uses *.utx and *.uta files and the like, and Half-Life used *.wad files to hold map textures. Why would they do that? Should I follow example?
  5. Hi all, I have plenty of years of programming experience in C++, and I have now been focusing myself on making modifications for the source engine (half-life 2). I have done all the introductory courses on editing hl2 single player, etc. but now I want to find some resources on starting from scatch! The sorta resources I'm looking for are things like: Creating custom weapons. Creating custom key binds. Things like that. Not all these resources are found at: http://developer.valvesoftware.com/ Does anyone know any other good tutorial sites for HL2 that may also include an introductory tutorial on creating a new mod from scatch and how to get started? Thanks in advance.
  6. Why does the control flash?

    I have made a simple application in C++ 2005 Express with a text box and a status bar. The code I have added below allows the controls to be resized with the window: case WM_SIZE: { RECT rcClient, rcStatus; GetClientRect(hWnd, &rcClient); GetClientRect(hStatus, &rcStatus); MoveWindow(hList, rcClient.left, rcClient.top, rcClient.right, rcClient.bottom - rcStatus.bottom, FALSE); MoveWindow(hStatus, 0, rcClient.bottom - rcClient.top, rcClient.right, NULL, FALSE); } break; The problem is, when I resize the window, the textbox control flashed between the control and the window background colour really quickly. How do I overcome this?
  7. Conversation problem

    Quote:Original post by Trillian Strange the second one works, you have semicolons in the middle of it: "...GetValue());, "Location"..." Do you have this in your real code?... from what I know, it shouldn't compile I just copied and pasted it from the first source sample into the second box. So ignore that bit. I'll edit it out. Regardless, the problem still remains... [Edited by - Kryptus on February 4, 2006 9:01:30 AM]
  8. I just want to use the following code to put the values from my database into these variables. The following code returns a bunch of random symbols in the variables: LPCSTR szLocation = (char *)((_bstr_t) pRst->GetFields()->GetItem("Location")->GetValue()); LPCSTR szValue = (char *)((_bstr_t) pRst->GetFields()->GetItem("Value")->GetValue()); LPCSTR szName = (char *)((_bstr_t) pRst->GetFields()->GetItem("Name")->GetValue()); MessageBox(NULL, szLocation, "Location", MB_OK); MessageBox(NULL, szValue, "Value", MB_OK); MessageBox(NULL, szName, "Name", MB_OK); Whereas the following code displays the text properly: MessageBox(NULL, (char *)((_bstr_t) pRst->GetFields()->GetItem("Location")->GetValue()), "Location", MB_OK); MessageBox(NULL, (char *)((_bstr_t) pRst->GetFields()->GetItem("Value")->GetValue()), "Value", MB_OK); MessageBox(NULL, (char *)((_bstr_t) pRst->GetFields()->GetItem("Name")->GetValue()), "Name", MB_OK); I'm sure I'm doing something stupidly wrong lol. A little help please. [Edited by - Kryptus on February 4, 2006 9:01:38 AM]
  9. Haha quite the list now eh? Feel free to add me to msg as well: metallicred@gmail.com I am a hobbiest programmer. I know the following programming languages: Visual Basic, C#, C++, HTML, CSS I also have some skills in DX 9.0 and very basic OpenGL knowledge. I tend to do more reading than coding so I know all the fundamentals, some common problems, etc.
  10. Cancelling an event in C++

    Quote:Original post by Oluseyi WM_DESTROY is never sent if you don't call DestroyWindow. The problem is that, after handling WM_CLOSE, you allow control to fall outside the switch statement, which probably calls DefWindowProc - which then calls DestroyWindow. case WM_CLOSE: { ShowWindow(hwnd, SW_HIDE); return 0; // you left this out } Thanks a lot! That works perfectly now. To think, it was something so simple. It didn't even occur to me. I was playing around with PeekMessage just now, trying to intercept the WM_CLOSE message. Thanks again.
  11. Cancelling an event in C++

    When I close one of my many windows in my application, I don't want them to be destroyed but made hidden so that when they open again they will have the same data and the same position. Since I've done programming in VB and C# I know that cancelling the close event will stop this from happening. I wish to know how to do this in C++. Here's my code: LRESULT CALLBACK AboutWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_CLOSE: { // TODO: "Cancel Event" code here ShowWindow(hAbout, SW_HIDE); } case WM_CREATE: { ...
  12. How to implement a GUI menu

    Quote:Original post by NewNoob I'm new here and currently studying C++, SDL and Ogre. I was just curious as to how to make a game start menu (example. New game, load game, multiplayer and credits ect..) Is it usually done using Photoshop and how do you define the buttons in C++ ? Any help or tips would be greatly appreciated. Cheers! Hey, check out http://www.c-unit.com. This dude has a lot of DX tutorials based on a GUI but its in Managed DX for C#, so what you could do is open the files in notepad and browse through the algorithms if you can.
  13. Registry Problem

    Quote:Original post by Oluseyi You know, Windows functions have return values for a reason... I've tried: if (RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\MyNewKey", 0, "", KEY_ALL_ACCESS, 0, &sa, &hKey, &state) == ERROR_SUCCESS) MessageBox(NULL, "Success", "", MB_OK); else MessageBox(NULL, "Failed", "", MB_OK); and I get a failure everytime. What am I doing wrong?
  14. I am trying to create a registry key in the registry but it does not seem to be working. When I open up regedit I can't see my created key. Here is my code: HKEY hKey; DWORD state = 0; SECURITY_ATTRIBUTES sa = { sizeof(sa), 0, 1 }; RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\MyNewKey", 0, "", KEY_ALL_ACCESS, 0, &sa, &hKey, &state); if (state == 1) MessageBox(NULL, "The registry key has been created!", "", MB_OK); else if (state == 2) MessageBox(NULL, "The registry key already exists and has been opened!", "", MB_OK); RegCloseKey(hKey); I run Windows XP SP2 with Visual C++ 2005 Express Edition.
  15. I think I have it working now. I'm still experimenting. I have create a new header file with all the statics. To avoid an include loopback error, I have referenced the new header to all the class header files and main.h. each class header refers to main.h as well. I'm still fiddling with it but so far it's looking promising and I have created some windows already so there's no compile errors... yet. Thanks for all your help so far guys!