TOleContainer

    I have a TOleContainer in a Delphi 3 Tform, and I use it to open external files in the associated applications (e.g.: for .doc
files
it opens Word, for .gif it opens MS Photo Editor, etc.).
After opening a .gif and when I try to open a .doc I get the following error message:
'Linked object's source class has changed'.

Heres the code:

var
{olecont: Tolecontainer - a form component}
 fname: String;
...
begin
    if (olecont.State <> osEmpty) then olecont.Close;
    olecont.DestroyObject;

    {set fname to the name of the file to open}
    ...

    OLECont.CreateLinkToFile( fname, True );  {not to open locally}
    olecont.UpdateObject;
    OLECont.DoVerb(ovprimary); {error occurs here}

end;

Any clues?

Thanks,

         Tiago