Solved

Problem in insert object

Posted on 1998-01-18
2
216 Views
Last Modified: 2010-08-05
When I insert activemovies in my interface,
(only insert, not change the code) and execute the program
the output is not displayed any error, but the interface
is not displayed! Why ?
Should I edit code for activemovies ?
Any special procedure for inserting object ?
Thank You for your help.
0
Comment
Question by:logout
2 Comments
 

Accepted Solution

by:
Wowen earned 20 total points
ID: 1178476
Hi!  I don't know if this is your problem, but it may be...   When you insert an object (is it an OCX from the Gallery perhaps?) you have to

a) select the object in the resource editor
b) press ctrl-w to enter the Class Wizard
c) the best place is in the place where you put the control.    So let's say you put it in your view.  If so make sure that
  when you enter the wizard, it says "....view" (the "...." is    your projectname.  If it does NOT specify that you are in your    view then press the little downward pointing arrow and select    the view
d) now you can specify that the variable type is "control"
e) select the "control" option in the wizard
f) now in your view (or wherever you put the control) you can use this "control" to pass commands to your object.  The syntax is
    controlvariablename.objectcommand;

so for example I used an MCI player from the gallery and I called the control variable m_MCIThingy (the "m_" is a common naming convention in which the "m_" means "member" variable)  and I then could use the commands that are in the documentation for that thing as follows:

      CDialog::OnInitDialog();//I set it for when I first enter
                   //the dialog so we are in INIT DIALOG
                   //the code above is provided by MFC
      m_MCIThingy.SetFocus();
      m_MCIThingy.SetDeviceType("WaveAudio");
      m_MCIThingy.SetFileName("sound.wav");
      m_MCIThingy.SetRecordEnabled(TRUE);
      m_MCIThingy.SetPauseVisible(TRUE);
      m_MCIThingy.SetStepVisible(FALSE);
      m_MCIThingy.SetPlayVisible(FALSE);
        m_MCIThingy.SetCommand("Record");
      m_MCIThingy.SetCommand("Open");

Whew!

Well I hope this helps!  If not, let me know and I'll try to add more.

Cheers!

--Warren Baker
  Sapporo, Japan
0
 

Author Comment

by:logout
ID: 1178477
Dear
      I do following step:
      1) Go to interface ,select "Insert OLE "
      2) Put the Ms multimedia control into the interface
      3) The buttons are dsiplay on the interace
      4) Go to classwizard and set Ms multimedia member vars to  
         m_MCIThingy (control)
      And then compiling...
the output is following;

PhoneDlg.cpp
C:\Cphk\Temp\Phone\mcictrl.h(155) : error C2501: 'OLE_HANDLE' : missing decl-specifiers
C:\Cphk\Temp\Phone\mcictrl.h(155) : error C2146: syntax error : missing ';' before identifier 'GetHWnd'
C:\Cphk\Temp\Phone\mcictrl.h(156) : error C2061: syntax error : identifier 'OLE_HANDLE'
Error executing cl.exe.
PhoneDlg.obj - 3 error(s), 0 warning(s)
===================================
I did it in wrong step
Thank You for your help!
 
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now