Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clock, hourglass, or other visual wait display
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00608057
Message ID:
00612124
Views:
41
I'm adding an instance of the class at runtime in code. It's not dropped on a form. The modemupload.avi is added to the project. The line that bombs during runtime on a client is:

This.AddObject("oleAnimation", "oleControl", "MsComCtl2.Animation.2")

It is the in load event when I debug it.

Here is my code that works on my development machine in w2k (I also have vfpcom installed and more since it is my development machine and that makes it hard to determine what is missing on the client when installed):
*---Instantiate the object
oAnimation = NEWOBJECT("Animation", "", "",;
                      "Sending List to Phonetree...",;
                      "(Please wait)",;
                      "modemupload.avi")
*---Processing Code here:
WAIT WINDOW "Testing avi control"
*---After finished processing I release the object:
oAnimation=.null.
RELEASE oAnimation


************************************************
*-- Class: Animation
************************************************
*  Author............: Daniel Gramunt
*  Created...........: 17.05.99  17:03:36
*) Description.......: Displays an animation (AVI) using the animation control that
*)                   : ships with VFP.
*)                   : Handy for processes for which you cannot use a thermometer.
*  Calling Samples...: oAnimation = NEWOBJECT("Animation", "avi.prg", "",;
*                    :                        "Creating PDF file",;
*                    :                        "PDF converter",;
*                    :                        "FileToPdf.avi")
*  Parameter List....:
*  Major change list.:
*--------------------------------------------------------------------------------------------------
DEFINE CLASS Animation AS form

  Height = 85
  Width = 210
  AutoCenter = .T.
  Caption = ""
  ControlBox = .F.
  Closable = .F.
  ClipControls = .F.
  Name = "frmAnimation"
  
  ADD OBJECT lblMessage AS label WITH ;
    WordWrap = .T., ;
    Caption = "Your message goes here...", ;
    Left = 6, ;
    Top = 2, ;
    Width = 355, ;
    Height = 25, ;
    Name = "lblMessage"

  PROCEDURE Load
    This.AddObject("oleAnimation", "oleControl", "MsComCtl2.Animation.2")
    WITH This.oleAnimation
      .Top     = 28
      .Left    = 85
      .Visible = .f.
    ENDWITH    
  ENDPROC

  PROCEDURE Init
    *  Parameter List....: tcMessage - Message to display. Optional.
    *                    : tcCaption - Form caption. Optional.
    *                    :             If omitted, the form doesn't have a title bar
    *                    : tcAviFile - Animation file to display (default = fileCopy.avi)
    *  Major change list.: 
    *---------------------------------------------------------------------------------------------
    LPARAMETER tcMessage, tcCaption, tcAviFile

    WITH This
    
    *-- check parameters -------------------------------------------------------------------------
       IF TYPE("tcMessage") <> "C" OR EMPTY(tcMessage)
         tcMessage = "Processing. Please be patient..."
       ENDIF
       IF TYPE("tcCaption") <> "C" OR EMPTY(tcCaption)
        *-- no caption, so we remove the title bar
         .TitleBar = 0
       ELSE
         .TitleBar = 1
         .caption = tcCaption
       ENDIF
       IF TYPE("tcAviFile") <> "C"
         tcAviFile = "fileCopy.avi"
       ENDIF
       .lblMessage.caption = tcMessage
       .aviPlay(tcAviFile)
       .show()
    ENDWITH       
  ENDPROC
  
  PROCEDURE AviPlay
     LPARAMETERS tcAviFile

     *-- make sure file exists
     IF FILE(tcAviFile)
       *-- update animation
       WITH ThisForm.oleAnimation
         .visible = .f.
         .stop
         .open(FULLPATH(tcAviFile))
         .play()
         .Height  = 60
         .Width   = 275
         .visible = .t.
       ENDWITH
     ENDIF
   ENDPROC

ENDDEFINE
>>Hi Daniel, according to MSFT, the file is comctl232.ocx. It registered successfully, but when I ran the runtime on the Win98 machine (after registering that file), I received the error: Appropriate license for this class not found. Any ideas? Anyone? The runtime is VFP7 with SP1.
>>
>Tracy
>
>Have you tried to sub-class the control and instantiate it programmatically, instead of dropping it on a form? This type of error occurs under that scenario.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform