adchar43
asked on
How to draw/get a text string in a Field
I am programing a simple database application for Palm using Palm Development Suite downloaded from http://www.palmsource.com.
I got a problem when putting a text in a Field Control.
Some Field Function can do this but they all need FieldType Pointer such as:
void FldSetText (
FieldType *fldP,
MemHandle textHandle,
UInt16 offset,
UInt16 size
)
Char *FldGetTextPtr (
const FieldType *fldP
)
.....
And i don't know how to get this Pointer. All i have here is FieldID only. I also need to get a Pointer(FormType*) of a Form when having it's ID.
I want that when i click on a button, my Field has to show a given text string.
Help me, thanks.
I got a problem when putting a text in a Field Control.
Some Field Function can do this but they all need FieldType Pointer such as:
void FldSetText (
FieldType *fldP,
MemHandle textHandle,
UInt16 offset,
UInt16 size
)
Char *FldGetTextPtr (
const FieldType *fldP
)
.....
And i don't know how to get this Pointer. All i have here is FieldID only. I also need to get a Pointer(FormType*) of a Form when having it's ID.
I want that when i click on a button, my Field has to show a given text string.
Help me, thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Could you please post all the code and the error message to try to figure out whats happening?
Thnks
Ivan Rivera
Thnks
Ivan Rivera
ASKER
I founded my error, that i can not get the pointer of the Main Form and that cause this error.
My new PROBLEM here :D
I CAN NOT GET THE POINTER OF THE MAINFORM, AND I DON'T KNOW WHY
https://www.experts-exchange.com/questions/21222707/Strange-problem-with-getting-Form-pointer.html
My new PROBLEM here :D
I CAN NOT GET THE POINTER OF THE MAINFORM, AND I DON'T KNOW WHY
https://www.experts-exchange.com/questions/21222707/Strange-problem-with-getting-Form-pointer.html
ASKER
I use this function:
static void *GetObjectPtr(UInt16 rsrcID) //<== COPY FROM DOCS
{
FormPtr formP;
formP = FrmGetActiveForm();
return FrmGetObjectPtr(formP, FrmGetObjectIndex(formP, rsrcID));
}
Fieldp = (FieldType *)GetObjectPtr(fieldFirstN
------------
In your post above, is the function getObjectPtr the same with my function?
I have the ID of the field resource, i want to set a text on this field, the text from Char * string(to test) not from my database.
Thanks
---------------------
On your code above:
FieldPtr fld; // THIS IS THE FIELD POINTER
fld = GetObjectPtr (NoteField); // HERE YOU GET THE INFO
---------------------
Is the function GetObjectPtr the same with my function and is NoteField = Your field ID?