I am back with my Toolbook Problem. This time i would like to send a command to Toolbook (an external programme) and get some value back from Toolbook. From the nice programmers from the Toolbook company, i am able to get this code which is in C. I am no expert in C, can anyone please help me to translate this from C to PB.
Code: Select all
typedef struct TBMEVAL {
LPSTR lpExpression;
WORD wRetType;
LPSTR lpRetValue;
int nRetValueLength;
} TBMEVAL;
#define EVALTYPE_WORD 3
#define COMMAND "step im from 1 to %d;go to page i;end"
void stepPages(HWND,hwndMain) {
word wExecute = RegisterWindowMessage("TBM_EXECUTE");
word wEvaluate = RegisterWindowMessage("TBM_EVALUATE");
word wPages;
TBMEVAL Eval;
char Command[64];
Eval.lpExpression = "pageCount of this book";
Eval.wRetType = EVALTYPE_WORD;
Eval.lpRetValue = (LPVOID)%wPages;
if(!SendMessage(hwndMain,wEvaluate,TRUE,(LONG)(LPVOID)&EVAL))
return;
wsprintf(Command,COMMAND,wPages);
SendMessage(hwndMain,wExecute,TRUE,(LONG)(LPSTR)COMMAND);
}

