Reply Peter and Tomas, is below, each... Thread pruned.
Show quoted text 8 lines
The s call in the message line was converted to a "pointer(s)". I found the FPC_INITIALIZEUNITS at Main, in the ASM output and understand now that the compiler handles this fully and that FPC_INITIALIZEUNITS could not be the issue. Perhaps this thread will help others new to FPC to know this too on the chance they may research it. Thank you. Present code is at bottom to thin down the thread.
Tomas below, may be onto it, as a threading issue. Thanks still for your help. Mike
Show quoted text 14 lines
Thanks Tomas.
1) Current function is below, due to pruning the thread.
1) Clearly I was off course on FPC_INITIALIZEUNITS
2) You're understanding is correct C++api > C+wrpr > Pascal as callback The wrapper is actually C code in a .cpp, for functionality
3) The API is multi-threaded, having dl'd a thread monitor, showing as many as 5 threads spawened to the API and accompanied executable. As well, a call back occurs by default from the API, at runtime, suggesting it fires off a single dummy callback event.
4) Can you suggest an approach on the Pasacl Initialization to the thread and/or some of the areas I should be looking up toward doing the work? Google is my friend. ;-)
Thank you again. Mike
//------- Current function model below here
function L1_Callback(quote : pointer) : integer; stdcall; export;
var
bid_price : single = 0.0;
s : ansistring = '';
begin
SendMessage(listbox, LB_ADDSTRING, 0, longint(Pchar('L1 Callback')));
// -- either commented below will cause crash
//SendMessage(listbox, LB_ADDSTRING, 0, longint(Get_secsym(quote)));
//bid_price := Get_l1_BidPrice(quote);
s := FloatToStr(bid_price);
SendMessage(ListBox,LB_ADDSTRING,0,Longint(pointer(s)))
end;