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
Z

zeus_master

@zeus_master
About
Posts
55
Topics
19
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to close all child windows in MDI?
    Z zeus_master

    thank you for your reply. I found anoter function: CDocTemplate* pTemplate = pDocument->GetDocTemplate(); pTemplate->CloseAllDocuments(true); though I don't know the progress of the function.

    C / C++ / MFC tutorial question

  • how to close all child windows in MDI?
    Z zeus_master

    how to close all child windows in MDI? like the VC->windows->Close All command

    C / C++ / MFC tutorial question

  • close all child windows in MDI
    Z zeus_master

    how to close all child windows in MDI? like the VC->windows->Close All:^)

    C / C++ / MFC tutorial question

  • MessageBox Without any Button
    Z zeus_master

    ;Pcreate a dialog, and use time event......

    C / C++ / MFC

  • CTreeCtrl question
    Z zeus_master

    thank you for your quick reply. about 2> in fact, I'v used SetItemData for manage the handle of MDI docs..... what I want is: aplly different doc template for different lay of item related Doc

    C / C++ / MFC tutorial question

  • CTreeCtrl question
    Z zeus_master

    a treectrl such as: [-]Root1 | |_Lay1Item1 | |_Lay1Item2 | [-]Lay1Item3 | |_Lay2Item1 | |_BB +Root2 1>.how to get the item handle by its name/string? 2>.how to know the item stay at which lay? for example: Lay1Item1 stay at lay 1, root is 0,BB is lay 2

    C / C++ / MFC tutorial question

  • MDI with VC6.0 workspace fileview like function
    Z zeus_master

    I set a treeview toolbar in my MDI project. just like the VC++ 6.0 workspace toolbar,Click the item/filename of the fileview, the related file opens and become active. and insert/delete item of the tree, it will new/close the related doc/file . 1.>how to create a new file for the new item ? 2.>when DbclickTree() happens, how to active the related file? 3.>does the files can searched/sort by filename as the treeview item sort? thanks for ur kind help!

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

  • newfile , new window in MDI
    Z zeus_master

    hi,I need your help......

    C / C++ / MFC question

  • newfile , new window in MDI
    Z zeus_master

    what's the difference between file->new and window->newwindow in MDI project(pj name mydoc)? why use file->new, the newfile name is mydoc1(or mydoc2,mydoc3,mydoc4.......) but window->new Window, the new doc name is mydoc1:2 (or mydoc1:3, mydoc1:4, mydoc2:2.......)?

    C / C++ / MFC question

  • New Dialog in a saved .exe
    Z zeus_master

    have you add the #include "resource.h" in you application? in fact, these resource are defined in resource.h.

    C / C++ / MFC c++ help announcement learning

  • the MainFram & FormView in MDI
    Z zeus_master

    Dear VC-master, Thank you for your attention, In my MDI project, the based view is CFormView. named CMyView. the problem is, in CMainFrame class, SetValue()was defined. in CMyView class, public function SetEdit(true)was defined. in myview.cpp, if I use below, it is ok. void CMyView::OnSendValue() { CMainFrame *pMainfram = (CMainFrame *)AfxGetMainWnd(); pMainfram->SetValue(0x55); } but if In MainFrm.cpp void CMainFrame ::OnSendValue() { CMyView *pMyView= (CMyView *)GetActiveView(); pMyView->SetEdit(true); } it can build successfully, but failed execute. how to call the function/variable in active view?

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

  • Reading from Excel
    Z zeus_master

    you can find the CRecordset in the web... it can open the excel as database void CExDlg::OnRead() { // TODO: Add your control notification handler code here CDatabase database; CString sDriver; CString sDsn; CString sFile,sPath; //find the excel in main exe folder GetModuleFileName(NULL,sPath.GetBufferSetLength (MAX_PATH+1),MAX_PATH); sPath.ReleaseBuffer (); int nPos; nPos=sPath.ReverseFind ('\\'); sPath=sPath.Left (nPos); sFile = sPath + "\\Demo.xls"; //name of excel sDsn.Format("ODBC;DRIVER={%s};DSN='';DBQ=%s", sDriver, sFile); TRY { database.Open(NULL, false, false, sDsn); CRecordset recset(&database); CString sSql; sSql = "SELECT item FROM Regt WHERE item = 'iwant' "; // // exe SQL recset.Open(CRecordset::forwardOnly, sSql, CRecordset::readOnly); BYTE line = 1; // »ñÈ¡²éѯ½á¹û while (!recset.IsEOF()) { //¶ÁÈ¡ExcelÄÚ²¿ÊýÖµ recset.GetFieldValue("item", sitem); // read out the item line++; //ÏÔʾ¼ÇÈ¡µÄÄÚÈÝ m_listbox.AddString( sitem); // ÒÆµ½ÏÂÒ»ÐÐ recset.MoveNext(); } // close database.Close(); } CATCH(CDBException, e) { // Êý¾Ý¿â²Ù×÷²úÉúÒ쳣ʱ... AfxMessageBox("error: " + e->m_strError); } END_CATCH; }

    C / C++ / MFC

  • Enable edit control in Dialog access Enter and ESC
    Z zeus_master

    I tried, and failed...... if there is no better methord,I would have to add the edit proc function in PreTranslateMessage() directly...

    C / C++ / MFC help question

  • Enable edit control in Dialog access Enter and ESC
    Z zeus_master

    yes the code below else is where I need your kindly help. if (!GetFocus()->IsKindOf(RUNTIME_CLASS(CEdit))) return true;// do nothing and ignore the key process else { ............... //add proper code for EDIT control capture the Enter and ESC key. }

    C / C++ / MFC help question

  • Enable edit control in Dialog access Enter and ESC
    Z zeus_master

    thank you for you suggestion, Ceric Moonen suggested me also. now the problem is how do single-line Edit control capture the Enter/Esc key.

    C / C++ / MFC help question

  • Enable edit control in Dialog access Enter and ESC
    Z zeus_master

    then, how to handle the enter/esc key for Edit control and buttons? And seems that it doesn't enter into the OnChar() at all.

    C / C++ / MFC help question

  • Enable edit control in Dialog access Enter and ESC
    Z zeus_master

    GetFocus()->IsKindOf(RUNTIME_CLASS(CEdit)) is for checking current focus on Edit control or not. if it is not on edit control, will return and do nothing,if the focus is on edit control, then do what I want to.... -- modified at 4:35 Tuesday 20th June, 2006 By returning true from PreTranslateMessage(...), you are telling your application to bypass any default handling of the message. yes, or it will close the dialog

    C / C++ / MFC help question

  • Enable edit control in Dialog access Enter and ESC
    Z zeus_master

    My edit controls are single-line. in fact, what I want is send a message to Parent window, when the focused edits/buttons get Enter/ESC key.

    C / C++ / MFC help question

  • Enable edit control in Dialog access Enter and ESC
    Z zeus_master

    Surely, the Dialog will close when the Enter and ESC key down. I know reload the PreTranslateMessage(MSG* pMsg) function can avoid the problem. In my project, there are some other controls in the dialog, and I want the Edit controls and buttons can get the Enter/ESC command but not close the Dialog, is there any way? I tried the OnChar(), OnCommad(), there din't work at all. BOOL CEditDlg::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if(pMsg->message==WM_KEYDOWN) { if(pMsg->wParam==VK_RETURN || pMsg->wParam==VK_ESCAPE) { if (!GetFocus()->IsKindOf(RUNTIME_CLASS(CEdit))) return true;// pMsg->wParam=NULL ; else { ............... } } } return CDialog::PreTranslateMessage(pMsg); }

    C / C++ / MFC help question

  • Memory setting for MFC project
    Z zeus_master

    it was impossible that my project would use over 10KB memory...... if I delete the debug folder, and rebuild the project, it seems ok, if I continue to add some class or variable for MFC controls, the error occurs again. some times the error is "Assert" some times is other.....

    C / C++ / MFC c++ debugging performance help tutorial
  • Login

  • Don't have an account? Register

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