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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
F

FISH786

@FISH786
About
Posts
146
Topics
38
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • HWND of a control. [modified]
    F FISH786

    Thank you.

    C / C++ / MFC question help

  • HWND of a control. [modified]
    F FISH786

    //This gives me HWND to the external app HWND hWnd = ::FindWindow(NULL, "TEST"); From hWnd, how do i get the HWND for a picture control in that application? From Spy I get "Window 000406F2 "" Static" It has a control id of 000003E8 Can someone please help? Thanks a million.

    modified on Sunday, August 23, 2009 9:36 AM

    C / C++ / MFC question help

  • Exception Error.
    F FISH786

    I am getting it in disassembly.

    C / C++ / MFC help c++ debugging

  • Exception Error.
    F FISH786

    I did 3 different projects and with all I did a rebuild.. thinking of the same thing?

    C / C++ / MFC help c++ debugging

  • Compiler / Linker settings.
    F FISH786

    I am sorry I am not trying to be a pain. :(( This is frustratung me... Here is what I did...Any suggetions... On a different machine i went down in versions..from 2008-2005-and finally to VStudio 6. I used the same steps in all ..I got the same exception error except in Vstudio 6..Where I got no exception error...Imported the same project into my Visual Studio 2008 and it works fine...No First-chance error. I am not sure what to do? :(( ...Well for now I can work with this imported project...but is this really a solution?...I have come to the end of the rope on this one...If I did something wrong, would VStudio 6 not complain as well? Do you think you can advice me as what to do? I don't like to give up, at the sametime I don't want to be hitting my head if it is a bug in VStudio 2008? I can't see me to be the only one trying or using the property sheet based application? Thanks, I will really appreciate some sort of feed back, I am new at this and it's frustrating me..Please advice. :)

    C / C++ / MFC tutorial question

  • Exception Error.
    F FISH786

    I am sorry I am not trying to be a pain. This is frustratung me... Here is what I did...Any suggetions... On a different machine i went down in versions..from 2008-2005-and finally to VStudio 6. I used the same steps in all ..I got the same exception error except in Vstudio 6..Where I got no exception error...Imported the same project into my Visual Studio 2008 and it works fine...No First-chance error. I am not sure what to do?...Well for now I can work with this imported project...but is this really a solution?...I have come to the end of the rope on this one...If I did something wrong, would VStudio 6 not complain as well? Do you think you can advice me as what to do? I don't like to give up, at the sametime I don't want to be hitting my head if it is a bug in VStudio 2008? I can't see me to be the only one trying or using the property sheet based application? Thanks, I will really appreciate some sort of feed back, I am new at this and it's frustrating me..Please advice.

    C / C++ / MFC help c++ debugging

  • Exception Error.
    F FISH786

    [http://msdn.microsoft.com/en-us/library/0bw65cxb(VS.80).aspx](<a href=)[^]"> This article states to ignore the return value from the CPropertySheet Class, unless I mis-understood it. Does that mean I ignore the exception as well?

    C / C++ / MFC help c++ debugging

  • Compiler / Linker settings.
    F FISH786

    in debug before I go here no exception error: BOOL bResult = CPropertySheet::OnInitDialog(); I get the error inside this...

    C / C++ / MFC tutorial question

  • Compiler / Linker settings.
    F FISH786

    Thank you. I am trying to follow some intructions on how to create Property sheet based application. When I compile and run in degug mode I get: I am getting First-chance exception at 0x5d0c373e in LastTry.exe: 0xC0000005: Access violation writing location 0x00416e8c. In debug mode however when i exit I get a The program '[3124] LastTry.exe: Native' has exited with code 0 (0x0). I was able to get the original source code from the demo site. When I compiled that and ran it. There was no exception. There is one line in my stdafx.h which is not in the original source code. It is to do with : #include <afxcontrolbars.h> // MFC support for ribbons and control bars How do I resolve this issue? I have tried to comment the above line obviously gives me more compile errors. What could I have done wrong? Or is it something that was not right in my install of VStudio 2008?

    C / C++ / MFC tutorial question

  • Compiler / Linker settings.
    F FISH786

    Is it possible to copy settings from one project to the other. If so how to do it?

    C / C++ / MFC tutorial question

  • Exception Error.
    F FISH786

    This is where i am stuck in the debgugger. Not sure whats happening?

    BOOL AFXAPI AfxDeactivateActCtx(DWORD dwFlags, ULONG_PTR ulCookie)
    {
    BOOL rc = pfnDeactivateActCtx != 0 ? pfnDeactivateActCtx(dwFlags, ulCookie) : FALSE;
    return rc;
    }

    Why would it exit with a 0 if I haven't changed anything else in the code? Would it not give me a memory leak or something?

    C / C++ / MFC help c++ debugging

  • Exception Error.
    F FISH786

    Can Someone help I am not sure whats wrong. I am getting the following debug message: First-chance exception at 0x5d0c373e in Capture Data.exe: 0xC0000005: Access violation writing location 0x0043454c. However on exit I get: The program '[1284] Capture Data.exe: Native' has exited with code 0 (0x0). Here is the code I have used:

    BOOL CCaptureDataApp::InitInstance()
    {
    InitCommonControls();
    CWinApp::InitInstance();
    CCaptureDataSheet sheet("My Very Own Property Sheet App",NULL,0);
    sheet.m_psh.dwFlags |= PSH_NOAPPLYNOW;//hide apply button
    m_pMainWnd=&sheet;
    INT_PTR nResponse=sheet.DoModal();
    return FALSE;

    In the Capture Data Sheet

    IMPLEMENT_DYNAMIC(CCaptureDataSheet, CPropertySheet)
    CCaptureDataSheet::CCaptureDataSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
    :CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
    {
    AddPage(&m_Page01);
    AddPage(&m_Page02);
    }

    CCaptureDataSheet::CCaptureDataSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
    :CPropertySheet(pszCaption, pParentWnd, iSelectPage)
    {
    AddPage(&m_Page01);
    AddPage(&m_Page02);
    }

    CCaptureDataSheet::~CCaptureDataSheet()
    {
    }
    BOOL CCaptureDataSheet::OnInitDialog()
    {
    BOOL bResult = CPropertySheet::OnInitDialog();
    }

    C / C++ / MFC help c++ debugging

  • Help with threads
    F FISH786

    According to the article. The array I pass of handles to the WaitMultipleObjects should take care of that for me.

    C / C++ / MFC help com data-structures json

  • Help with threads
    F FISH786

    Thank you for the feedback. I appreciate the honesty. I will check on the article and work my way from there. thanks a million.

    C / C++ / MFC help com data-structures json

  • Help with threads
    F FISH786

    I am trying to follow this: [Creating Threads using the CreateThread() API](<a href=)[^]"> However I am having an issue, My thread is still running even though the main process id done. What I am trying to achive is a loop to create threads and wait for all the threads to finish the process before I run the same process again. My Issue is I get a message to say my loop is done, however the thread is still running. Could someone please shed some light.

    DWORD WINAPI Thread_1(LPVOID lpParam)
    {
    int a =0;
    char Temp[256];
    THREADDATA* pData = (THREADDATA*) lpParam;
    UINT nEid = pData->nEditId;
    CThreadDemoDlg* pDlg = pData->pObjDlg;
    for (a = 0;a<20;a++)
    {
    _itoa_s(a,Temp,sizeof(Temp),10);
    pDlg->SetDlgItemText(nEid,Temp);
    ProcessMessages();
    }
    return 0;
    }

    DWORD WINAPI Thread_2(LPVOID lpParam)
    {
    int a =0;
    char Temp[256];
    THREADDATA* pData = (THREADDATA*) lpParam;
    UINT nEid = pData->nEditId;
    CThreadDemoDlg* pDlg = pData->pObjDlg;
    for (a = 0;a<20;a++)
    {
    _itoa_s(a+1,Temp,sizeof(Temp),10);
    pDlg->SetDlgItemText(nEid,Temp);
    Sleep(1000);
    ProcessMessages();
    }
    return 0;
    }

    TD1->pObjDlg = this;
    TD2->pObjDlg = this;
    TD1->nEditId = IDC_STATIC1;
    TD2->nEditId = IDC_STATIC2;

    HANDLE hThread_1;
    HANDLE hThread_2;

    HANDLE Array_Thread[2];

    for (x=0 x<10;x++)
    {
    hThread_1 = CreateThread(NULL,0,Thread_1,TD1,0,NULL);
    if (hThread_1 == NULL)
    ExitProcess(-1);
    hThread_2 = CreateThread(NULL,0,Thread_2,TD2,0,NULL);
    if (hThread_2 == NULL)
    ExitProcess(-1);
    ProcessMessages();
    x++;
    _itoa_s(f,Temp,sizeof(Temp),10);
    SetDlgItemText(IDC_Main,Temp);
    Array_Thread[0]= hThread_1;
    Array_Thread[1]= hThread_2;

        WaitForMultipleObjects(2,Array\_Thread,TRUE,INFINITE);
        CloseHandle(hThread\_1);
        CloseHandle(hThread\_2);
        //The aim is to wait for the unctions to finish before any of the threads start again
    

    }
    MessageBox("Done","Information",MB_OKCANCEL);

    I get the messagebox, however the The second thread is still running.

    C / C++ / MFC help com data-structures json

  • What does this mean?
    F FISH786

    I get this when I am exiting my application which is property sheet based? So why on Exit and not before?

    C / C++ / MFC debugging question

  • What does this mean?
    F FISH786

    Yes I did.

    C / C++ / MFC debugging question

  • What does this mean?
    F FISH786

    What does this message mean in a debug mode? First-chance exception at 0x5d0c373e in DemoKey.exe: 0xC0000005: Access violation writing location 0x004456ec. I get this when I am exiting my application which is property sheet based? :confused:What have I not done before exiting the application or is it Normal? Thank in advance

    C / C++ / MFC debugging question

  • How to differenciate?
    F FISH786

    Thanks again. which is what I thought but wanted to be sure. I guess back to debugging and find out why I can't get the data from the second window. However, I should be able to use the same thread and pass the handle as a parameter? or am I better off creating multiple threads and dedicate each thread to a window for the lifetime of that particular window?

    C / C++ / MFC tutorial help question

  • How to differenciate?
    F FISH786

    Hello, I am trying to capture a window from an external App Example Calculator. I am able to get the handle of the window. If the user opens a second instance, I am able to get that handle too using EnumWindows. Which means I have 2 handles for the 2 calculators. Short of using the Handle is there anything else that I could use to differenciate the 2 windows. I can't use the window title since they are both the same. Reason for asking: I know the handle gets reused, but is it possible for the handle to change after the window has been created or does it stay the same after creation? Yes, if I close the window, I know I will not get the same handle. Is it possible that If the user minimizes the window and activates it again, we get a new handle? If the handle changes during the lifetime of the window whats the best way of keeping track of that window? I have created a thread and am using the same function to handle capturing data from the 2 windows by passing the handle as a parameter. However, I can only get the data from one of the windows, or am I better off creating multiple threads which is what I was avoiding? Could someone please help.

    C / C++ / MFC tutorial help 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