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
C

cy163 hotmail com

@cy163 hotmail com
About
Posts
95
Topics
56
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • The correct way to clear a embeded map variable [modified]
    C cy163 hotmail com

    Hi ALL, I am not very sure if I am correct when i clear a embeded map variable.

    map > C1;

    //insert some elements into C1 here

    for(iter1 = C1.begin(); iter1 = C1.end(); iter1++)
    {
    map.swap((*iter1).second);
    }

    map >().swap(C1);

    modified on Saturday, May 28, 2011 10:14 AM

    ATL / WTL / STL

  • resize multiple dimensional vector array in while loop
    C cy163 hotmail com

    Hi ALL, outside a while loop, I declare a 3-D vector array

    vector Psodu;
    Psodu.reserve(10);
    
    vector > > structPersonVar(2, vector >(2,Psodu));
    

    in the while loop, i have to change the size of the array in every iteration. First, I use the following code to release the memory for(int j=0; j < 2; j++) { for(int k =0; k < 2; k++) { vector().swap(structPersonVar[j][k]); } vector >().swap(structPersonVar[j]); } vector > >().swap(structPersonVar); Then, I resize the array

    structPersonVar.resize(20);
    for(j=0; j < 12; j++)
    {
    	structPersonVar\[j\].resize(2);
    	for(int k =0; k < 2; k++)
    	{
    		structPersonVar\[j\]\[k\].reserve(10);	
    	}
    }
    

    I am not very sure whether i am correct by doing in this way,though it works fine with testing program.

    ATL / WTL / STL graphics data-structures testing beta-testing performance

  • How to resize multiple dimensional vector array [modified]
    C cy163 hotmail com

    Hello ALL, Initially, I declare Var[1][1] as

    vector > Var(1, vectort (1));

    later, I want to expand Var to be Var[5][6] How to do this. Thanks

    modified on Monday, April 18, 2011 11:10 AM

    ATL / WTL / STL graphics data-structures tutorial

  • How to show different window layout
    C cy163 hotmail com

    Hi all Recently, I learned how to split a window using CSplitterWnd and OnCreateClient. In my application, I need different window layout (2X2 , 3X3)for different function modules. function modules are invoked by clicking on a menu item. I need to show different layouts when the use calling different function modules. Thanks

    C / C++ / MFC tutorial

  • Using CSplitterWnd OnCreateClient to split window
    C cy163 hotmail com

    Hi All I create a SDI project to implement splitting window using CSplitterWnd and OnCreateClient (VC 6.0). In MainFrm.h, two CSplitterWnd member variables are declared

    public:
    CMySplitter wndSplitter_horizontal;
    CMySplitter wndSplitter_erect;

    In MainFrm.cpp the OnCreateClienct function is as follows

    BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
    {
    // TODO: Add your specialized code here and/or call the base class

    if(wndSplitter_horizontal.CreateStatic(this,2,1)==NULL)
    return FALSE;

    wndSplitter_horizontal.CreateView(0,0,RUNTIME_CLASS(CMonitorTopView),CSize(50,50),pContext);//CMonitorTopView CViewLeft

    if(wndSplitter_erect.CreateStatic(&wndSplitter_horizontal,1,2,WS_CHILD|WS_VISIBLE, wndSplitter_horizontal.IdFromRowCol(1, 0))==NULL)

    return FALSE; 
    

    wndSplitter_erect.CreateView(0,0,RUNTIME_CLASS(CViewRight),CSize(220,220),pContext);//CMonitorRightView

    wndSplitter_erect.CreateView(0,1,RUNTIME_CLASS(CViewRight),CSize(220,220),pContext); //CMonitorRightView

    return TRUE;
    }

    It works fine when a CEditView based view 'CViewRight' or 'CViewLeft' is linked to the pane with CreateView(), but failed when a CFormView based view 'CViewRight_Dlg1111' , 'CMonitorTopView' or 'CMonitorRightView' is linked to the pane, though compiling is successful. 'CViewRight_Dlg1111' is created as follows, (1) First create a dialog resource (IDD_Dlg_1111) (2)Invoke the 'New Class' dialog box Class Type: MFC class Base Class: CFormView Dialog ID: IDD_Dlg_1111 Creating 'CMonitorTopView' and 'CMonitorRightView' follows the same way. Also, I find that the program works fine when classes derived from CEditView, CTreeView, CView are linked to the pane . i do not know why. Please help I would like the program to deploy the multi-pane layout only when the user clicking a menu item, How to do this.

    C / C++ / MFC c++ help tutorial learning

  • #include "testView.h" in MainFrm.cpp [modified]
    C cy163 hotmail com

    I see now. Thanks

    C / C++ / MFC c++ help

  • #include "testView.h" in MainFrm.cpp [modified]
    C cy163 hotmail com

    Thank you for your reply. when I create a SDI project with AppWizard, I notice there are lines in the testView.h file

    public:
    CTestDoc* GetDocument();

    but there is no #include "testDoc.h". The program works fine though. However,when I simply put the line

    #include "testView.h"

    into the MainFrm.cpp file the error message pops up. I think the error message is suppose to occur in the former case.

    C / C++ / MFC c++ help

  • #include "testView.h" in MainFrm.cpp [modified]
    C cy163 hotmail com

    I create a SDI project with VC 6.0. I have to put

    #include "testView.h"

    in the file MainFrm.cpp, since I need to link testView to a splitted window pane using

    wndSplitter_horizontal.CreateView(0,0,RUNTIME_CLASS(CTestView),CSize(50,50),pContext);

    However, the compiler complaint with the following lines.

    d:\vc_project\test\testview.h(27) : error C2143: syntax error : missing ';' before '*'
    d:\vc_project\test\testview.h(27) : error C2501: 'CTestDoc' : missing storage-class or type specifiers
    d:\vc_project\test\testview.h(27) : error C2501: 'GetDocument' : missing storage-class or type specifiers

    The error can be replayed easily by creating a SDI project and typing in the MainFrm.cpp file

    #include "TestView.h"

    i have had a look online, but found no solutions.

    modified on Friday, January 7, 2011 9:18 AM

    C / C++ / MFC c++ help

  • CListCtrl & theCtrl = GetListCtrl
    C cy163 hotmail com

    So, for a view derived from a non CFormView, GetListCtrl is used to get the reference of the ListCtrl associated with it. for a view derived from a CFormView, how to get the references of ListCtrls associated with it. What command should be used.

    C / C++ / MFC tutorial question

  • CListCtrl & theCtrl = GetListCtrl
    C cy163 hotmail com

    If a view is drived from CFormView. How to distinguish between ListCtrls associated with it.

    C / C++ / MFC tutorial question

  • Class CxxxxView:CFormView
    C cy163 hotmail com

    Thanks for your attention on my postinngs and your replyes.

    C / C++ / MFC tutorial

  • CListCtrl & theCtrl = GetListCtrl
    C cy163 hotmail com

    You mean ONLY one ListCtrl can be associated with one view? If so, Why there may be more than one ListCtrl in a dialog Or, I misunderstand the view concept. I think a dialog essentially is a view.

    C / C++ / MFC tutorial question

  • remove unwanted resource VC6
    C cy163 hotmail com

    -------------------------------------------------------------------------------- Hi ALL I created a new dialog resouce. Now I want to remove it from the project. How to do this. Thanks

    C / C++ / MFC tutorial learning

  • CListCtrl & theCtrl = GetListCtrl
    C cy163 hotmail com

    Thanks again. However, what if there are more than one list controls associated with the view.

    C / C++ / MFC tutorial question

  • CListCtrl & theCtrl = GetListCtrl
    C cy163 hotmail com

    Thank you DavidCrow for your reply. I wonder what exactly is the role of GetListCtrl(); generate a instance of ListCtrl? or sth else?

    C / C++ / MFC tutorial question

  • Question on MFC program execution procedure [modified]
    C cy163 hotmail com

    Hi, ALL I am using VC++ 6.0. I created a single document MFC application. I did not add any new codes to the project. After compiling, the program works fine. To learn the execution procedure, i set some break points within BOOL CxxxApp::InitInstance(), CxxxDoc::OnNewDocument() and CxxxView::OnInitialUpdate(). I run the application in debug mode. I observe that the program first goes into InitInstance(). After exeuting if(! ProcessShellCommand(cmdInfo)) within InitInstance(), the program goes into CxxxDoc,then into CxxxView. After that, the program goes back into InitInstance() again to execute the remaining two statements

    m_pMainWnd->ShowWindow(SW_SHOW);
    m_pMainWnd->UpdateWindow();

    I tried but failed to find the intrinsic reason. What makes the program to run in this manner. I found nowhere CxxxDoc::OnNewDocument() and CxxxView::OnInitialUpdate() are called explicitly

    BOOL CxxxApp::InitInstance()
    {
    AfxEnableControlContainer();

    #ifdef \_AFXDLL
    	Enable3dControls();
    #else
    	Enable3dControlsStatic();
    #endif
    
    SetRegistryKey(\_T("Local...));
    
    LoadStdProfileSettings();
    CSingleDocTemplate \* pDocTemplate;
    pDocTemplate = new CSingleDocTemplate(
    	IDR\_MAINFRAME,
    	RUNTIME\_CLASS(CxxxDoc),
    	RUNTIME\_CLASS(CMainFrame),
    	RUNTIME\_CLASS(CxxxView));
    AddDocTemplate(pDocTemplate);
    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo);
    if(!**ProcessShellCommand(cmdInfo))<----**
    	return FALSE;
    m\_pMainWnd->ShowWindow(SW\_SHOW);
    m\_pMainWnd->UpdateWindow();
    

    }

    Would you please recommand some reference books or articles on this to me.

    modified on Tuesday, December 14, 2010 8:20 AM

    C / C++ / MFC c++ debugging question

  • Class CxxxxView:CFormView
    C cy163 hotmail com

    Thanks you superman for your reply. Another question concerns the following code snippet. I wonder why

    CListView::OnInitialUpdate();

    can be called directly, without declaring an instance of the class CListView.

    void CMyListView::OnInitialUpdate()
    {
    CListView::OnInitialUpdate();

    // this code only works for a report-mode list view
    ASSERT(GetStyle() & LVS_REPORT);

    // Gain a reference to the list control itself
    CListCtrl& theCtrl = GetListCtrl();

    // Insert a column. This override is the most convenient.
    theCtrl.InsertColumn(0, _T("Player Name"), LVCFMT_LEFT);

    // The other InsertColumn() override requires an initialized
    // LVCOLUMN structure.
    LVCOLUMN col;
    col.mask = LVCF_FMT | LVCF_TEXT;
    col.pszText = _T("Jersey Number");
    col.fmt = LVCFMT_LEFT;
    theCtrl.InsertColumn(1, &col);

    // Set reasonable widths for our columns

    C / C++ / MFC tutorial

  • CListCtrl & theCtrl = GetListCtrl
    C cy163 hotmail com

    I saw these lines in an example code. I am not clear about it.

    CListVieiw::OnInitialUpdate();
    CListCtrl & theCtrl = GetListCtrl();

    My questions are (1) Is GetListCtrl()( on the second line) a member function;Which class does it belong to? (2) what does the '&' mean at the left hand side?

    C / C++ / MFC tutorial question

  • Class CxxxxView:CFormView
    C cy163 hotmail com

    I am using VC 6.0. I would like to create a CFormView based project by using ClassWizard, so that I can see the following line in the CxxxxView class.

    Class CxxxxView:CFormView
    {
    ....
    ....
    }

    Please tell me how to do this using ClassWizard, Thanks

    C / C++ / MFC tutorial

  • Is there any DB2 driver for VC
    C cy163 hotmail com

    Hi All, I am using VC++ 6.0. I am using ODBC to connect to DB2 database. I wonder if there is any driver(connector) dedicated for VC6.0. Thanks Felix

    C / C++ / MFC c++ database
  • Login

  • Don't have an account? Register

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