From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Properly Destroy Quicktime ActiveX Object?

Hi,

 

Does anyone have experience with Quicktime ActiveX objects?  I'm having an issue about destroying/unloading the objects.  When my compiled executable is closed (either programtically through 'Quit Labview' or by selecting 'File-->Exit'), Windows 7 detects a crash and displays:

lv_qt_crash.png

 

So I'm guessing that Quicktime is the culprit because of the 'Fault Module Name'.

 

When I shutdown the Quicktime portion of the program (a subvi that gets called several different times), I perform:

  1. QTOLibrary.IQTMovie.Stop
  2. QTOLibrary.IQTMovie.Disconnect
  3. Set QTOControlLib.IQTControl.URL = [blank]
  4. QTOControlLib.IQTControl.QuickTimeTerminate
  5. Destroy QTOControlLib.IQTControl reference
  6. Destroy QTOLibrary.IQTMovie reference
  7. Destory QuickTime ActiveX container reference

Any other properties/methods/combinations/order I should try?  Thanks.

 

-Joe

 

 

0 Kudos
Message 1 of 7
(3,140 Views)

Hi Joe, 

 

Quit LabVIEW shuts down LabVIEW, but does not affect other applications. You need to ensure that your ActiveX references are being closed properly, even if you are quitting LabVIEW.

 

A good way to ensure that your references are being closed even when you forcibly exit LabVIEW is to use an event structure. Add a new event to the event structure by right clicking on the default "Timeout" label at the top and selecting "Add Event Case...". Then, under the Event Source, "<Application>", select the event, "Application Instance Close". This event will only execute when you attempt to close your application. Add another "Close Reference" function to the block diagram and wire the reference out output of the Invoke node to the reference input of the Close Reference function. Does this fix your error? 

Julianne K
Systems Engineer, Embedded Systems
Certified LabVIEW Architect, Certified LabVIEW Embedded Systems Developer
National Instruments
0 Kudos
Message 2 of 7
(3,128 Views)

I added this to the main VI:

qt_crash_es.png

Is that what you meant?  I still get the same error report.  I also checked that I close the individual ActiveX references properly.

 

 

0 Kudos
Message 3 of 7
(3,122 Views)

Hi Joe, 

 

Can you give me some more information about what you program does? Also, after you receive this error, can you open Quicktime? Does it start normally or do you receive error messages? Thanks, 

Julianne K
Systems Engineer, Embedded Systems
Certified LabVIEW Architect, Certified LabVIEW Embedded Systems Developer
National Instruments
0 Kudos
Message 4 of 7
(3,113 Views)

Hi Joe,

 

Did you manage to solve your Quicktime ActiveX troubles??? I am having the same type of headaches ... any help/advices are appreciated 😉

 

Thanks a million.

Chris

0 Kudos
Message 5 of 7
(3,070 Views)

Hi Chris,

 

No, I never did find a fix for this.  So if you find anything out, please post to this thread.  Thanks.

 

-Joe

 

 

0 Kudos
Message 6 of 7
(3,065 Views)

I finally came back to this application and I believe I have it figured out.  As far as I can tell, the all 3 types of references can be destroyed or not destroyed without consequence.  The same applies to the 'Connect' and 'Disconnect' methods.

 

The crash occurs because of file handles still being open.  I was 'unloading' movies from the Quicktime control by wiring a null string to the FileName or URL property.  Quicktime doesn't handle this correctly and leaves the original file open.  So instead I wired a path to an actual image file (Quicktime does images too) that was all black.  Eveything seems fine now.

 

 

0 Kudos
Message 7 of 7
(3,035 Views)