Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

dannygilbert3

@dannygilbert3
About
Posts
17
Topics
13
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Re-Starting an application after self killing (autodestruction)
    D dannygilbert3

    Hi ! Does somebody has any idea about HOW i can kill the process by itself (like Environment.Exit(0)) and restart again ? In fact, my problem is what I can do to restart the application auto'magic'ally. Does it exist some mechanism with Windows to auto-restart an application ? What I do is I want to restart my application with new settings and/or new setup.:sigh:

    Danny Gilbert, engineer Montreal, Canada

    C# workspace help question

  • Windows Service in background
    D dannygilbert3

    Hi ! I have to create a new software in C# which will always RUN in the background. I want to show the GUI only when the user click on the icon in the icon tray (resident program). The program must run by itself each time the system (PC) is power up. How we do it ? Note: I have checked with my Visual Studio 2005 in the New Project option but I don't see anything that seems to be a SERVICE (or resident program). How I must create the project ???? Thank you.

    Danny Gilbert, engineer Montreal, Canada

    C# csharp visual-studio question

  • CPU Usage on Windows (general question)
    D dannygilbert3

    Hi folks ! I am writing a video game with Direct-X and C++. I found that I use nearly 98% of the CPU usage. My specialty is embedded software where I can control the CPU usage because there is generally only one software in the system. But now, I write a game that "run" under Windows with other application. The PRIORITY LEVEL is set to NORMAL and I have a big loop (this is not EVEN-DRIVEN). The loop runs until a receive a QUIT message. For each loop, I look for Windows Message and execute it if I have one. If there is no Windows message, I render (update) the graphics of my game. So I use CPU for my game when the CPU is not busy. I have checked some other sample of games and they all reach 99% of the CPU usage. Is there something that I don't understand ? If some software has PRORITY LEVEL higher than normal, will it takes some CPU and the CPU usage of my game will drop ? Thanks for your comment.:-D

    Danny Gilbert, enginneer Montréal, Canada

    System Admin question c++ graphics game-dev hardware

  • Refresh all the screen (with Windows)
    D dannygilbert3

    Yes ! You are right. It only sets the size and the position of the windows inside the current desktop. IT TAKES 99% of the CPU. I never checked that before with any software I wrote... and I don't know why ! I design most of my time embedded application, so this is always the only software in the system. Some time, I design software for windows like TOOLS and other little stuff. GAMES is my home project. Is there something with the Windows Message loop ? Can I give sometime "the hand" or the control to the OS for a little time slice (for other software) ? How to do that ? Reducing cpu use about 5%, Is-it enough for Windows to update the screen, etc. In embedded system, I always try to don't use more tha 50-70% of the CPU time but with Windows, I was sure that Windows CONTROLS/HANDLE it for us. I never get involved with this issue on Windows. You are right, my GAME use 99% of the CPU. What to do ? Thanks.;)

    Danny Gilbert, enginneer Montréal, Canada

    System Admin game-dev c++ graphics help question

  • Refresh all the screen (with Windows)
    D dannygilbert3

    My code is like the following: 1- Change property of the client and the window 2- Destroy old scene, free memory 3- Resize 4- Create new scene 5- SetWindowPos ;) bool CGameEngine::ChangeWindowsSize( int NewWidth, int NewHeight ) { // Windows SetWindowLong( m_hWnd, GWL_style, m_dwWindowstyle ); // Resize window and put it on left-top corner. Player will then move // the window where he wants. m_WindowsWidth = NewWidth; m_WindowsHeigth = NewHeight; m_rcClient.left = 0; m_rcClient.top = 0; m_rcClient.right = m_rcClient.left + NewWidth; m_rcClient.bottom = m_rcClient.top + NewHeight; m_rcWindow.left = 0; m_rcWindow.top = 0; m_rcWindow.right = m_rcWindow.left + NewWidth; m_rcWindow.bottom = m_rcWindow.top + NewHeight; m_MiddleX = m_WindowsWidth / 2; m_MiddleY = m_WindowsHeigth / 2; // Destroy object in the old scene. switch ( m_ActualScene ) { case MAIN_MENU: m_pSceneMainMenu->DestroyFinal(); SAFE_DELETE( m_pSceneMainMenu ); break; // ... other scene } // Resize the screen like the user wants. if( FAILED( m_pGraph3DEngine->Resize( m_WindowsWidth, m_WindowsHeigth )) ) { return false; } else { switch ( m_ActualScene ) { case MAIN_MENU: m_pSceneMainMenu = new CSceneMainMenu( this ); m_pSceneMainMenu->SetRatioWindow( ( float)m_WindowsWidth/(float)m_WindowsHeigth ); m_pSceneMainMenu->Create(); break; // ... other scene... } if( FAILED( SetWindowPos( m_hWnd, HWND_NOTOPMOST, 0, 0, NewWidth, NewHeight, SWP_SHOWWINDOW ) ) ) { ErrorExit("SetWindowPos"); } return true; } return false; }

    Danny Gilbert, enginneer Montréal, Canada

    System Admin game-dev c++ graphics help question

  • Refresh all the screen (with Windows)
    D dannygilbert3

    Hi ! I have an application (a game in C++ with DirectX) where the player can change the size (property) of the client area. Ex: He has a screen about 1440x900 pixels, he can setup his client area (the game) in a 800x600 window, 1280x1024, etc. My PROBLEM is when the player size DOWN the client area (like... from 1280x1024 to 800x600), we still have the old "Picture" around the new client area of 800x600. The software still runs without any problem but windows don't refresh the screen (the other software or the desktop background. Is there any way to say to Windows OS to refresh all the screen or fire an event to all software to refresh there view ? Than you.:^)

    Danny Gilbert, enginneer Montréal, Canada

    System Admin game-dev c++ graphics help question

  • MultiLanguage Engine
    D dannygilbert3

    Does somebody has some tricks (or code) about multilanguage support ? (C++ , XML, or something else).;)

    Danny Gilbert, enginneer Montréal, Canada

    C / C++ / MFC c++ xml question

  • Extern and CLASS
    D dannygilbert3

    Easy question but I don't find the answer.:sigh: I have a header file with some classes. These classes used some class from one another header file. How can I tell to compiler to use the classes from other header files ? Extern does not work, only work on object.

    Danny Gilbert Montréal, Canada

    C / C++ / MFC question

  • Datagrid, DataSet
    D dannygilbert3

    Thank you very much, I will try it. :) Danny Gilbert, enginneer Montréal, Canada

    Visual Basic database docker tutorial question announcement

  • Datagrid, DataSet
    D dannygilbert3

    In the present code, we use a datagrid as a container to print data from a SQL database. The following gets data (via ODBC) in the SQL database and save it in a DATASET. Public Function GetDatasetGiveSql(ByVal sqlCmd As String) As DataSet Dim dataset As New DataSet odbcCmd.Connection.Close() odbcCmd = New Odbc.OdbcCommand(sqlCmd, odbcConnection) odbcAdapt = New Odbc.OdbcDataAdapter(odbcCmd) odbcCmd.Connection.Open() odbcAdapt.Fill(dataset) Return dataset End Function Elsewhere in the software, the software builds a query and sends it to the database like this: dsCommand = sql.GetDatasetGiveSql(cmd) DataGridCommand.SetDataBinding(dsCommand, "Table") As you can suspect, dsCommand is a DataSet and DataGridCommand is the DataGrid to update. Easy to date… OK. Question: --------- I want to have control on the background and foreground color of a cell based on some information like any people in this forum. I found many EXAMPLES with DataGridColumnStyle where the idea is to override the Paint method (aka: make a custom datagrid control). Yes, Perfect. I understand it BUT in this case… I DON’T CONTROL ANY COLUMN in the datagrid. It seems that the SetDataBinding() does everything by itself, it is magic. I did not find HOW to OVERRIDE the Paint() method of this datagrid. Maybe I don’t understand something ! :^) Danny Gilbert, enginneer Montréal, Canada Danny Gilbert, enginneer Montréal, Canada

    Visual Basic database docker tutorial question announcement

  • Datagrid, DataSet
    D dannygilbert3

    Hi folks ! In the present code, we use a datagrid as a container to print data from a SQL database. The following gets data (via ODBC) in the SQL database and save it in a DATASET. Public Function GetDatasetGiveSql(ByVal sqlCmd As String) As DataSet Dim dataset As New DataSet odbcCmd.Connection.Close() odbcCmd = New Odbc.OdbcCommand(sqlCmd, odbcConnection) odbcAdapt = New Odbc.OdbcDataAdapter(odbcCmd) odbcCmd.Connection.Open() odbcAdapt.Fill(dataset) Return dataset End Function Elsewhere in the software, the software builds a query and sends it to the database like this: dsCommand = sql.GetDatasetGiveSql(cmd) DataGridCommand.SetDataBinding(dsCommand, "Table") As you can suspect, dsCommand is a DataSet and DataGridCommand is the DataGrid to update. Easy to date… OK. Question: --------- I want to have control on the background and foreground color of a cell based on some information like any people in this forum. I found many EXAMPLES with DataGridColumnStyle where the idea is to override the Paint method (aka: make a custom datagrid control). Yes, Perfect. I understand it BUT in this case… I DON’T CONTROL ANY COLUMN in the datagrid. It seems that the SetDataBinding() does everything by itself, it is magic. I did not find HOW to OVERRIDE the Paint() method of this datagrid. Maybe I don’t understand something ! :^) Danny Gilbert, enginneer Montréal, Canada -- modified at 13:44 Wednesday 19th April, 2006

    Visual Basic database docker tutorial question announcement

  • C# IrDA communication between Pocket-PC and MCP-2155.
    D dannygilbert3

    Hi ! I am looking for someone who have programmed Irda commnunication port between a Pocket-PC and the Microchip MCP2155. I have found some articles in C++ and some other in C# that doesn't work very well. I can establish the communication but the transfer of good data is hard to achieve. Visual Studio 2005, Compact Framework 2.0. Is there any problem with the new Compact Framework ? Thank you a lot ! Danny Gilbert, enginneer Montréal, Canada

    C# csharp c++ visual-studio mcp help

  • Disable context menu in some columns of a dataGrid
    D dannygilbert3

    Hi ! I have a Context Menu associated with my datagrid and I want to remove it or disable some menu option depending on which column the user Right Click (to show the context menu). Thank you ! :) Danny Gilbert Montréal, Canada

    C#

  • DataGrid change any row color ( C# )
    D dannygilbert3

    Thank you ! Now I understand more things. I do something like your proposal for any control... overriding the paint method for any control. Thanks again !:-D Danny Gilbert Montréal, Canada

    C# csharp asp-net help tutorial

  • DataGrid change any row color ( C# )
    D dannygilbert3

    Hi ! I found many snippets (samples) of code on the web but every one is for C# with ASP.NET or written in VB.NET. My application is not WEB based but a normal Windows Form with a dataGrid (windows application). Sometime I want to change the background and foreground color of a row depending of some condition (NOT the SELECTED row). I understand the idea of using the databinding event (which is supposed to be throw at each Rows.Add()) but I still have problem with my code. Maybe I don`t really know how to use event. The other idea is to modify the Paint function (I am not very confident with this). Can somebody show me a sample !!! :sigh: Thank you very much ! Danny Gilbert Montréal, Canada

    C# csharp asp-net help tutorial

  • PC104 driver with Windows
    D dannygilbert3

    Hi ! I am looking for an example (sample code) about how to write a PC104 (ISA bus with new hardware form factor for embedded system) for Windows OS. Any windows can do the work. Windows XP Embedded, Windows CE or Windows 98. I am new in driver design. I understand the WDM model but I saw that we cannot (or is very difficult) to design a driver (based on WDM) for ISA bus (or PC104) because it is not PNP. Some site suggest NT4 kernel mode driver. What to do ??? Another thing, I know that writting driver for WinCE is different than other Windows Driver. Thanks a lot.:wtf: Danny Gilbert Montréal, Canada

    Mobile hardware tutorial design question

  • PC104 driver with Windows
    D dannygilbert3

    Hi ! I am looking for an example (sample code) about how to write a PC104 (ISA bus with new hardware form factor for embedded system) for Windows OS. Any windows can do the work. Windows XP Embedded, Windows CE or Windows 98. I am new in driver design. I understand the WDM model but I saw that we cannot (or is very difficult) to design a driver (based on WDM) for ISA bus (or PC104) because it is not PNP. Some site suggest NT4 kernel mode driver. What to do ??? Another thing, I know that writting driver for WinCE is different than other Windows Driver. Thanks a lot.:wtf: Danny Gilbert Montréal, Canada

    Hardware & Devices hardware tutorial design question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups