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 14-05-2003, 07:25
Elie
Guest
 
Posts: n/a
Default How can I get data from function?

Hello!

I am automating CorelDraw by using the Variant class, i.e.

in Delphi:
var
vCorelApp: Variant;
[...]
vCorelApp := CreateOleObject('CorelDraw.Automation.8');
vCorelApp.SetVisible(0);

or in C++Builder:
Variant vCorelApp;
[...]
vCorelApp = CreateOleObject("CorelDraw.Automation.8");
vCorelApp.OleFunction("SetVisible", 0);

and so on. Now I need to get data from Corel`s script function GetSize which has this declaration in Corel Help:

.GetSize .XSize = long*, .YSize = long*

i.e. GetSize returns datas by function arguments.

How can I receive XSize and YSize from GetSize function? Any code example will be appreciated.

TIA,
Elie
Reply With Quote
  #2  
Old 14-05-2003, 09:02
bbolte
Guest
 
Posts: n/a
Default

.GetSize w, h

the w and h variables have the dimensions of the object or in your code example:

.GetSize XSize, YSize

the variables XSize and YSize would hold the dimensions, simply refer to the variables as you would normally.
Reply With Quote
  #3  
Old 15-05-2003, 01:18
Elie
Guest
 
Posts: n/a
Default

Thank You Bill!

In C++ code it looks like:
long XSize, YSize;
vCorelApp.OleFunction("GetSize", &XSize, &YSize);

and GetSize fills args with values, but now I have another problem. I cannot understand these values . I mean if I use:

vCorelApp.OleFunction("CreateRectangle", 10000, 0, 0, 20000, 0);
vCorelApp.OleFunction("GetSize", &XSize, &YSize);

then I expected to receive XSize = 20000 and YSize = 10000, but I get XSize = 20762 and YSize = 10762. I do not understand this difference 762. What it is?

TIA,
Elie
Reply With Quote
  #4  
Old 15-05-2003, 05:08
Elie
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Elie
I do not understand this difference 762. What it is?
Now I got it! It is a rectangle`s pen width.
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
how to use getpixel() to get the Image color? lees CorelDRAW/Corel DESIGNER VBA 6 17-10-2004 00:13
Printing Raw Prn Files Mark Code Critique 2 16-09-2004 16:15
Function names Lev Oberon Function Plotter 1 29-08-2003 11:04
takes Draw a long time to start a new document! bbolte CorelDRAW/Corel DESIGNER VBA 5 14-05-2003 09:09
SaveAs function not working in PP11 Aneurysm Corel Photo-Paint VBA 2 03-03-2003 17:31


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


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