Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Hi, I have questions on using callbacks functions in Delphi. I am using a dll. In this DLL there is a call to a function that returns the response to a callback function. everything works great.
My question is how can I access that information return to the callback function from an existing class in Delphi.
TfrmMain = class(TForm)
//call back function
TGetHttpResponse = procedure(Buffer : Pchar; Id:integer ); stdCall;
//call to dll
id:integer): integer; stdcall; external 'winhttp_dll.Dll' name '_HttpRequest@32';
//definition to callback
procedure getresponse(aBuffer : Pchar; aId:integer ); stdCall;
// I would like to pass abuffer to writetoscreen procedure that
belongs to TFrmMain
PS: i know i can use a global variable but thats out of the question because this is a threaded application where i am trying to used this in.. thanks for your help