mApplication.registerCOMServer()

Availability

Windows: Flash 8 or 9 AS2.0 SWF + mProjector 3.0; Windows 98/ME/NT Support: Flash 7 SWF + mProjector 2.0;

Macintosh: Not Applicable

Usage

mApplication.registerCOMServer(serverFileName:String) : Boolean

Parameters

serverFileName - Name (including the path) of the COM server to register.

Returns

A boolean.; ;

Description

Method; Registers the specified COM server. Once the server is registered, the objects it contains can be created via the mApplication.createObject() function.

Example

The following examplecreates several button functions that exerices a COM object. The registerCOMServer_btn.onPress method registers the COM object.

var beepDLLisRegisted = false;
var beepObject = NULL;

drag_btn.onPress = function () {
	mWindow.startDrag();
}

quit_btn.onPress = function () {
	mApplication.quit();
}

registerCOMServer_btn.onPress = function () {
	beepDLLisRegisted = mApplication.registerCOMServer("ComBeep.dll");
	
	if (beepDLLisRegisted){  
		mApplication.trace("registerCOMServer beep.dll successfull");
	} else {
		mApplication.trace("registerCOMServer beep.dll FAILED");		
	}
}

createBeepObject_btn.onPress = function () {
	if (beepDLLisRegisted){  
		beepObject = mApplication.createObject("ComBeep.ComBeeper");	
		
		if (beepObject){  
			mApplication.trace("createObject beepObject successful");
		} else { 
			mApplication.trace("createObject beepObject FAILED");
		}
	}
}

beep_btn.onPress = function () {
	if (beepObject){  
		mApplication.trace("beepObject.beep(4000,20)");
		beepObject.beep(4000,20);  
	}
}

destroyBeepObject_btn.onPress = function () {
	if (beepObject){  
		beepObject.deleteObject();
		beepObject = NULL;
	}
}

See Also

mApplication.createObject()

Code Examples

Windows COM Basics, Windows COM MS Access Database