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
T

timbk

@timbk
About
Posts
50
Topics
16
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Wich is the best way to launch/run an externall .exe app form vc++6 ?
    T timbk

    Well no much more to add, that's the question : Wich is the best way to launch/run an externall .exe app form vc++6 ? When I say the best I'm thinking in the best balance between simplicity and functionality. Thanks in advance. Any examples if it's possible.

    C / C++ / MFC question c++

  • How to bring an App to front, from another App
    T timbk

    Now i get these error messages from compiler:

    error C2065: 'GetProcessID' : undeclared identifier
    error C2065: 'hInstace' : undeclared identifier

    I can't find a the equivalent instruction in VC++6 for GetProcessID

    C / C++ / MFC question c++ tutorial

  • How to bring an App to front, from another App
    T timbk

    Ok, it's working for the app1 that I know his title, let say from the "Switcher" app it's possible bring the other app1(the one i know his title) behind the Switcher, but with the other app2 , (wich is no-modal dialog) it doesn't work , i do not know the name of his class and the dialog it has not title, so i went whith the code that you wrote, but compiler complains with ProcIDFromWnd, it says that is undeclared identifier, it seems that is not a valid intruction for VC++ 6 , ?? Anyway , since in the final projet will be runnig only these three apps, i thoth that the Switcher can bring the app 1(the one working) behind it and send it to bottom when the user wants to see the app2, mfc library says that it's possible to use the parameter HWND_BOTTOM instead hWndSwitcher in SetWindowPos(hWndTarget, hWndSwitcher, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); to do that, but it's doesn't work neither. What do you think?

    C / C++ / MFC question c++ tutorial

  • How to bring an App to front, from another App
    T timbk

    Thanks, So I have to use this instruccion SetWindowPos(targetWindow, switcherHandle, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); on my "Switcher" dialog, ok, my last doubt is how can I get the handler to the target window from the "Switcher" dialog?

    C / C++ / MFC question c++ tutorial

  • How to bring an App to front, from another App
    T timbk

    Hello , I'm programing in VC++ 6, and the entire project runs in a computer without keyboard but with touch screen. The thing is that a have two app runnig at the same time, and I want the user to be able to switch between these apps by touching in a third app (called "Switcher",wich is always on top), this third app is a dialog based app, dialog's size is small and it has only two buttons, one for bring the first app to front and the other button to bring to the second app. The project has to run over win 98 an over win XP. How can i do to get wich app is The "Switcher" and bring the other to front but under the "switcher"?

    C / C++ / MFC question c++ tutorial

  • how to Read/Write to a file a structure wich contains Cstring ?
    T timbk

    Ok, thanks , i will check it, very usefull. But for the other data types is it ok to save data i as described before? , I mean pherhaps is not the elegant way but it's working (not with CString), as I have to finish this work for tomorrow I was hoping there was a easier way, I only have to store some few words.

    C / C++ / MFC tutorial question

  • how to Read/Write to a file a structure wich contains Cstring ?
    T timbk

    Hello, I have to Write/read a file with a structure wich contains CString data, if drop out the CString data from the structure it works but if I left the CString data the program crashes when attemps to read. Here the structure

    struct MyStructure
    {
    CString label//For others data types char, BYTE, etc it works but for CString it doesn't
    unsignet char data1
    BYTE data2
    }

    the writing

    struct MyStructure Estructura;
    CFile FileConfig;              
    

    FileConfig.Open("ROMconfig.dat",CFile::modeCreate|CFile::modeNoTruncate|CFile::modeWrite);
    FileConfig.Seek(0,CFile::begin);
    FileConfig.Write(&Estructura,sizeof(Estructura));
    FileConfig.Close();

    the reading

    struct MyStructure Estructura;
    CFile FileConfig ;		  
    

    FileConfig.Open("ROMconfig.dat",CFile::modeCreate|CFile::modeNoTruncate|CFile::modeRead);
    FileConfig.Seek(0,CFile::begin);
    FileConfig.Read(&Estructura,sizeof(Estructura));
    FileConfig.Close();

    What I'm doing wrong, may be is something in relation with CString size, but I'm not sure. And the file has to be a .dat file because is modification to an older application.

    C / C++ / MFC tutorial question

  • User defined message , exeption at the handler return [modified]
    T timbk

    The ecxeption is a first chance exception :First-chance exception in MyApp.exe (MFC42D.DLL): 0xC0000005: Access Violation. The app runs without any exception, but after the PostMessage is sent to the parent dialog , the child dialog do some things wrong , dones't work fine, but there isn't any errors messages.

    C / C++ / MFC help c++

  • User defined message , exeption at the handler return [modified]
    T timbk

    When the exception comes up, i have this debug log:

    Loaded 'ntdll.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\inpout32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\secur32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\MFC42D.DLL', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\MSVCRTD.DLL', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
    Loaded symbols for 'C:\WINDOWS\system32\MFCO42D.DLL'
    Loaded 'C:\WINDOWS\system32\imm32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\mfc42loc.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\comctl32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\shlwapi.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\uxtheme.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\MSCTF.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\MSCTFIME.IME', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\ole32.dll', no matching symbolic information found.
    Loaded 'C:\Archivos de programa\Internet Download Manager\idmmkb.dll', no matching symbolic information found.
    Warning: dialog data checkbox value (2117840950) out of range. //I can't find why , all checkboxes seems ok.
    Warning: dialog data checkbox value (1598735280) out of range. //I can't find why , all checkboxes seems ok
    First-chance exception in Calibracion.exe (MFC42D.DLL): 0xC0000005: Access Violation.

    Look at the warnings about checkboxes , there were a lot more , but once i saved the file generated by Myapp, all these checkboxes warnings desappeared , but these two not, i can't find them. Another thing , when the exception comes up the debugger jumps to a asembler code :

    5F430BE2 call dword ptr [eax+98h] // jump to this line.
    5F430BE8 test eax,eax
    5F4

    C / C++ / MFC help c++

  • User defined message , exeption at the handler return [modified]
    T timbk

    «_Superman_» wrote:

    Use WM_APP + 1 instead of WM_USER + 1.

    Thanks for your answer, I did what you said, but i get the same exception.

    C / C++ / MFC help c++

  • User defined message , exeption at the handler return [modified]
    T timbk

    Maximilien wrote:

    timbk wrote: afx_msg void OnMsjGuardarConfig(); shouldn't that be : LRESULT OnMsjGuardarConfig(WPARAM wParam, LPARAM lParam);

    Ok , I tried with this:

    LRESULT OnMsjGuardarConfig(WPARAM wParam, LPARAM lParam);

    instead of

    afx_msg LRESULT OnMsjGuardarConfig(WPARAM wParam, LPARAM lParam);

    and besides :

    afx_msg void OnMsjGuardarConfig();

    instead of

    afx_msg void OnMsjGuardarConfig();

    Is this what you meant? No erros compiling, but I get the same exception.

    C / C++ / MFC help c++

  • User defined message , exeption at the handler return [modified]
    T timbk

    Cool_Dev wrote:

    timbk wrote: //i do some stuffs what are the stuffs you do there?

    At the moment nothing , all code inside es comented, so this is how it looks now:

    LRESULT CCalibracionDlg::OnMsjGuardarConfig(WPARAM wParam, LPARAM lParam)
    {
    return 0; // ==> here is the exception !!
    }

    Cool_Dev wrote:

    timbk wrote: afx_msg void OnMsjGuardarConfig(); what is this meant for, though it may not be the reason for your problem.?

    I'm not sure to understand very weel this question, but anyway , this piece of code that you quote is in the header file of parent dialog let say's MydialogDlg.h :

            .
            .
    

    protected:
    HICON m_hIcon;

    // Generated message map functions
    //{{AFX\_MSG(CCalibracionDlg)
            .
            .           
    afx\_msg void OnSetfocusEditSens7();
    afx\_msg void OnSetfocusEditSens8();
    afx\_msg void OnConfiguracion();
    afx\_msg void OnMsjGuardarConfig();
            .
            .
        //}}AFX\_MSG
    DECLARE\_MESSAGE\_MAP()
    
    C / C++ / MFC help c++

  • User defined message , exeption at the handler return [modified]
    T timbk

    Hello, Im using a dialog based app (VC++ 6), with a main dialog and his child dialog (modals dialogs). And i have to use a user defined message to send a message to the parent dialog. When i'm debugging, in the handler of this message (in the parent dialog) i get this exception in the return sentence "Unhandled exception in Myapp.exe (MFC42D.DLL):0xc0000005: Acces Violation Parent dialog header, declaration of Handler:

           .
           .	
    afx\_msg LRESULT OnMsjGuardarConfig(WPARAM wParam, LPARAM lParam);
           .
           .
    

    Parent dialog header, Declared Mesagge map:

           .
           .
    afx\_msg void OnMsjGuardarConfig();
           .
           .
    

    Parent dialog source, file Message map:

           .
           .
    ON\_MESSAGE(WM\_MsjGuardarConfig, OnMsjGuardarConfig)
           .
           .
    

    Parent dialog source, file definition of the handler:

    LRESULT CCalibracionDlg::OnMsjGuardarConfig(WPARAM wParam, LPARAM lParam)
    {
    //i do some stuffs
    return 0; // ==> here is exception !!!!
    }

    Defining the user defined message in StdAfx.h:

           .
           .
    

    #define WM_MsjGuardarConfig WM_USER+1 //
    .
    .

    Posting the message in the child dialog:

    void CConfiguracionDlg::OnBUTTONGuadar()
    {
    GetParent()->;PostMessage(WM_MsjGuardarConfig,NULL,NULL); //
    }

    Probably is some newbie problem , but i can't fix it until now. :( Thanks in advance!!

    modified on Friday, December 10, 2010 10:25 AM

    C / C++ / MFC help c++

  • Spin control , it's possible to know when the control is released?
    T timbk

    :-D thanks for your time Code-o-mate :thumbsup:, finally google and 5 hours of work give me the solution, one of them at least. This how it looks now: Header file

    afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);

    Source file Message map

    ON_WM_VSCROLL()

    And handler

    void CCalibracionDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
    {
    if(SB_ENDSCROLL == nSBCode)
    {
    if(pScrollBar->m_hWnd == m_Spin1m_hWnd)
    {
    // the position was not changed, so...
    AfxMessageBox( _T("Termino el Spin1!!!") );
    return;
    }
    if(pScrollBar->m_hWnd == m_Spin2.m_hWnd)
    {
    // the position was not changed, so...
    AfxMessageBox( _T("Termino el Spin2!!!") );
    return;
    }
    }
    }

    C / C++ / MFC question csharp c++

  • Spin control , it's possible to know when the control is released?
    T timbk

    Ok, sorry if my questions are too basics, so I already add the class CMyspin to the proyect as you decribed, and i added a control variable " m_Spin1" of CMySpin type to the spin 1 control , compiled with no errors, so wich is the next step? how can i catch the event of control released?

    C / C++ / MFC question csharp c++

  • Spin control , it's possible to know when the control is released?
    T timbk

    Ok, thanks a lot for your time, yes it's easier in VS2003, but is not my choice to use VC6 , i have to, so i gonna keep searching.

    C / C++ / MFC question csharp c++

  • Spin control , it's possible to know when the control is released?
    T timbk

    Thanks for your answer, ok I've trying, I did this: In the header file CalibracionDlg.h

    afx\_msg void OnDeltaposSPIN1(NMHDR\* pNMHDR, LRESULT\* pResult);
    afx\_msg void OnReleasedCaptureSPIN1(NMHDR\* pNMHDR, LRESULT\* pResult); 
    

    In the source file Calibraciondlg.cpp

    ON\_NOTIFY(UDN\_DELTAPOS, IDC\_SPIN1, OnDeltaposSPIN1)
    ON\_NOTIFY(NM\_RELEASEDCAPTURE, IDC\_SPIN1, OnReleasedCaptureSPIN1)
    

    and the methods

    void CCalibracionDlg::OnDeltaposSPIN1(NMHDR* pNMHDR, LRESULT* pResult)
    {

    NM\_UPDOWN\* pNMUpDown = (NM\_UPDOWN\*)pNMHDR;
    // TODO: Add your control notification handler code here
    //some code
    

    }

    void CCalibracionDlg::OnReleasedCaptureSPIN1(NMHDR* pNMHDR, LRESULT* pResult)
    {
    GetDlgItem(IDC_SPIN1)->EnableWindow(FALSE);//just to see if it works.
    }

    the compiler doesn't show any erros, but when I execute , nothing, when the control is released nothing happens. may be i forgot something?

    C / C++ / MFC question csharp c++

  • Spin control , it's possible to know when the control is released?
    T timbk

    I'm not sure to understand what you mean, perhpas because I'm newbie :( . I looked for ON_NOTIFY and the unique reference is:

    ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN1, OnDeltaposSpin1)

    no references for NM_RELEASEDCAPTURE,of course inside of commctrl.h i can find this line that you posted:

    #define NM_RELEASEDCAPTURE (NM_FIRST-16

    but I don't know what to do with this, can you explain a little more?

    C / C++ / MFC question csharp c++

  • Spin control , it's possible to know when the control is released?
    T timbk

    hello, i'm using vc++ 6 , in my app i need to do some things when the spin control is released, but in vc++6 there is only two events for this control: UDN_DELTAPOS and NM_OUTOFMEMORY, no events for control released, i've been reading that in .net 2003 there is a event NM_RELEASEDCAPTURE in order to do this, but how can i do this in VC++6?

    C / C++ / MFC question csharp c++

  • how to don't allow interruptions in a piece of code in VC++
    T timbk

    there is a thread running in at the same time the main thread, this new thread created for the acquisition is always checking the state of a bit in status register to know when there is a valid data present in data register, so do you think that is not a good idea to set a realtime priority to whole thread? I'm not using interuptions, i dont know how to do this in Win98 , it's possible handling interuptions in Win98??

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