Various Problems

Ken Ray kray at sonsothunder.com
Sat May 24 15:03:00 EDT 2003


123456789012345678901234567890123456789012345678901234567890123456789012
34567890

> Hi Ken, Thanks for taking the time and effort to help me out. Here is
my 
> responses to your responses. The locked CD problem has given me the
biggest 
> headaches.

> > > 1. Do you ever notice that popup menus that have more than 100
items
> > > do not return the selected item every time? Espectially items near

> > > the bottom of the list? Any workarounds? 
> > 
> > No, actually, I hadn't. Are these menus of type 'popup' (that is,
not
> > 'option' or 'pulldown')? If so, do you get no 'menuPick' message, or
do
> > you get one but the button label doesn't update?
> 
> Response: The itemed that is returned is a different item near the
beginning 
> of the list I didn't select. 

Hmm... I just loaded up a popup menu with 150 items and checked it on my
OS X
machine and it worked fine. So a couple of additional questions: Is this

happening in Mac or Windows or both? Is it a 'popup' menu button, or a
button 
of type 'option' or 'pulldown'? Is the popup menu positioned on your
card near 
the bottom of the screen? (This may have something to do with the way MC
handles scrolling popup menus.)

> > > 2. Do you ever notice that printing a second page can sometimes
> > > interrupt the printing of the first page? I did not see a "Wait 
> > > until the printing is done "command. Is there one?
> > 
> > Not that I'm aware of. Is this a two-card stack that you're printing
> > (i.e. a single 2-page print job) or two separate cards (i.e. 2
separate
> > print jobs)?
>
> Response: two separate cards. I had to put in a 50 second wait to 
> insure that the first card prints out completely. Supercard has a 
> "Wait until the printing is done" command, I believe. Metacard doesn't

When you say "interrupt the printing of the first page", can you
describe 
what is happening? And to what printer you're trying to print to? That
might help in trying to track this down.

> > > 3. Do you ever notice that copying and pasting an icon for a file
or
> > > folder is easy on the Mac, just pasting into the "Get Info" box? 
> > > Isn't there an easy way to do it on Windows?
> > 
> > Well, it depends. If you're doing it manually, you can change the
icon
> > of an executable through the Properties window. In Windows XP, you
can
> > also do that with folders, but files get their icons from the
Registry
> > based on their file association to an executable, so you really
can't
> > change it.
> 
> Response: So how do people usually add icons to Metacard applications?

> Is it easy? What and where is the registry?

Well, to add an icon to MC apps, you can create one using a painting 
program, save it as a Windows Icon File (*.ico), and then in the process

of building a standalone you can point to the icon file that you 
created. This will "build in" the icon into the standalone. However the 
icon can only be 16 colors, and must be an exact number of bytes. There 
is a Windows program that many here have used called Qtam Bitmap to Icon

(http://www.qtam-computer.com/bmp2ico35.html) that takes a graphic file 
like a JPG and converts it to the proper size (just pick 32x32 icons 
with 16 colors).

The Registry is like a centralized preferences file that maintains the 
preferences for all apps on a Windows machine. It would be like taking 
the OS 9 Preferences folder and collapsing that folder/file/contents 
hierarchy into a single file that was like an outline. You can take a 
look at it by going to Start -> Run and typing "regedit" and hitting 
return. This brings up the Registry editor, which displays everything 
in a tree structure. In fact you can refer to the nodes in the tree 
using "\" notation (see below). 

The Registry is broken up into 6 (usually) main categories 
(or "roots"), but the main one for your purposes is 
HKEY_CLASSES_ROOT (also referred to sometimes as "HKCR") - This holds 
information about file extensions and what applications they belong 
to. For example, for MetaCard, the HCKR entry for '.mc' points to an 
application named "MetaCard". You would then scroll down in HKCR until 
you found the entry for "MetaCard", which when expanded has two child 
nodes: 'DefaultIcon' and 'shell'. 

  'DefaultIcon' says where to pull the icon for the app from, and has 
two comma-delimited items - the first one is the path to the 
executable, and the second item is the index number into the 
application's resources that points to the icon to use. In MC's case, 
it is always '1'.

  'shell' is the tree structure to determine how the OS should handle 
opening, printing, etc. a file with the file extension associated 
with the application (in this case, ".mc"). In the case of MC, if you 
toggle open 'shell', you see 'open'; toggle that open and you see 
'command'. Click on 'command', and the value provides a path to the 
MC application and a '%1', which is a placeholder for the file path
to the file you open. 

  Here's how it all works: If you 2x-click on a '.mc' file, Windows 
looks in the Registry in HKCR to find the owner of the '.mc' file
extension, which is "MetaCard". It then looks in HKCR for the path 
HKCR\MetaCard\shell\open\command and takes the file path of the file 
you're trying to open and replaces '%1' with that path. It then 
launches the application using the path to the MC app found there and 
the .mc file path is passed as a 'command-line parameter' to the MC 
app, which retrieves it internally as $1. For more info, see the 
tip at my site: 

  http://www.sonsothunder.com/devres/metacard/metacard.htm?file004


> > > 4. Do you ever notice that unlocked files on the CD turn to locked
> > > files even after you drag them to the hard disk? (I know there is 
> > > a Shell() command, but it doesn't work on Windows ME. I just 
> > > cannot find a workaround. 
> > 
> > The shell command with 'attrib -r' does work in ME; perhaps you have
a
> > file path with spaces in it? For example, I have a file on the "C:"
> > drive called "test.txt". When I do this;
> > 
> > on mouseUp
> >   set the hideConsolewindows to true
> >   get shell("attrib -r c:\test.txt")
> > end mouseUp
> > 
> > It works to change the read only flag. However, if I move it to the
"My
> > Documents" folder, you have to use quotes around the filename
because it
> > includes spaces:
> > 
> > on mouseUp
> >   set the hideConsolewindows to true
> >   get shell("attrib -r " & quote & "c:\My Documents\test.txt" &
quote)
> > end mouseUp
> 
> Response: I tested both versions of the commands seperately on a
Windows 
> ME machine. The app crashe! d both times. I had to take out the
command 
> completely. It was difficult, because it was my last and best option
for 
> solving this problem. (Richard G recommended adding an installer
program 
> to avoid the problem, but my publisher nixed the idea as being to time

> consuming to beta test.)

Max, what version of MC are you using? Can you post the script that you
used 
that crashed so I can take a look at it? What kind of crash did you get?

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/ 





More information about the metacard mailing list