Click here to Skip to main content
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 7: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 OriginalGriff 8,284
1 Sergey Alexandrovich Kryukov 7,327
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,920


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 11 Apr 2013
Copyright © CodeProject, 1999-2014
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