Hi Amit,
OLEObject itself is just a proxy for talking to a COM object. Once created, you only have an empty proxy without content.
The proxy needs to connect to a COM object. That's where ConnectToNewObject comes into play. When that succeeds your proxy has access to that specific COM object.
You can access the COM object via the proxy using o1.object.XXX
notation. Calling Open(string) requires your COM object has such a function. There are no compiler checks since COM calls are dynamic.
COM object's documentation should describe its API. Calling non-defined functions *WILL* throw exceptions.
AVI files are video files. So you need to make sure that your COM object knows how to handle AVI files. Like telling your XML parser to open a video: That action is probably undefined or leads to app crash.
NOTE
IF identical code runs on some machines but not on other machines - AND - the failing code involves OLEObject to access a COM object - THEN - My first attempt at solving the issue would be:
ACTION: Check whether the COM object class that your app tries to access actually exists on the failing machines.
STEPS:
#1: First find the COM object in Windows Registry on a working machine - so you know what to look for.
#2: Then look for same definition on failing machine. If it is missing: Bingo! You found reason for failure.
HTH /Michael