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 04-03-2004, 11:58
RobC
Guest
 
Posts: n/a
Default Undocumented Feature(?)

I came across an interesting quirk in the CorelDraw11 COM model yesterday.

We started noticing bugs in the output of one of my programs driving Corel11. It had been upgraded from a system driving corel 10 and corel 9 before that. The bug was a function that filled a string shape with text started substituting quotes for bullets

so

• COMPTONVILLE •

became

" COMPTONVILLE "

furthermore, the font was set to Arial Unicode MS for the mis-mapped characters, regardless of what the original font was set to.

In all my new code, I fill text-shapes with

shape.text.story="• COMPTONVILLE •"

however, this code, having been ported from earlier versions of CorelDraw went about the task thusly:

shape.text.contents="• COMPTONVILLE •"

This worked all of the time in early versions, and most of the time this worked under Corel11, but not if the character was in the extended character set (>ascii 127).

The worst part of this problem though, is that the 'Contents' property is not even part of the Text object in Corel11!! 'shape.text.contents=' should have blown up the second I tried to compile! Yet, it not only compiled, it worked most of the time. This is pretty insidious, as code problems go, I think.

I count on my development tools to warn me about changes to the object model when doing version upgrades. Since I didn't get any errors from the compiler, I had no way of knowing that I was accessing undocumented properties until I actually checked the dcumentation and found that property missing, entirely.

FYI.
Reply With Quote
  #2  
Old 04-03-2004, 13:35
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: Undocumented Feature(?)

Rob,

It is a common practice to leave obsolete methods hidden to preserve backward compatibility with earlier scripts. By default VBA's IntelliSense will not show the hidden methods in pop-ups so users won't be inclined to use them when creating macros but if a macro was created in previous verion, it still should work OK in the current one. Obviously, this is not always the case, but in most cases, this is the practice.

You can see the hidden methods if you go to Object Browser (F2), right-click and choose "Show Hidden Methods". You are still advised to use the newer functions instead, as they are either better or provide more functionality.
Reply With Quote
  #3  
Old 05-03-2004, 04:36
RobC
Guest
 
Posts: n/a
Default

Is there a way to strictly deny the use of 'Hidden' properties and methods?
Reply With Quote
  #4  
Old 05-03-2004, 07:03
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Not that I know of...
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
Undocumented Application.Status property in CDR12 zlatev CorelDRAW/Corel DESIGNER VBA 2 21-02-2005 16:30


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


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