Click here to Skip to main content
11,721,053 members (82,910 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ MFC COM ActiveX
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 8-Apr-13 6:36am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
Pedro Lacerda at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Presuming you have a:

CDC* m_pchrtMyChart;
in your code then all you should have to do is:

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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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!
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 500
1 OriginalGriff 334
2 Mika Wendelius 160
3 F-ES Sitecore 140
4 Maciej Los 80
0 Sergey Alexandrovich Kryukov 2,199
1 OriginalGriff 959
2 F-ES Sitecore 640
3 Maciej Los 609
4 Richard MacCutchan 540


Advertise | Privacy | Mobile
Web01 | 2.8.150901.1 | Last Updated 11 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100