LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using const in PDA external calls

LabVIEW PDA Module 7.1
WIndows XP
 
I am trying to use the Palm Data Manager library calls in my application.  I want to be able to save data between Palm sessions and look up data within the file by index or key value in order to identify and avoid storing duplicates.  The database would be transferred to a streaming file when I wanted to upload data to the PC. 
 
However, I have run into  problem as these calls include parameters such as  "const char* nameP".
 
I built a stub, per the PalmBatt sample, and a companion Palm OS C program, in which I define the constant to pass to the library function:

#include
<PalmOS.h>
#include <SystemMgr.h>
#include <DataMgr.h>

Err LvDmCreateDatabase (UInt16 cardNo,

char *NameP, UInt32 creator, UInt32 type, Boolean resDB)
{
const char* dbName = "PKSTagDB";
return DmCreateDatabase (cardNo, dbName, creator, type, resDB);
}

However, the library function, DmCreateDatabase, apparently calls other Palm OS functions that also have const parameters.  When I built a simple VI that called the DmCreateDatabase function, I got errors:
 
"Error   : illegal implicit conversion from 'unsigned char *' to
'const char *'
file2.c line 23    return DmFindDatabase (cardNo, nameP);
Error   : illegal implicit conversion from 'unsigned char *' to
'const char *'
file2.c line 34     appInfoIDP, sortInfoIDP, typeP, creatorP); "  [I believe this is the second line of a call to DmSet(or Get) DatabaseInfo.]
 
Is there a way to make these calls work from LabVIEW?
 
Thanks,
 
BevP
0 Kudos
Message 1 of 2
(2,413 Views)
"Error   : illegal implicit conversion from 'unsigned char *' to
'const char *'
file2.c line 23    return DmFindDatabase (cardNo, nameP);
Error   : illegal implicit conversion from 'unsigned char *' to
'const char *'
file2.c line 34     appInfoIDP, sortInfoIDP, typeP, creatorP); "
 
--------
 
The error says that nameP was declared as an "unsigned char" pointer, but the function DmFindDatabase expects nameP to be a "const char" pointer.
 
Did you declare the variable nameP yourself? It should be declared as
"const Char* nameP" instead of "unsigned char* nameP".
 
Regards,
miko
0 Kudos
Message 2 of 2
(2,389 Views)