3
Reply

How to get address of a string?

sjones

sjones

Apr 21 2004 3:24 PM
2.1k
I took this from some sample code: [StructLayout(LayoutKind.Sequential)] public class BrowseInfo { public int hWndOwner; public int pIDLRoot; public int pszDisplayName; public int lpszTitle; public int ulFlags; public CallBack lpfnCallback; public int lParam; public int iImage; } I need to set the lpszTitle to a pointer to a string. The sample I took this from uses this: bi.lpszTitle = lstrcat(strTitle, ""); to do it, because the lstrcat WinAPI returns the address. The code does not concatenate the string, it seems to only be doing this to get the address. There has to be a more direct way. I already tried the "&" and the compiler complained about trying to get the address of a managed type.

Answers (3)