On Mon, Jun 18, 2001 at 08:18:09PM +0400, Evgeny Rokhlin wrote:
> Hello, All!
>
> Here's an example for VFSVolumeMount function in Palm OS Reference:
>
> ***
>
> VFSSlotMountParamType slotParamP;
> UInt32 slotIterator = expIteratorStart;
> slotParamP.vfsMountParamP.mountClass = VFSMountClass_SlotDriver;
> err = ExpSlotEnumerate(&slotParamP.slotRefNum, &slotIterator);
> err = ExpSlotLibFind(slotParamP.slotRefNum, slotParamP.slotLibRefNum);
> err = VFSVolumeMount(NULL, NULL, (VFSAnyMountParamPtr)&slotParamP);
>
> ***
>
> Seems to contain mistakes:
> 1. VFSSlotMountParamType slotParamP;
> Why do they call the variable "slotParamP", not a "slotParam" - it is not a
> pointer.
> 2. slotParamP.vfsMountParamP.mountClass = VFSMountClass_SlotDriver;
> Seems that it must be slotParamP.vfsMountParam.mountClass = ...
> 3. ExpSlotLibFind(slotParamP.slotRefNum, slotParamP.slotLibRefNum);
> Should be ExpSlotLibFind(slotParamP.slotRefNum, &(slotParamP.slotLibRefNum))
> 4. (VFSAnyMountParamPtr)&slotParamP
> Why do they need such an odd conversion?
>
> SO, can anyone help me with a correct VFSVolumeMount example???
First, all these should be done automatically by the expansion manager...
> I managed to correct this example, but the program immediately exits after I
> call VFSVolumeMount!
It probably was already mounted. Did you see if any errors occured,
or did you assume success and simply went on like the example does.
> But, if I do not call VFSVolumeMount and pass "1" to VFSFileOpen instead of
> volRefNum, it works!
You don't want to mount the volumes, you want to enumerate them.
If you want a live example (my file manager that handles multiple
slots), look at www.palmboxer.com - GPL. ZCardZ and ZBoxZ (card.c)
contain examples that get directories.
> Please help!
> Eugene.
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe, please see
>http://www.palmos.com/dev/tech/support/forums/
--
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/