hknowledge

Members
  • Content count

    19
  • Joined

  • Last visited

Community Reputation

113 Neutral

About hknowledge

  • Rank
    Member
  1. c++ byte arrays how to output

    All I know about the data is that it is stored as binary data. A MSFT told me the data would contain /device/harddiskvolume2/something/something.exe He never specified wether it was a null terminated string or char array or anything like that. So does anyone have any assumptions? In the MSDN documentation it is listed as FWP_BYTE_BLOB as the data type. The byte blob is storing an AppId from the FWPM_NET_EVENT0 header. If that helps. How would I even output it with cout? for(int a = 0; a < size; ++a) { cout << data + a; } ?
  2. c++ byte arrays how to output

    I have kind of a problem. This is the first time I have encountered a binary byte array and I need to output it to the screen. typedef structure binary_byte_array{ UINT32 size; UINT8 *data } Size is how many bytes are in the array. *data is a pointer to the start of the data. In the data is a file location. For example it will contain something like c:/something/somefilename.exe. I need to be able to output the file location stored in the data. I know how to read binary data from files, but I am kind of stuck on how to read it stored in this kind of array. I am also confused how I would output it to the screen, do I need to convert it from binary to ascii char's? The data is written in 4 byte blocks right? (The size of a UINT8) Or is that just the size of the pointer? Thank you for any help. Microsoft uses this data type for some of their internal workings,
  3. How to explain Programming?

    Its like learning a foreign language. You know what you want to say to someone but you have to learn their language first so they understand. Except the machine is the foreigner you are trying to communicate with. That is how I would describe it to someone. People are going to be potentially confused by a technical explanation.
  4. I wanted to take USGS datasets to render the world terrain to real scale and then be able to walk around in my own virtual world with just randomly generated trees, and textures that matched its region. Then I wanted to make a war game out of it like you got a handful of spy drones and a few satellites and you had to use them to find another person playing. Then when you found them you had to hit them with cruise missiles. Modern games are so unimaginative and I really wish I had the skill alot of game developers have. I am still years away from being able to do it. I know how to code (albeit slowly), and I know how to use DirectX, it would still take me awhile. Nowadays I have more interest in making tools and science. Like making things to secure my computer or carry out chemical reactions. I also would like to learn more about making servers and databases. And making my own operating system even. And things like parallel computing, hardware design, etc. Basically just stuff that interests me in a hobby type of way.
  5. win32 dialog question

    I am not sure that is a complete answer because the button in the dialog won't work when you use wm_create. Neither does moving it. And it does not receive messages. Basically the program freezes.
  6. win32 dialog question

    [source lang="cpp"]#include "windows.h" #include "resource.h" HWND wfpMainWnd = 0; HINSTANCE wfpAppInst = 0; BOOL CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_INITDIALOG: return true; case WM_COMMAND: switch(LOWORD(wParam)) { case IDOK: EndDialog(hDlg, 0); return true; } break; } return false; } LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_CREATE: DialogBox(wfpAppInst, MAKEINTRESOURCE(IDD_DIALOG), wfpMainWnd, MainDlgProc); return 0; case WM_DESTROY: PostQuitMessage(0); return 0; } return DefWindowProc(hWnd, msg, wParam, lParam); } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR cmdLine, int showCmd) { wfpAppInst = hInstance; WNDCLASS wc; wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = wfpAppInst; wc.hIcon = ::LoadIcon(0, IDI_APPLICATION); wc.hCursor = ::LoadCursor(0, IDC_ARROW); wc.hbrBackground = (HBRUSH)::GetStockObject(WHITE_BRUSH); wc.lpszMenuName = 0; wc.lpszClassName = L"wTest"; RegisterClass(&wc); wfpMainWnd = ::CreateWindow(L"wTest", L"GameDev Win32 Test", WS_OVERLAPPEDWINDOW, 0, 0, 800, 600, 0, 0, wfpAppInst, 0); ShowWindow(wfpMainWnd, showCmd); UpdateWindow(wfpMainWnd); MSG msg; ZeroMemory(&msg, sizeof(MSG)); while(GetMessage(&msg, 0, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return (int)msg.wParam; }[/source]
  7. win32 dialog question

    I am solving the problem by calling dialogbox() from in the winmain() main function. The dialog and window behave like normal when I don't use wm_create in the windows procedure. Also why are people rating me down whenever I post?
  8. win32 dialog question

    Here is a basic skeleton of what I tried. Bool callback maindialog() lresult callback wndproc() { Case wm_create: Dialogbox(); } int winapi winmain() { } I am on my phone so can't post the source but that was the general idea on what I tried. The main window never displayed until the dialog was destroyed. I will post the source when I get a chance. Thank you for all the reply's.
  9. "Must-Learn" Languages

    C, C++, Assembly In that order. With C and C++ you can create whatever you can imagine. With assembly added you will be a god instead of an angel
  10. win32 dialog question

    I never thought it might be locking the thread. Thank you. I might just try using regular child windows instead of dialogs then. The only bad part is there is no control resource editor/designer for regular windows, only dialogs. I will have to hand code all the controls in myself.
  11. win32 dialog question

    I answered my own question. Its because wm_create is called before the window is drawn. Thank you anyways gamedev! I still wonder why the window wouldn't be drawn after the dialog, I guess you would need to set it as focus somehow so it's procedure is called for a second time.
  12. In the wm_create of my window callback procedure I am calling createdialog() to open a dialog window. When the function is called my main window dissappears and the dialog takes its place.I have my main window set as the parent. Why? I want my dialog and the main window open at the same time. When I close the dialog with enddlg() the main window comes back. I can open the dialog through a menu and they both appear but if I use wm_create it doesn't.
  13. Does anyone know if the 2008 version has that feature?
  14. Visual studio 2010 has a neat feature that when you pass a argument into a function it tells you with a red squiggly line that you haven't passed the right type. Very useful. The problem is that I only have visual studio 2005 that has intellisense and warnings from the stone age in comparison. Does anyone know any addin's that upgrades 2005 to have this specific functionality? I can't use visual studio express because I need the resource editor, among a few other things.
  15. Yes thank you I know I was just posing a question I already knew the answer to. I wanted to expose how the syntax does not hold up. Seems like it was tacked on as an afterthought. Yes of course always use 0.0f for floats i was just making a quick example my apology. thank you again for the reply. there is probably a reason this syntax is not recognized in the bjarne stroustrop official reference book.