OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   CorelDRAW/Corel DESIGNER VBA (http://forum.oberonplace.com/forumdisplay.php?f=16)
-   -   looping until documents.count = 0 (http://forum.oberonplace.com/showthread.php?t=66)

bbolte 11-02-2003 16:55

looping until documents.count = 0
 
i'm not sure how to describe this. using visual basic 6, creating an activex exe to build graphic files. the com will be called by many different client apps through the network. i'm noticing that if i open and close corel repeatedly that eventually corel will hang and then nothing else can happen. i'm thinking that maybe by leaving corel open and just open and close documents, this might eliviate that problem (thinking anyway).

so i need someway to check for an open document and then keep checking until it's closed before a new document will be created. anyone have any thoughts on this?

one last question, is there anyway to turn off all dialog boxes from corel so that none show up under any circumstance?

Alex 11-02-2003 17:48

Re: looping until documents.count = 0
 
Well, you don't have to do that. Go ahead and create a new document in your process. After you are done, just close it. CorelDRAW can handle multiple document sessions from different clients. If you plan dozens of users at a time, you might want to consider several CorelDRAW stations that would be load balanced on a network though. But I had quite good success using a single copy and it handled the tasks OK.

As for the dialogs, they shouldn't appear in the first place. What dialogs are we talking about?

bbolte 11-02-2003 22:24

Re: looping until documents.count = 0
 
Quote:

Originally Posted by Alex
... CorelDRAW can handle multiple document sessions from different clients...
As for the dialogs, they shouldn't appear in the first place. What dialogs are we talking about?

now my experience with that (multiple docs) was once a new document started, the previous stopped processing. i did some experiments with a com that measured some things and sent the measurements back to the client. if a new document/prcess started before the previous had finished, the previous process stopped and errored out.

dialogs, i've gotten some when importing a graphic and a different version of ariel was on the machine that created the graphic and it threw a dialog even though the font wasn't used in the graphic.

Alex 11-02-2003 22:58

Re: looping until documents.count = 0
 
As for multiple processes, there's in problem with Draw. I have tested this on Draw 9, 10, and 11. Works like a charm. If this happens on your machine, then it could be some system settings (could be the web server configuration?). In pure normal COM (e.g. you create a VB exe that does something), more than one EXE can "talk" to CorelDRAW without much interference provided that they all work in separate documents.

As for the PANOSE matching dialog, make sure that Application.PanoseMatching is set to anything except for "...Prompt" which is the default. There is still a problem that this dialog sometimes appears when opening a document, however IMPORTing it seems to work much better. By the way, CorelDRAW 11 works much better on that front. So, if your project is very critical to you, I would strongly suggest you to upgrade to CorelDRAW 11. It has a lot of VBA stability enhancements of that sort...

bbolte 11-02-2003 23:05

Re: looping until documents.count = 0
 
Quote:

Originally Posted by Alex
...more than one EXE can "talk" to CorelDRAW without much interference provided that they all work in separate documents.

just so i understand, one instance of corel draw open with multiple documents open and a different process happening simultaneously in the different documents? wow. i haven't been able to make that happen.

i had a simple vb app on several different machines, calling an active x exe on my computer (win 2000 pro - not server) that set some text and measured it. it sent this measurement back to the client. and as i said, if they hit at the same time, the one that got their first quit and then errored.

hmmmmm... :?:

Alex 17-02-2003 10:54

Re: looping until documents.count = 0
 
Strange. I never had a problem having two or more VB exe's work on two (or more) documents at the same time in CorelDRAW. In fact I even noticed that having, let's say, 2 program work with 2 documents at the same time is faster than have the two work one after another.

bbolte 17-02-2003 11:17

did you do any unusual voodoo in your vb code? i wonder if i could show you some code and if you could see if i've done something wrong or different?

bbolte 17-02-2003 11:56

can you do it by naming the documents and then referring to the named document as opposed to activedocument?

Alex 17-02-2003 11:58

Quote:

Originally Posted by bbolte
did you do any unusual voodoo in your vb code? i wonder if i could show you some code and if you could see if i've done something wrong or different?

Sure, go ahead and post it (or send it to me privately). My programs weren't any fancy or something. The basic steps were something like this:
  1. Create new document
  2. Create several shapes and change their properties (fills, outlines, etc)
  3. Export the file to GIF/JPEG
  4. Close the document
That was working fine. I'm not sure if you were using something more specific that might make CorelDRAW to choke... Seeing your code might help... :wink:

bbolte 17-02-2003 13:11

these are pretty complex. it was code that i inherited. but i think that i may have stumbled onto something. the original programmer liked to set everything to objects, as in, set csDoc = application.document and then use csdoc everywhere he needed activedocument. i believe he started working on this with corel 8 or probably 9.

anyway, i removed a whole bunch of that code and replaced it with activedocument, activelayer or activeshape whenever i needed to and it seems to be working, at least on a little attempt with the 2 computers that i have on my desk.

do you think this could have been the culprit?


All times are GMT -5. The time now is 15:15.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com