Solved

Problem in insert object

Posted on 1998-01-18
2
233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

733 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