OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-02-2003, 15:55
bbolte
Guest
 
Posts: n/a
Default 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?
Reply With Quote
  #2  
Old 11-02-2003, 16:48
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default 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?
Reply With Quote
  #3  
Old 11-02-2003, 21:24
bbolte
Guest
 
Posts: n/a
Default 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.
Reply With Quote
  #4  
Old 11-02-2003, 21:58
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default 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...
Reply With Quote
  #5  
Old 11-02-2003, 22:05
bbolte
Guest
 
Posts: n/a
Default 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... :?:
Reply With Quote
  #6  
Old 17-02-2003, 09:54
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default 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.
Reply With Quote
  #7  
Old 17-02-2003, 10:17
bbolte
Guest
 
Posts: n/a
Default

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?
Reply With Quote
  #8  
Old 17-02-2003, 10:56
bbolte
Guest
 
Posts: n/a
Default

can you do it by naming the documents and then referring to the named document as opposed to activedocument?
Reply With Quote
  #9  
Old 17-02-2003, 10:58
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

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:
Reply With Quote
  #10  
Old 17-02-2003, 12:11
bbolte
Guest
 
Posts: n/a
Default

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?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shape Looping... Craig Tucker CorelDRAW/Corel DESIGNER VBA 9 21-06-2004 09:15
Looping layers: Why doesn't this work? andyb CorelDRAW/Corel DESIGNER VBA 1 10-07-2003 18:41


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


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