Concat PChar with string in DelphiContent on this page is from Stackoverflow
I need to construct a string and send it via
FileName := String_1 + String_2 + String_3; PostMessage(FWndHandle, WM_BLA_BLA, NotifyData^.Action, LParam(FileName));
but something isn't working. Plus, FileName is a PChar. The code looks like this:
var FileName : PChar; Directory_Str : String; AnotherString : String; begin // Get memory for filename and fill it with data GetMem(FileName, NotifyData^.FileNameLength + SizeOf(WideChar)); Move(NotifyData^.FileName, Pointer(FileName)^, NotifyData^.FileNameLength); PWord(Cardinal(FileName) + NotifyData^.FileNameLength)^ := 0; // TODO: Contact string before sending message // FileName := AnotherString + Directory_Str + FileName; PostMessage(FWndHandle, WM_BLA_BLA, NotifyData^.Action, LParam(FileName)); ... end;
Now I need to do contact another string to the variable
FileName before calling
FileName := AnotherString + Directory_Str + FileName; PostMessage(FWndHandle, WM_BLA_BLA, NotifyData^.Action, LParam(FileName));
This would work if FileName was a string, which is not the case here.
Anyone knows how to do that with PChar? I tried these methods, works sometimes but always something breaks at the end:
StrPCopy(FileName, FDirectory + String(FileName));
FileName := PChar(AnotherString + Directory_Str + FileName);
View Local Answers... Can't find the answer to this question?
No answers yet.
Can you answer this question?
Concat PChar with string in Delphi
Can you answer these?
- Answer fetching a data from dropdown and gert it's corresponding data
- Answer Draw label with Custom Font
- Answer Error running rails generate devise User
- Answer Is there a better way of allocating/copying shared_array
- Answer Creating Activities in a Snapshot View in ClearCase
- Answer How to get the list of a folder from ftp using Listviewcontroller class from apples simpleFtpsample project
- Answer Reversing a HashMap <String, Object> to different Sets and/or Lists
- Answer 1 mod p: what is significance of this other than writing 1
- Answer how to display multiple images in php from database?
- Answer if-else in HAML (ruby on rails)