LPCTSTR

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Is there such a type in C#.

I have a C++ application that uses LPCTSTR to convert a
Long Pointer to a Constant String?

Thanks

Tom
 
Tom,

When making a call to a method/function in C# (through COM interop or
the P/Invoke layer), you will want to attribute the parameter with the
following:

[MarshalAs(UnmanagedType.LPTStr)]

Hope this helps.
 
Hi Tom,

LPCTSTR type is long pointer type, while there are no pointer in C#.
I think you want to use some C++ functions in .Net, you should refer to
P/invoke and COM interop.
And when invoking these functions, you must marshal the parameters, for
more information, you should search "interop" in MSDN, there are many
articles related to this topic.

If you still have anything unclear, please feel free to tell me.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Tom" <[email protected]>
| Sender: "Tom" <[email protected]>
| Subject: LPCTSTR
| Date: Tue, 21 Oct 2003 11:08:05 -0700
| Lines: 8
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcOX/kalM6P3xQ5CTw+ppmtHJ4T+lg==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:192940
| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Is there such a type in C#.
|
| I have a C++ application that uses LPCTSTR to convert a
| Long Pointer to a Constant String?
|
| Thanks
|
| Tom
|
 
Back
Top