Hi, I'm trying to run the fallowing code:
Type pia_type = Type.GetTypeFromProgID("CorelDRAW.Application.18"); Corel.Interop.VGCore.Application corelApp = Activator.CreateInstance(pia_type) as Corel.Interop.VGCore.Application; corelApp.Visible = false;
// Thread.Sleep(5000);
Corel.Interop.VGCore.Document doc = corelApp.OpenDocument(copiedFilePath);
......
The OpenDocument line fails, because the Corel is not yet fully started to perform next actions. And it works if I uncomment Thread.Sleep line, because it has more time to load. Clearly Thread.Sleep is not a good solution, because some computers might load faster, some slower and I can't guess the milis needed. I tried different Events (WindowActivate, OnApplicationEvent), but with "corelApp.Visible = false;" I was not lucky to catch a "nowItsLoaded" event.
How to solve this? Thanks. John
Hello trsh: Windows will show you what is opened if you look at the bottom of the screen unless you have it turned off. ( As shown below.) Windows Will Show you what is running if you look.
George
You might do well posting this in the Developer area.
If you start from the CorelDRAW Developer Area, you can follow the "Discussion" link.
I think you will have to ask to join, but it's not a big deal to do so.