Click here to Skip to main content
15,913,090 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Components and Controls missing in Visual C++ .Net Pin
Kevin McFarlane28-Oct-03 0:39
Kevin McFarlane28-Oct-03 0:39 
Generalwindow refresh problem in ActiveX Control Pin
HeartFriend27-Oct-03 14:57
HeartFriend27-Oct-03 14:57 
QuestionWhat is the difference between .sln and .vcproj? What do they do? Pin
Link260027-Oct-03 14:03
Link260027-Oct-03 14:03 
AnswerRe: What is the difference between .sln and .vcproj? What do they do? Pin
Kentamanos27-Oct-03 14:29
Kentamanos27-Oct-03 14:29 
GeneralCreate bitmaps from windows content Pin
alex.barylski27-Oct-03 13:18
alex.barylski27-Oct-03 13:18 
QuestionHow to change the font color in a richedit control Pin
Deepak Samuel27-Oct-03 12:08
Deepak Samuel27-Oct-03 12:08 
AnswerRe: How to change the font color in a richedit control Pin
Oinka27-Oct-03 13:32
Oinka27-Oct-03 13:32 
QuestionAnybody see what I did wrong? Pin
Oinka27-Oct-03 11:39
Oinka27-Oct-03 11:39 
I'm using Visual C++ 6.0 SP5

I create a new MFC Appwizard project, I choose SDI with doc/view architecture support, then I leave everything at the defaults until it asks me How do you want your toolbars to look? and I choose Internet Explorer Rebars then finish.

Next I enter the Project menu and choose Add to project then Components and Controls. This opens up the Components and Controls Gallery. In there I pick the Registered ActiveX Controls folder and find the Microsoft Multimedia Control (for me it is version 6.0) and insert it leaving all the options at their defaults.

In the resource editor under dialogs I edit the IDR_MAINFRAME dialog and add the multimedia control to it from my controls palette. I double click my newly created multimedia control and Classwizard pops up with a message saying IDR_MAINFRAME is a new resource... do you want to add a class for it? and I choose select an existing class and choose CMainFrame. Now I close Classwizard and go back to the resource editor and right click my multimedia control and choose events to add the OnPlayClick event handler. It prompts me for the name of the event handler and I just leave it as the default OnPlayClickMmcontrol1. Then in the code for the event handler I just put something simple to test out the button like AfxMessageBox("bleah");

Next I edit the end of the CMainFrame::OnCreate function like so in order to initialize the multimedia control (this assumes you have c:\windows\media\ding.wav available):
<br />
...<br />
...<br />
// get a pointer to the multimedia control<br />
Cmci* mci = (Cmci*) m_wndDlgBar.GetDlgItem(IDC_MMCONTROL1);<br />
<br />
// initialize the multimedia control<br />
mci->SetFileName("c:\\windows\\media\\ding.wav");<br />
mci->SetCommand("Open");<br />
<br />
return 0;<br />

I also include the multimedia control header in mainfrm.cpp like so to satisfy the compiler
<br />
#include "mci.h"<br />

I run the program and the multimedia control works except the OnPlayClick event handler doesn't seem to get called.

If I do the same idea but with a dialog based program instead of SDI then it will work normally. I think for some reason the activeX control won't deliver events when it is on the dialogbar but I can't fathom why.

anybody know why?

I am stumped...

Any ideas are appreciated.

-Oinka
AnswerRe: Anybody see what I did wrong? Pin
Anthony_Yio27-Oct-03 16:33
Anthony_Yio27-Oct-03 16:33 
Generalstill can't figure it out Pin
Oinka27-Oct-03 19:17
Oinka27-Oct-03 19:17 
GeneralRe: still can't figure it out Pin
Steve S27-Oct-03 22:30
Steve S27-Oct-03 22:30 
GeneralThanks! Pin
Oinka28-Oct-03 12:35
Oinka28-Oct-03 12:35 
GeneralLinking two tables programmatically Pin
DimkaSPB27-Oct-03 11:04
DimkaSPB27-Oct-03 11:04 
GeneralRe: Linking two tables programmatically Pin
Terry O'Nolley27-Oct-03 11:39
Terry O'Nolley27-Oct-03 11:39 
GeneralRe: Linking two tables programmatically Pin
DimkaSPB27-Oct-03 11:54
DimkaSPB27-Oct-03 11:54 
GeneralI still DO NOT UNDERSTAND keyboard accelerators Pin
BoudewijnEctor27-Oct-03 10:44
BoudewijnEctor27-Oct-03 10:44 
GeneralRe: I still DO NOT UNDERSTAND keyboard accelerators Pin
Terry O'Nolley27-Oct-03 11:44
Terry O'Nolley27-Oct-03 11:44 
GeneralRe: I still DO NOT UNDERSTAND keyboard accelerators Pin
BoudewijnEctor28-Oct-03 5:21
BoudewijnEctor28-Oct-03 5:21 
GeneralRe: I still DO NOT UNDERSTAND keyboard accelerators Pin
Steve S28-Oct-03 21:41
Steve S28-Oct-03 21:41 
GeneralCan't compile thread Pin
BoudewijnEctor27-Oct-03 10:22
BoudewijnEctor27-Oct-03 10:22 
GeneralRe: Can't compile thread Pin
Michael P Butler27-Oct-03 10:31
Michael P Butler27-Oct-03 10:31 
GeneralRe: Can't compile thread Pin
BoudewijnEctor27-Oct-03 10:38
BoudewijnEctor27-Oct-03 10:38 
GeneralRe: Can't compile thread Pin
David Crow27-Oct-03 12:49
David Crow27-Oct-03 12:49 
GeneralC++ Application for TemplatePrinter Pin
naxtell27-Oct-03 9:31
naxtell27-Oct-03 9:31 
GeneralHC3025 Error : Tab Control Pin
help_me_pleeze27-Oct-03 8:53
help_me_pleeze27-Oct-03 8:53 

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.