I am using Indy9 with Delphi7.
I would like to cast an Longword (Athread.Handle) back to an TIDPEERTHREAD Pointer.
Is there a way how I could do this?
Or is there any other way I could “store” the Pointer to a Longword?
Thank you in Advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
TIdPeerThreadis aTThreaddescendant. ItsHandleproperty contains the OS-level thread handle fromCreateThread(). There is no way to cast aHandlevalue directly to aTIdPeerThreadobject pointer. You will have to either:1) Store the
TIdPeerThreadobject pointer itself in theLongWordinstead of theTIdPeerThread.Handlevalue, and then cast it back when needed:2) Store the
TIdPeerThead.Handlevalue in theLongWord, then loop through theTIdTCPServer.Threadslist looking for aTIdPeerThreadobject that has a matching value when needed: