TweetFollow Us on Twitter

Aug 94 Top 10
Volume Number:10
Issue Number:8
Column Tag:Think Top 10

Think Top 10

By Symantec’s Technical Support Team

This is a monthly column written by Symantec’s Technical Support Engineers intended to provide you with information on Symantec products. Each month we cover either a specific application of tools or a “Q&A” list.

Q. Can SourceServer be used successfully with a Visual Architect project?

A. It can. However, Visual Architect is not currently SourceServer “savvy” . Here are some guidelines for a peaceful coexistence between the two:

Rule #1: Check out necessary Visual Architect files BEFORE Generating. Since VA does NOT honor SourceServer’s 'ckid' resources, it will go ahead and overwrite files that have been checked out as read-only. So before you Generate from Visual Archtitect, make sure you’ve checked out any files that will be modified, otherwise you WON’T to be able to check the revisions back in. This goes for the Visual Architect.rsrc file, as well.

Rule #2: Close the Visual Architect.rsrc file before checking it in or out. A Visual Archtiect.rsrc file’s 'ckid' resource that is modified by SourceServer while the file is open will NOT be saved when the file is closed. The file won’t be able to be checked in or out after this.

If you forget to follow either of these rules, you may be able to set things right again by issuing the appropriate OrphanFiles, Undo Checkout, or DeleteRevisions commands. But this is not fun.

Strong Suggestion: Set up nested ProjectorDB’s to separate Generate-Once and Generate-Many and non-Visual Architect files.

Currently VA is rather inflexible about where it puts its generated files. You get exactly one choice: all go in a folder named “Source” in your project folder, and sub-folders are ignored. You can, however, use nested ProjectorDB’s to bring some order to this ungainly group of files, and at the same time avoid the performance hit which would be incurred from storing all those files in the same ProjectorDB.

The key difference among the files in the VA “Source” folder is whether they are generate-once or generate-many. For the most part, this means lower-layer versus upper-layer files, but it’s important to be aware that a number of other files, such as References.cp and the <class>Items.h files, are also generate-many. Since you’ll have to check out some, if not all, generate-many files each time you Generate, and then check them back in, it makes sense to group these files into a sub-project (“VA Regenerated Files”, for instance). Note that your VA.rsrc file should also be checked into this sub-project. The rest of the files in the “Source” folder will go in another sub-project (call it “VA One-Time Files”), and finally your non-VA files could go either into the top-level project, or into a sub-project (or sub-projects) of their own. That’s the basic idea!

Q. How do I get started converting my TCL 1.1.3 project to use the new TCL 2.0?

A. The file “Converting To TCL 2.0.doc” in the “Supplementary Info.Π” located in the TCL Folder contains an extensive list of issues you will face getting your source to compile and run under the new TCL. The most important first step, however, is to start with a fresh, working TCL 2.0 “Hello World” project and add your source to it, rather than trying to coax your existing project document into using the new TCL.

Follow these steps:

1. To convert your old TCL 1.1.3 project, create a new project and choose Visual Architect for the project model. (Version 7.0 now offers you a list of project models to choose from when creating a new project.)

2. Since you are converting an old TCL project and will probably not be using Visual Architect at the moment, remove the “Visual Architect.rsrc” file from the first segment of the project. A file called “Project Resources.rsrc”, located in its own segment, will also be created. This file contains essential TCL resources, some of which may be the same or similar to ones used by your original TCL project. You will have to determine which, if any, of your original resources you need to keep.

3. Add your sources into the last segment named “Application”.

Q. My Visual Architect application is dying in the debugger on a call to TCLGetWindow. It says it doesn’t know the type of my CWindow.

A. Every object instantiated by TCLGetWindow must be declared in a TCL_FORCE_REFERENCE() macro in your application’s ForceClassReferences() override. VA does this automatically for classes it knows about, but when you use your own classes in VA-generated code, you have to do it by hand. The usual suspects are CWindow (or CDialog), CScrollPane, CPanorama, etc. Or, check out the References.cp file generated by VA, which forces references to many standard TCL classes. Include this file in your project, and you’ll only have to worry about references to your own derived classes.

Q. What is the correct way of managing more than one document window?

A. The correct way is to create directors supervised by the document (or “main director”) for the second and additional windows.

Q. What happened to CObject in TCL 2.0.x?

A. This version of TCL is no longer rooted to a single CObject class. In fact, CObject no longer exist and must be removed from your own class hierarchy. The following classes can be used as root classes instead: CChore, CCollaborator, CTask, CStream, and CString. If you have added any functionality to CObject, they must be implemented elsewhere.

Q. How can I add persistence to my classes generated by Visual Architect?

A. At a minimum, you just define PutTo() and GetFrom() member functions for your class and - because Object I/O uses templates to get and put objects - expand the PutObject() and GetObject() functions in a file like CStream_CBitMap.cpp. (You don’t always have to do the latter; just for root classes.) For a more detailed discussion, look at the “Using CSaver.doc” in the “Supplementary Info.Π” located in the TCL Folder.

Q. Is it possible to test compiler options such as structure alignment during runtime in my C++ program?

A. Yes, you can with version 7.0.2 of the C++ compiler. A new feature in Symantec C++ 7.0.2 is being able to test and set various compiler options during run time as in Think C. Here’s how to do it:


/* 1 */
  #if __option(xxx)// Returns TRUE if option xxx is on 
  #pragma options(xxx,!yyy) // Turns option xxx on and option yyy off
 

The options are listed in a README file called “Compiler pragma options.”

Q. How do I call a code resource from my C++ program?

A. Here’s a small program (in C++) which calls a code resource. For this example the code resource takes 2 arguments, an int and a character pointer. It assumes that the resource has been merged into the project’s .rsrc with type CODE and name myCodeResource.


/* 2 */
/* UsesCodeResource.cpp */
#include <stdio.h>
extern "C" typedef void (*CRPtr) (int, char*);
void main()
{
 char myString[20];
 Handle myCRhandle;

 myCRhandle = GetNamedResource('CODE',"\pmyCodeResource");
 HLock(myCRhandle);
 (* (CRPtr) (*myCRhandle)) (5,myString);
 HUnlock(myCRhandle);
 printf("myString=\"%s\"\n",myString);
}

Q. THINK Inspector doesn’t seem to be showing me all the objects created in my program. Why not?

A. The Think Inspector will only display objects created from the heap. Objects created from the stack will not show up. For example,


/* 3 */
CMyClassmyObject;//will not show up
CMyClass*myObjectPtr = TCL_NEW(CMyClass, (args)); //will show up

Q. Are there any issues with running Symantec C++ for Macintosh on my Power Mac?

A. Symantec C++ for Macintosh 7.0 runs emulated on the PowerMac without problem. If you’re still running version 6.x, make sure you turn OFF the Modern Memory Manager.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Call of Duty Warzone is a Waiting Simula...
It's always fun when a splashy multiplayer game comes to mobile because they are few and far between, so I was excited to see the notification about Call of Duty: Warzone Mobile (finally) launching last week and wanted to try it out. As someone who... | Read more »
Albion Online introduces some massive ne...
Sandbox Interactive has announced an upcoming update to its flagship MMORPG Albion Online, containing massive updates to its existing guild Vs guild systems. Someone clearly rewatched the Helms Deep battle in Lord of the Rings and spent the next... | Read more »
Chucklefish announces launch date of the...
Chucklefish, the indie London-based team we probably all know from developing Terraria or their stint publishing Stardew Valley, has revealed the mobile release date for roguelike deck-builder Wildfrost. Developed by Gaziter and Deadpan Games, the... | Read more »
Netmarble opens pre-registration for act...
It has been close to three years since Netmarble announced they would be adapting the smash series Solo Leveling into a video game, and at last, they have announced the opening of pre-orders for Solo Leveling: Arise. [Read more] | Read more »
PUBG Mobile celebrates sixth anniversary...
For the past six years, PUBG Mobile has been one of the most popular shooters you can play in the palm of your hand, and Krafton is celebrating this milestone and many years of ups by teaming up with hit music man JVKE to create a special song for... | Read more »
ASTRA: Knights of Veda refuse to pump th...
In perhaps the most recent example of being incredibly eager, ASTRA: Knights of Veda has dropped its second collaboration with South Korean boyband Seventeen, named so as it consists of exactly thirteen members and a video collaboration with Lee... | Read more »
Collect all your cats and caterpillars a...
If you are growing tired of trying to build a town with your phone by using it as a tiny, ineffectual shover then fear no longer, as Independent Arts Software has announced the upcoming release of Construction Simulator 4, from the critically... | Read more »
Backbone complete its lineup of 2nd Gene...
With all the ports of big AAA games that have been coming to mobile, it is becoming more convenient than ever to own a good controller, and to help with this Backbone has announced the completion of their 2nd generation product lineup with their... | Read more »
Zenless Zone Zero opens entries for its...
miHoYo, aka HoYoverse, has become such a big name in mobile gaming that it's hard to believe that arguably their flagship title, Genshin Impact, is only three and a half years old. Now, they continue the road to the next title in their world, with... | Read more »
Live, Playdate, Live! – The TouchArcade...
In this week’s episode of The TouchArcade Show we kick things off by talking about all the games I splurged on during the recent Playdate Catalog one-year anniversary sale, including the new Lucas Pope jam Mars After Midnight. We haven’t played any... | Read more »

Price Scanner via MacPrices.net

Deal Alert! B&H Photo has Apple’s 14-inch...
B&H Photo has new Gray and Black 14″ M3, M3 Pro, and M3 Max MacBook Pros on sale for $200-$300 off MSRP, starting at only $1399. B&H offers free 1-2 day delivery to most US addresses: – 14″ 8... Read more
Department Of Justice Sets Sights On Apple In...
NEWS – The ball has finally dropped on the big Apple. The ball (metaphorically speaking) — an antitrust lawsuit filed in the U.S. on March 21 by the Department of Justice (DOJ) — came down following... Read more
New 13-inch M3 MacBook Air on sale for $999,...
Amazon has Apple’s new 13″ M3 MacBook Air on sale for $100 off MSRP for the first time, now just $999 shipped. Shipping is free: – 13″ MacBook Air (8GB RAM/256GB SSD/Space Gray): $999 $100 off MSRP... Read more
Amazon has Apple’s 9th-generation WiFi iPads...
Amazon has Apple’s 9th generation 10.2″ WiFi iPads on sale for $80-$100 off MSRP, starting only $249. Their prices are the lowest available for new iPads anywhere: – 10″ 64GB WiFi iPad (Space Gray or... Read more
Discounted 14-inch M3 MacBook Pros with 16GB...
Apple retailer Expercom has 14″ MacBook Pros with M3 CPUs and 16GB of standard memory discounted by up to $120 off Apple’s MSRP: – 14″ M3 MacBook Pro (16GB RAM/256GB SSD): $1691.06 $108 off MSRP – 14... Read more
Clearance 15-inch M2 MacBook Airs on sale for...
B&H Photo has Apple’s 15″ MacBook Airs with M2 CPUs (8GB RAM/256GB SSD) in stock today and on clearance sale for $999 in all four colors. Free 1-2 delivery is available to most US addresses.... Read more
Clearance 13-inch M1 MacBook Airs drop to onl...
B&H has Apple’s base 13″ M1 MacBook Air (Space Gray, Silver, & Gold) in stock and on clearance sale today for $300 off MSRP, only $699. Free 1-2 day shipping is available to most addresses in... Read more
New promo at Visible: Buy a new iPhone, get $...
Switch to Visible, and buy a new iPhone, and Visible will take $10 off their monthly Visible+ service for 24 months. Visible+ is normally $45 per month. With this promotion, the cost of Visible+ is... Read more
B&H has Apple’s 13-inch M2 MacBook Airs o...
B&H Photo has 13″ MacBook Airs with M2 CPUs and 256GB of storage in stock and on sale for $100 off Apple’s new MSRP, only $899. Free 1-2 day delivery is available to most US addresses. Their... Read more
Take advantage of Apple’s steep discounts on...
Apple has a full line of 16″ M3 Pro and M3 Max MacBook Pros available, Certified Refurbished, starting at $2119 and ranging up to $600 off MSRP. Each model features a new outer case, shipping is free... Read more

Jobs Board

Medical Assistant - Surgical Oncology- *Apple...
Medical Assistant - Surgical Oncology- Apple Hill Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Business Analyst | *Apple* Pay - Banco Popu...
Business Analyst | Apple PayApply now " Apply now + Apply Now + Start applying with LinkedIn Start + Please wait Date:Mar 19, 2024 Location: San Juan-Cupey, PR Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.