Click here to Skip to main content
15,908,909 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralActiveX in a view Pin
Yeskay3-Jan-08 21:19
Yeskay3-Jan-08 21:19 
QuestionRe: ActiveX in a view Pin
CPallini3-Jan-08 21:24
mveCPallini3-Jan-08 21:24 
GeneralRe: ActiveX in a view Pin
Yeskay3-Jan-08 21:27
Yeskay3-Jan-08 21:27 
GeneralRe: ActiveX in a view Pin
CPallini3-Jan-08 22:17
mveCPallini3-Jan-08 22:17 
GeneralMVP Pin
Hamid_RT3-Jan-08 22:33
Hamid_RT3-Jan-08 22:33 
GeneralThank you. Pin
CPallini3-Jan-08 22:41
mveCPallini3-Jan-08 22:41 
GeneralRe: ActiveX in a view Pin
Yeskay3-Jan-08 22:56
Yeskay3-Jan-08 22:56 
GeneralRe: ActiveX in a view Pin
CPallini3-Jan-08 23:48
mveCPallini3-Jan-08 23:48 
Yeskay wrote:
I just wanted tyo know if anyone had tried such funtionality that I've asked.
I've seen some activeX controls getting loaded in the view, but i cannot understand how.


Well, I made a little test (using the standard ActiveX Calendar Control) and it is not such a difficult task. I made the following steps (VS2005):

(1) Create an MFC SDI project (support for ActiveX controls is enabled by default)
(2) Select Project->Add Class menu item and then choose (in the appeared dialog) MFC->MFC Class From ActiveX Control, finally click Add button.
(3) Select Calendar Control in the list of available Active X Controls (in the newly shown window), then select needed interfaces (Calendar Control has only one available), finally click finish button.

Now the class wizard creates a class wrapping the ActiveX Control, and you can use such class. Hence, in the view source code:

(4) Include the created class (for me was CCalendar) header (again it was Calendar.h)
(5) Add a member variable to hold an instance of the class (I used CCalendar * m_pCalendar;)
(6) Override CView::OnInitialUpdate method and inside it create an instance of the class and the call its Create method, for instance, I made
m_pCalendar = new CCalendar();
RECT rc;
GetClientRect(&rc);
m_pCalendar->Create(_T("Calendar"), WS_VISIBLE, rc, this,100);


(7) Enjoy the calendar control (and don't forget cleanup)

I'm sure you're able to adapt the above scenario to your needs, but
please note this was a quick experimental attempt, maybe there are better ways to accomplish the task.

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

[my articles]


GeneralRe: ActiveX in a view Pin
Yeskay6-Jan-08 17:24
Yeskay6-Jan-08 17:24 
QuestionRe: ActiveX in a view Pin
CPallini6-Jan-08 21:06
mveCPallini6-Jan-08 21:06 
GeneralRe: ActiveX in a view Pin
Yeskay6-Jan-08 23:11
Yeskay6-Jan-08 23:11 
GeneralRe: ActiveX in a view Pin
Maxwell Chen3-Jan-08 21:31
Maxwell Chen3-Jan-08 21:31 
GeneralRe: ActiveX in a view Pin
Yeskay3-Jan-08 21:42
Yeskay3-Jan-08 21:42 
GeneralRe: ActiveX in a view Pin
Maxwell Chen3-Jan-08 21:49
Maxwell Chen3-Jan-08 21:49 
QuestionRe: ActiveX in a view Pin
Yeskay6-Jan-08 16:41
Yeskay6-Jan-08 16:41 
GeneralRunning constant number of threads. Pin
Evgeni573-Jan-08 21:10
Evgeni573-Jan-08 21:10 
GeneralRe: Running constant number of threads. Pin
Maxwell Chen3-Jan-08 21:23
Maxwell Chen3-Jan-08 21:23 
GeneralRe: Running constant number of threads. Pin
Evgeni573-Jan-08 21:30
Evgeni573-Jan-08 21:30 
GeneralRe: Running constant number of threads. Pin
Maxwell Chen3-Jan-08 21:32
Maxwell Chen3-Jan-08 21:32 
GeneralRe: Running constant number of threads. Pin
Member 7549604-Jan-08 6:13
Member 7549604-Jan-08 6:13 
GeneralRe: Running constant number of threads. Pin
Member 7549604-Jan-08 9:33
Member 7549604-Jan-08 9:33 
GeneralCreate User Pin
narayanagvs3-Jan-08 20:54
narayanagvs3-Jan-08 20:54 
QuestionRe: Create User Pin
David Crow4-Jan-08 3:03
David Crow4-Jan-08 3:03 
GeneralTransparent CheckBox Pin
nitin33-Jan-08 20:41
nitin33-Jan-08 20:41 
Generalchange the color of Toolbar button controls Pin
msr_codeproject3-Jan-08 20:35
msr_codeproject3-Jan-08 20:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.