Solved

Problem in insert object

Posted on 1998-01-18
2
238 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

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…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

623 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