Click here to Skip to main content
15,883,978 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I want to draw an ActiveX (mschrt20.ocx) inside the OnDraw method in my custom ActiveX made in (C++/VS2010).

Someone have a clue on that?
Posted

Thank you for your time The_Inventor!

I've got the problem solved by adding the chart in a IDD_DIALOG
and attaching it to the ActiveX. But the ActiveX must be enabled for control container,
and the dialog must have a bunch of flags setted.

More Info

Cheers!
 
Share this answer
 
Presuming you have a:

C++
CDC* m_pchrtMyChart;

in your code then all you should have to do is:

C++
m_pchrtMyChart = mschrt20obj.m_pchrtObj
or something to that extent. Often there is a HANDLE involved in order to transfer information about the object. It is a lot like using Bitmaps.
 
Share this answer
 
You need a member and method(s) that point to the mschrt20.ocx functions within the mschrt20.ocx module within your module's code. Also you will need to include mschrt20.h in your header file for you module. Then in your OnDraw() use the methods and member, that is in your header file of your OCX file.
 
Share this answer
 
Comments
Pedro Lacerda 9-Apr-13 7:02am    
Alright, Thanks! I've done that, but the problem is i still getting problem in attach the CDC* from the mschrt20.ocx to my OnDraw(), i'm really lost in MFC/ActiveX programming, but maybe i just need a piece of code on that to get the things moving again.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900