DEV Community

海前 王
海前 王

Posted on

some import mfc

#include<iostream>
using namespace std;

app 的构造里面    
AllocConsole();
    freopen("CONIN$", "r", stdin);
    freopen("CONOUT$", "w", stdout);
    freopen("CONOUT$", "w", stderr);
    std::cout << "hello";


void CMFCApplication22View::OnRButtonUp(UINT /* nFlags */, CPoint point)
{
    std::cout << "hello";
    ClientToScreen(&point);
    cout << endl;
    cout << point.x << " " << point.y<<"\n";
    CPoint z=point;
    ScreenToClient(&z);
    // 创建一个 CEdit 控件
    CEdit* pEdit = new CEdit;

    // 设置控件的边框风格、可见性等
    pEdit->Create(WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL,
        CRect(z.x, z.y, z.x + 100, z.y + 20),
        this,
        10009);

    // 设置控件文本(可选)
    pEdit->SetWindowText(_T("Hello, World!"));


    OnContextMenu(this, point);
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay