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
Solved

Problem in insert object

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Title # Comments Views Activity
SNMP error No Such Object available on this agent at this OID 3 297
Unable to start eclipse ? 17 153
Safe conversion? 4 72
object oriented programming comparison 5 77
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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++.

808 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