473,402 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

LPTSTR in vc.net

Hi,

How can i use LPTSTR in VC++.NET application ?
the same question for HINSTANCE, and HANDLE types.

Should i use a MarshalAs and to which type ?
thanks,

Al.
Oct 14 '06 #1
4 1291

"--== Alain ==--" <no****@noemail.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
Hi,

How can i use LPTSTR in VC++.NET application ?
the same question for HINSTANCE, and HANDLE types.
Just use it (them). There is nothing stopping you.

Should i use a MarshalAs and to which type ?
thanks,
What on earth for? VC++.NET can handle native types just fine.

Brian
Oct 14 '06 #2
But it's not so easy as 1,2,3.

i tried to use
LPTSTR szTest = "Hi my namse is...";
String^ strMine="";
strMine = String::Format("{0}",(LPTSTR));

but it does not convert it :-(

Al.

Brian Muth wrote:
"--== Alain ==--" <no****@noemail.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
>Hi,

How can i use LPTSTR in VC++.NET application ?
the same question for HINSTANCE, and HANDLE types.

Just use it (them). There is nothing stopping you.

>Should i use a MarshalAs and to which type ?
thanks,

What on earth for? VC++.NET can handle native types just fine.

Brian

Oct 15 '06 #3
Hi Alain,

"--== Alain ==--" <no****@noemail.comwrote in message
news:es**************@TK2MSFTNGP02.phx.gbl...
But it's not so easy as 1,2,3.

i tried to use
LPTSTR szTest = "Hi my namse is...";
String^ strMine="";
strMine = String::Format("{0}",(LPTSTR));

but it does not convert it :-(
Marshal.PtrToStringAnsi/Uni/Auto will convert your native string

--
SvenC
Al.

Brian Muth wrote:
>"--== Alain ==--" <no****@noemail.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl. ..
>>Hi,

How can i use LPTSTR in VC++.NET application ?
the same question for HINSTANCE, and HANDLE types.

Just use it (them). There is nothing stopping you.

>>Should i use a MarshalAs and to which type ?
thanks,

What on earth for? VC++.NET can handle native types just fine.

Brian
Oct 15 '06 #4
That's a completely different question: How do I convert from LPTSTR to a
..NET String?

SvenC has anwered this.

Brian
Oct 15 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: sorty | last post by:
Hi, I have read in many places that TCHAR can be 'char' or 'wchar_t' depending on ANSI or UNICODE. I have also read that LPTSTR is a long pointer to a TCHAR. I am confused about the...
9
by: alex | last post by:
how do i initialize an LPTSTR variable? i'm trying to call a microsoft function LONG QueryStringValue( LPCTSTR pszValueName, LPTSTR pszValue, ULONG* pnChars ) throw( );pszValue is supposed...
3
by: free2cric | last post by:
Hi , is this correct to have final LPTSTR to char * CString fname(argv ); LPTSTR p1 = fname.GetBuffer(fname.GetLength()); char teststr; sprintf(teststr,"%s",p1); //or strcpy(teststr,p1); ...
1
by: Steven Blair | last post by:
Hi there. Having a problem calling a win32 function from a dll. Here is the function header: DWORD thrdGetHcNum (DWORD nPort, DWORD nBaudrate, LPTSTR lpszHcNum) //Description of the 3rd...
3
by: Mark | last post by:
Help please... i am VERY new to the managed C++ and i need to take a System::String* and cast it to an LPTSTR how might i do this? I have searched the web and groups but cannot find any examples....
1
by: Lewap | last post by:
Hi! I've piece of code like follow: <code> LPTSTR lpszPipename = (LPTSTR) "\\\\.\\pipe\\testpipe"; hPipe = CreateNamedPipe(
8
by: **Developer** | last post by:
Been reading some of the Marshal doc and am a little confused. Anyway, I've been using the following and it works OK. Public Declare Auto Function SHGetFolderPath Lib "shell32.dll" (ByVal hWnd...
2
by: Abhishek | last post by:
how to do convert a std::string to LPTSTR (chat *) datatype regards Abhishek
6
by: pskumaran | last post by:
Hi All, I am trying to convert LPTSTR to char* by using sprintf, But sprintf copies only the first character from the string. i tried both array and pointer also , but the result is same. Here is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.