Multi-view static splitting SDI window

Source: Internet
Author: User

Today, we have finally finished the interface that we have always wanted to do like MMC in windows.

Now I have a little fun, and I will summarize my experiences as follows:

1. Create an SDI project named dbvview in vc6.0, and select "application split form" in the Windows style in Step 6 of the wizard ". After the project is created, we can see that the project created by the "Application split form" option is selected is different from the general project: A csplitterwnd variable m_wndsplitter is added to the cmainframe class, this variable is used to split the form.

2. Create a new class cnewview, which is derived from the cview class.

3. Reload the cmainframe: oncreateclient () function.

Bool cmainframe: oncreateclient (lpcreatestruct lpcs, ccreatecontext * pcontext)
{
M_wndsplitter.createstatic (this, 1, 2 );
M_wndsplitter.createview (100,100, runtime_class (cnewview), csize (), pcontext );
M_wndsplitter.createview (100,100, runtime_class (cdbvview), csize (), pcontext );
Return true;
}

The createstatic (this,) function splits the current main frame into one row and two columns. After the framework is split, the number starts from 0 rows and 0 columns.

The createview (100,100, runtime_class (cnewview), csize (), pcontext) function enables the View class cnewview to be displayed in

The Framework has 0th rows and 0th columns.

This completes the split form and binds the custom View to the split form.

However, when I runProgramWhen a problem occurs, the program reports an error: cdbvview is not a class name or namespace.

So I added a header file # include "dbvview. H" to mainframe. cpp"

This error is missing. However, a new error occurs again.

Error c2143: syntax error: ";" missing (before)

Error c2501: "cdbvview: cdbvdoc": the storage class or type specifier is missing.

Error c2501: "cdbvview: getdocument": the storage class or type specifier is missing.

Warning c4183: "getdocument": The return type is missing. It is assumed that it is a member function that returns "int ".

After checking on the Internet for a long time, I finally learned the cause. There is a cdbvdoc * getdocument () const in cdbvview. h;

Cdbvview. h does not contain cdbvdoc. Therefore, you only need to include cdbvdoc. h In cdbvview. h.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.