How to create and add a custom component to a dialog-based application (MFC)?

I want to create a custom component (line chart) that will be used in other applications.

I do not know 2 things:

  • Where should I use (in the component class!) Drawing methods like FillRect

    or PolyLine? In the OnPaint handler, which should I define and display in the MESSAGE MAP? Will be

    it (the OnPaint handler) is called from the OnPaint handler of the application dialog

    or where from?

  • How to connect a component, once it is done, to a test application that will

    for example, based on dialogue? Where should I instantiate this component? Of

    OnCreate method for MyAppDialog.cpp?

I started coding in MFC a few days ago, and I'm so confused.

Thanks in advance,

Greetings.

+3
2

MFC (CWND),

MessageMap , CWND:: OnDraw, . .

http://msdn.microsoft.com/en-us/library/azz5wt61(VS.80).aspx

.

+1

, . , MFC, ( , ) , "OnDraw" (MFC OnPaint , ).

ActiveX - , ActiveX. , Visual Studio, , , " ActiveX..." . , - . , , , .

0

Source: https://habr.com/ru/post/1741504/


All Articles