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
G

Greg Ellis

@Greg Ellis
About
Posts
27
Topics
16
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to stop CComboBox from interrupting thread?
    G Greg Ellis

    I using PostMessage to send a user defined message on the main GUI thread which then calls SetWindowText on the static control that I am using for a counter. From what I have read this is the only safe way to update the GUI From a separate thread. I am still lost on why the dropping down of the combo box would interrupt the drawing of my counter control.

    C / C++ / MFC question help tutorial announcement

  • How to stop CComboBox from interrupting thread?
    G Greg Ellis

    Hi, I have noticed a problem in windows programming that I am unable to solve. I have created a new thread which should run as a separate process. In this thread I continually update a counter so that I Can visually see if and when my thread is interrupted. If I put a CComboBox control on my dialog my thread is momentarily interrupted when the CComboBox is clicked and the list drops down. I have tried creating my thread with realtime priority and the combobox still interrupts my thread when dropped down. Obviously the dropping down of the combobox does not interrupt other applications that are running in separate processes so I do not understand why it would interrupt my thread. unsigned threadID; HANDLE hThread = (HANDLE)_beginthreadex( NULL, 0, &UpdateThread, (void*)this, 0, &threadID ); SetPriorityClass(hThread, HIGH_PRIORITY_CLASS); SetThreadPriority(hThread, THREAD_PRIORITY_TIME_CRITICAL); How can I create a thread that will not be interrupted by the dropping down of the combobox? Thanks, Greg

    C / C++ / MFC question help tutorial announcement

  • win32 dll in visual studio 6.0 VS visual studio 2005/2008 questions
    G Greg Ellis

    Hi Guys, I am wondering if anyone can give me the scoop on this. I am developing a dll file and I have some very good developers telling me that if I develop the dll in Visual Studio 2005/2008 in win32 unmanaged c++ that the dll will not work on win98/me and that it will be dependant on MSVCP80.DLL. They tell me that if I develop the dll in Visual Studio 6.0 that it will work on older operating systems like win98/me and it wont be dependant on MSVCP80.DLL. Now is this true? and if so is there anyway that I can develop the dll using visual studio 2005/2008 so that it will still work on win98/me and NOT be dependant on MSVCP80.DLL? Thanks, Greg

    C / C++ / MFC visual-studio csharp c++ question

  • If I build a Win32 Application in vs 2005 or 2008 it has no dependencies correct?
    G Greg Ellis

    Thank you very much! :)

    C / C++ / MFC visual-studio csharp c++ question workspace

  • If I build a Win32 Application in vs 2005 or 2008 it has no dependencies correct?
    G Greg Ellis

    Hey Guys, I have always used MFC, but now that I have upgraded to visual studio 2005 and 2008 I am forced to use MSI installers due to the depencies on the new merge modules. I really don't like the msi installer I think it's horrible and I would rather use inno setup or the old wise installer. I just want to be sure.... If I was to start writing all my code in a pure Win32 Application from vs 2005 or 2008 I would no longer require the vcredist files in order to run my applications correct? Thanks, Greg

    C / C++ / MFC visual-studio csharp c++ question workspace

  • GDI or GDI+ from worker thread safely?
    G Greg Ellis

    Oh cool, so I can actually safely use GDI calls to draw on an offscreen device context from directly within the thread so long as I dont do anything with an actual windows control? Then just update the actual windows control from the main thread?

    modified on Wednesday, February 27, 2008 11:41 AM

    C / C++ / MFC graphics mobile winforms design game-dev

  • GDI or GDI+ from worker thread safely?
    G Greg Ellis

    Hey guys, I have an application where I need to keep the UI responsive while background tasks are running. I currently have worker thread that does a PostMessage to a handler that does my GDI drawing, but the problem is that if too many things are happening the message pump gets held up and therefor my UI drawing is not smooth at times. If there was some way I could just do my GDI or GDI+ drawing directly from the worker thread I know that would solve my problems and my UI would be responsive. Is there anyway I can do my drawing directly from a woker thread safely using either GDI, GDI+, or even DirectX? any way at all?

    C / C++ / MFC graphics mobile winforms design game-dev

  • How do I give my c# app access to eventlog?
    G Greg Ellis

    Well I don't see anything in there that explains why this code works with no problems on my windows vista, windows xp, and windows 2000 machines when run with administrator priviledges, but not on my windows server 2003 box with admin privilges. I guess they left that part out. :\

    C# question csharp

  • How do I give my c# app access to eventlog?
    G Greg Ellis

    Hi, I am new to writing windows services with c#. I wrote a windows service that writes to the event log using this code EventLog.WriteEntry(ServiceName + " Service started"); Whenever my service starts it stops stating that it failed due to not having permissions to write to the event log. How can I make sure my windows service has the proper permissions to write the Event Log? Thanks, Greg

    C# question csharp

  • CStatic drawing interrupted... Worker, UI Threads????
    G Greg Ellis

    Basically I have two music files playing (video and/or audio) I am showing a scrolling waveform as the song is playing in realtime (using GDI). I need this waveform to always scroll. When loading a file into the second player while the first player is playing the scrolling waveform is being interrupted. I just need that waveform to always be scrolling. So MFC always draws from the main thread no matter what? That's no good for me. Is my only option UI threads?

    C / C++ / MFC graphics design c++ question announcement

  • CStatic drawing interrupted... Worker, UI Threads????
    G Greg Ellis

    Hey Guys, I have an MFC CStatic derived class that has a public member function Draw();. Draw uses GDI to draw stuff to the CStatic window. I call this Draw method from a multimedia timer (timeSetEvent) to continually update the display. My problems is that When my main app is doing a lot of work the drawing is sometimes interrupted when I load files. So I put the lengthy process of loading files in a worker thread, but the drawing is still "jerky" when loading a file. Is there anything else I can do to ensure that my CStatic is always drawing? Is this something I need a user interface thread for? Thanks, Greg

    C / C++ / MFC graphics design c++ question announcement

  • How to do new CArray???
    G Greg Ellis

    ok, but I need to dynamically allocate memory so I wanted to be able to use realloc. Is there a realloc equivilent for new? Thanks

    C / C++ / MFC help csharp c++ visual-studio tutorial

  • How to do new CArray???
    G Greg Ellis

    Yep I have, I am not merely trying to use a CArray I am trying to create a pointer to an array of CArray's. It won't let me do it using malloc for some reason.

    C / C++ / MFC help csharp c++ visual-studio tutorial

  • How to do new CArray???
    G Greg Ellis

    Hi Guys, I am having a problem creating a pointer to a CArray structure; CArray<CBackground*, CBackground*>* m_paryBackground; int nNewSize = 2; m_paryBackground = (CArray<CBackground*, CBackground*>*)malloc(nNewSize * sizeof(CArray<CBackground*, CBackground*>*)); m_paryBackground[0] = new CArray<CBackground*, CBackground*>; m_paryBackground[1] = new CArray<CBackground*, CBackground*>; This does not work for some reason. I get a compile time error saying it cannot cast to the m_paryBackground variable. Does anyone know how I can do this properly? I'm using MFC 7 visual studio 2005 Cheers, Greg

    C / C++ / MFC help csharp c++ visual-studio tutorial

  • How to convert CString to int MFC 7.1
    G Greg Ellis

    Hi Guys, I am trying to convert a CString to an int in an MFC 7.1 unicode project, but it wont work. Here is what I tried. CString cszNumber = "1234567"; int nNumber = atoi(cszNumber); That didn't compile so I tried this CString cszNumber = "1234567"; int nNumber = _ttoi(cszNumber.GetBuffer(0)); That only brought across the first digit. Any Ideas? This method used to work fine in my old non unicode MFC 6 project. Cheers, Greg

    C / C++ / MFC

  • MFC 7 in studio 2005, #region possible?
    G Greg Ellis

    Thank you so much, that was it!!! Cheers, Greg

    C / C++ / MFC c++ question csharp visual-studio

  • MFC 7 in studio 2005, #region possible?
    G Greg Ellis

    HI All, Is it possible to use #region in MFC 7 (unmanaged c++) in visual studio 2005? If so how do I do that? Cheers, Greg

    C / C++ / MFC c++ question csharp visual-studio

  • Fast keyword Search through CSortedArray?? anyone?
    G Greg Ellis

    ah ok thank you! Do you know if there is any examples of where I can find how to do this? Thanks, Greg

    C / C++ / MFC help data-structures regex tutorial question

  • Fast keyword Search through CSortedArray?? anyone?
    G Greg Ellis

    Hi There, I have a virtual listview that I load up anywhere from 20,000 to 200,000 records into. The virtual listview handles this no problem at all. I am using the CSortedArray by PJ Naughter class to store a array of custom objects. I can sort the array very fast no problems. My issue occurs when I have to do a keyword search. I have to be able to allow the user to search as they type into a text box. So the user starts off with a FULL list of ALL the items appearing in the virtual listview, as the type keys into the textbox the virtual listview starts drilling down and only showing items that have the letters being typed in the name. so simple example: List ==== Greg John Steve George If the user types G in the text box the list will now look like below List ==== Greg George I have this working using a simple for loop to loop through all the items at each keystroke and remove any items from the list that do not match the keys typed. However, when my list gets to 30,000 or higher the search begins to take up WAY too much CPU. Is there some faster way I can do search like this using the CSortedArry? Thanks Greg

    C / C++ / MFC help data-structures regex tutorial question

  • Screen Capture Image bit depth question.. [modified]
    G Greg Ellis

    Hey Guys, I have a c# application that uses win32 code to take a screencapture of a window running on the system. It then compares a portion of that screencapture with a bitmap that I have already pre-captured to see if that window is in a certain state. When I first wrote the code it compared no problem, but now when I use it the two images are not EXACTLY the same. My application captured the right part of the graphic, but when I compared both images (by zooming in in photoshop) they are not the same. Looks like the screencapture was worse quality. I saved the image I compare to as a Windows Bitmap 24 bit and the image I capture I am not sure what quality it is. Although my screen resolution is 32 bit. Is there someway that I can make sure that the image I capture and the image I compare to are the same bit depth and quality using c#? Here is some code I have public static Bitmap GetWindowCaptureAsBitmap(int handle) { #region GetWindowCaptureAsBitmap IntPtr hWnd = new IntPtr(handle); Win32.Rect rc = new Win32.Rect(); if (!Win32.GetWindowRect(hWnd, ref rc)) return null; // create a bitmap from the visible clipping bounds of //the graphics object from the **window** Bitmap bitmap = new Bitmap(rc.Width, rc.Height); // create a graphics object from the bitmap Graphics gfxBitmap = Graphics.FromImage(bitmap); // get a device context for the bitmap IntPtr hdcBitmap = gfxBitmap.GetHdc(); // get a device context for the **window** IntPtr hdcWindow = Win32.GetWindowDC(hWnd); // bitblt the **window** to the bitmap Win32.BitBlt(hdcBitmap, 0, 0, rc.Width, rc.Height, hdcWindow, 0, 0, (int)Win32.TernaryRasterOperations.SRCCOPY); // release the bitmap's device context gfxBitmap.ReleaseHdc(hdcBitmap); Win32.ReleaseDC(hWnd, hdcWindow); // dispose of the bitmap's graphics object gfxBitmap.Dispose(); // return the bitmap of the **window** return bitmap; #endregion } private bool IsPlayersTurn(Image imgScreen) {

    C# graphics question csharp adobe help
  • Login

  • Don't have an account? Register

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