DAImport Class

Creates a DAImport object that can be used to monitor the status of media imports, assign or retrieve priorities for different imports, and cancel imports. The DAImport object is available to any imported media, and its functions are accessible from any imported media. An example is shown in the following code.

img = m.ImportImage(url);
img.ImportPriority(5);
...
img.ImportCancel();

If you try to use the DAImport functions on media that are not imported media, you will get an error message that the DAImport object is not available.

DAImport Functions

ImportCancel Cancels the importation of media.
ImportStatus Returns the import status of an imported media object.

DAImport Properties

ImportPriority a read/write property that sets and retrieves the priority of the import which determines the order in which objects are imported.

DAImport Functions

This section contains reference material for the DAImport functions.

ImportCancel

DAImport Class

Cancels the importation of media. No error is returned if the importation has already finished and can't be canceled.

Syntax

importedMediaObj.ImportCancel()

ImportStatus

DAImport Class

Returns the import status of imported media object.

Syntax

importedMediaObj.ImportStatus()

Return Value

Returns a value that specifies the import status, either finished, pending, or failed.

Remarks

To use the import status value, you should store it in a variable, then compare it to known status values.
Status Variable Value Meaning
0The importation completed successfully.
non-zeroAn error code.
-2147483638 (pending)The importation is still going on.

The following example shows how to use this status:

m = DAControl.MeterLibrary;
var = x;
img = m.ImportImage("myimage.gif");
x = img.ImportStatus();
while (x == -2147483638){
   x=img.ImportStatus();
 }
if (x == 0)
   //Load succeeded, so put code here to do something with image
else 
   //Load failed, so put code here that doesn't use the image
  

DAImport Properties

This section contains reference material for the DAImport properties.

ImportPriority

DAImport Class

Sets or retrieves the number (float) that specifies the priority of the import, which determines the order in which objects are imported. Zero is the lowest priority. This property is read/write.

Syntax

importedMediaObj.ImportPriority


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.