Solved

Problem in insert object

Posted on 1998-01-18
2
219 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

895 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

17 Experts available now in Live!

Get 1:1 Help Now