Dogh Quch

  • Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About Dogh Quch

  • Rank
  1. Doubt about VS 2005.

    Ok, it's working now. Thanks A LOT for the help guys.
  2. Doubt about VS 2005.

    This is exactly what I need Antheus. But where is this include path precisely? I already look at google and found no helpful information. i even look field by field in the project properties window and found nothing. Obviously I am missing something.
  3. Sorry to bother, I know this is a pretty lame question and probably there must be a thread already asking for this but I not even know how to name it appropriately. How the hell do I tell Visual Studio to search for include paths starting from a root directory and NOT from the file location?? An example: This is my working directory: \Source\components_source And there is this file: components_source\link\device\SBRDevice_link.h With this include: #include "memory\client\SBR_memory.h" The directory memory is on the same level as the link directory and I want VS to use components_source as the root directory and not from SBRDevice_link.h. Have I been clear?
  4. Never had to do it before!

    This would work fine if I had a small array. But imagine this operation for a GIENT array. I'm thinking about living this idea and simple make an specific operation to each situation....this way I have more control over what is going on...
  5. Try like this: [SOURCE] struct _montains { bool active; float h; float w; float d; } Montains; // Montain structure [/SOURCE] Where Montains will be your "data type". I wouldn't use a class just for that...
  6. Hail to you forum people! I have been working on a array manipulation function and I faced my self with a problem I have never faced before....I know this is not excuse to come in yelling to the 4 winds like a spoiled child....but I'm current unable to solve it my self. What I wished to do is, get a void* array and read it to a unsigned -N bits in -N bits. This array is actually a indexer array for another array but the problem is that for memory optimizations I don't know previously the size of etch array position and this may get pretty nasty with 4 bits information till 16 bits. My first guess was to make a N bits left shift and get the "throw out bits", but I didn't found a function for that. Then I thought about using a N bit masks and go shifting it N bit right in the array, but it would be incredibly stupid to use inside a loop. I could make a specific read operation for each situation and it could work, but this will be my last option. So, is there any one out there with a simple idea?
  7. Problem with GetDisplayMode.

    Ok people...I give up of trying to use that was probably a bad idea any way. But just to fulfill your curiosity, this was the original structure: struct MainStruct { HINSTANCE MainWindowInstance; HWND MainWindowHandler; //Painting variables HDC MainDC; //handle to a device context, user window screen //DirectX Stuff LPDIRECTDRAW7 DirectXOI; //DirectDraw object interface DDSURFACEDESC2 SystemDisplaySettings; //control variables RECT rect_UserRect; //to trek printing window size unsigned ui_MousePosition[2]; //to trek mouse position unsigned Frames; clock_t Time, PrintingDelay; AppState enum_AppState; } st_TheMainStruct; Forget about the "//control variables" they are just to play with. Is there any thing else I'm not explaining well enough? About the structure name, hehehe, using "The..." is just a way I like to work with when there is just one thing of something in my program or function, its really easy to trek the variables like this! The "Main" part is just for me to know that this is the principal variable, structure or whatever. And the "st_..." in the beginning is for easy finding the variables when VS opens that little reference box with all the variables in the structure. This way all the integers, floats, structures, etc, stay together. See? Its very descriptive because it says exactly what the variable is! I not even have to put comments!
  8. Problem with GetDisplayMode.

    Thanks Kovacsp, this information will be very useful! Now back to you Kippesoep. First, why st_TheMainStruct is a dreadful name? st_TheMainStruct is a global struct were I put things I'll use very often. My first intention of use with this procedure was to restore the user settings, but then I found the same comment that you show me and start using RestoreDisplayMode instead. But this isn't the point, even if I was using with this intentions the problem still exist and have nothing to do with the program logic. What if I wished to check if my program display settings are compatible with the users display settings? The problem can't be the way I'm using the DDSURFACEDESC2 structure because this 3 lines are working fine: memset (&st_TheMainStruct.SystemDisplaySettings, 0, sizeof (DDSURFACEDESC2)); st_TheMainStruct.SystemDisplaySettings.dwSize = sizeof (DDSURFACEDESC2); st_TheMainStruct.SystemDisplaySettings.dwFlags = DDSD_WIDTH | DDSD_HEIGHT; And the program works fine too when running in computers with the DirectX SDK.
  9. Hail! As usual, I'm getting a strange and mysterious error! During my program initialization I'm trying to get the users display settings using the GetDisplayMode method. I'm current using the Direct Draw interface (I know it's deprecated, I'm just trying to understand DirectX for now and DirectDraw is helping a lot) and this may be the problem, but the interesting thing is that the program works fine in computers in which the DirectX SDK is installed but cause a memory error in computers without the directX SDK. I guess this sort of thing may happen often, but even if no one saw this kind of aberration before it should be interesting for some one to know it happens! This is the procedure (see above), the error occurs in the GetDisplayMode call. Does any one have a guess about what is happening? Ps: how do I put those little text windows in the post? //Create base IDirectDraw interface st_TheMainStruct.DirectXOI = NULL; if (DirectDrawCreateEx (NULL, (LPVOID *)&st_TheMainStruct.DirectXOI, IID_IDirectDraw7, NULL) != DD_OK) return FALSE; //Set cooperation mode with Windows if (st_TheMainStruct.DirectXOI->SetCooperativeLevel (st_TheMainStruct.MainWindowHandler, DDSCL_NORMAL) != DD_OK) return FALSE; //Save Windows display settings memset (&st_TheMainStruct.SystemDisplaySettings, 0, sizeof (DDSURFACEDESC2)); //clearing out the structure st_TheMainStruct.SystemDisplaySettings.dwSize = sizeof (DDSURFACEDESC2); st_TheMainStruct.SystemDisplaySettings.dwFlags = DDSD_WIDTH | DDSD_HEIGHT; if (st_TheMainStruct.DirectXOI->GetDisplayMode (&st_TheMainStruct.SystemDisplaySettings) != DD_OK) return FALSE;
  10. Windows programming,

    It took some time but I found it! To change the window attributes you must first call this function: SetWindowLongPtr. Than, you call SetWindowPos to make the changes take effect. I already changed the screen size and took out the menu bar. I'm still unable to make a complete full screen, but I'm on the right trek now. Tanks for the help guys!
  11. Windows programming,

    I did nothing! ChangeDisplaySettings(NULL,0) will just restore de default dysplay settings (I'm assuming its the windows settings). Theoretically, to change to full screen would be like this: ChangeDisplaySettings (NULL, CDS_FULLSCREEN); Maybe I'm using it the wrong would you use it? I mean, just calling the function should do the job or it need some work before/after the function call?
  12. Windows programming,

    ChangeDisplaySettings doesn't look like what I want to do. This program I'm building is just a skeleton to a directX based program. The fist screen will be just a window with some menu option and a big logo image, so the user may configure the application, but it should be in full screen mode when running. So, this function mess with the windows display settings and I would like to stay as far as possible from windows! Besides, It's safer to let directX deal with the display sittings. Maybe I didn't understand how it actually work, but I was unable to produce the effect I wished. I'll keep trying...
  13. Windows programming,

    Thanks Illco. How stupid am I? now I see were I was mistaken.... I must have read that thing 3 times just this morning and didn't realize that. Just one more thing, how do I change from windowed mode to full screen mode? I don't want to create a full screen window, I have a window opened and I want to change it to full screen when the user choose to.
  14. Hail, I don't know if this is the best place to ask that, but... How do I take out the maximize and minimize buttons in the window I'm creating? This is the procedure I'm working to crate the window, I already check the windows documentation but what I'm looking for doesn't look like to be in the parameters of this creation functions: WNDCLASSEX winclass; //Main window hadler //first fill in the window class structure winclass.cbSize = sizeof (WNDCLASSEX); //size of WNDCLASSEX structure = CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW; //style flags winclass.lpfnWndProc = WindowProc; //function pointer to handler winclass.cbClsExtra = 0; //extra class info winclass.cbWndExtra = 0; //extra window info winclass.hInstance = h_Instance; //the instance of the application winclass.hIcon = LoadIcon (h_Instance, "ICON_ExeFileIcon"); //icon to use in .exe file winclass.hCursor = LoadCursor (h_Instance, "CURSOR_MainCursor"); //cursor to use in window winclass.hbrBackground = (HBRUSH) GetStockObject (BLACK_BRUSH); //background color winclass.lpszMenuName = NULL; //the name of the menu to attach winclass.lpszClassName = MAIN_WINDOW_NAME; //window name winclass.hIconSm = LoadIcon (h_Instance, "ICON_SmallIcon"); //icon to use in the window top left //register the window class if (!RegisterClassEx (&winclass)) return 0; //Create the window st_TheMainStruct.MainWindowHandler = CreateWindowEx (NULL, //extended window style MAIN_WINDOW_NAME, //pointer to registered class name "Your Basic Window", //window text WS_OVERLAPPEDWINDOW | WS_VISIBLE, //window style 0, 0, //initial x,y 400, 400, //initial width, height NULL, //handle to parent LoadMenu (h_Instance, MAIN_MENU_NAME), //handle to menu h_Instance, //instance of this application NULL); //extra creation parms
  15. Compilation problems!

    Thanks Syranide, It works fine now! My brain have serious problem working with drawing and images, that's why I'm starting slow and using just the Direct Draw. Reading the DirectX documentation I realized that Direct Draw is not current used any more and that D3d give support instead. There is a lot of stuff to get used in directX when you only made console programs in your life!