473,385 Members | 1,610 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,385 software developers and data experts.

LPCTSTR and HRESULT

Hello everyone,
If I want to convert LPCTSTR and HRESULT to standard C/C++ data type (like
char*, int, long, etc.), I am wondering what standard data types should I
convert to be safe and do not lose and data precise?
thanks in advance,
George
Jul 27 '07 #1
2 1982
George wrote:
Hello everyone,
If I want to convert LPCTSTR and HRESULT to standard C/C++ data type (like
char*, int, long, etc.), I am wondering what standard data types should I
convert to be safe and do not lose and data precise?
George:

LPCTSTR is just a typedef for const TCHAR*.

HRESULT I'm not sure, but it can be converted to an SCODE, which is a
DWORD, which is unsigned int.
--
David Wilkinson
Visual C++ MVP
Jul 27 '07 #2
Thanks David,
I find in winnt.h, HRESULT is defined to long.
regards,
George

"David Wilkinson" wrote:
George wrote:
Hello everyone,
If I want to convert LPCTSTR and HRESULT to standard C/C++ data type (like
char*, int, long, etc.), I am wondering what standard data types should I
convert to be safe and do not lose and data precise?

George:

LPCTSTR is just a typedef for const TCHAR*.

HRESULT I'm not sure, but it can be converted to an SCODE, which is a
DWORD, which is unsigned int.
--
David Wilkinson
Visual C++ MVP
Jul 28 '07 #3

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

Similar topics

2
by: Tom | last post by:
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
1
by: ebobnar | last post by:
I need to call the function LoadImage which take a LPCTSTR argument to specify the path to the image to load. However, I need to create this path dynamically from user input by concatenating...
8
by: ppcdev | last post by:
Here's what I try : LPCTSTR tst = (LPCTSTR) (LPCWSTR) Marshal::StringToHGlobalUni(str); c:\MyNetPrj\Prj0001\stunt.cpp(244): error C2440: 'type cast' : cannot convert from 'System::IntPtr' to...
10
by: farseer | last post by:
How can i do this? i'd like to call the following code: .... string url = <my urld>; TCHAR* urlParams = GetParams( ); url.append( (char * ) urlParams ); GotoURL( ( LPCTSTR ) url ); ...
10
by: Lucy Ludmiller | last post by:
Anyone knows how to convert a LPCTSTR to an STL striung?. Can't seem to finda nyting (that dosen't blab on for several pages) on the net about how to do this
3
by: fooshm | last post by:
Hello, I'm trying to convert a String^ to LPCTSTR. When using : LPCTSTR str = static_cast<LPCTSTR>(Marshal::StringToHGlobalAnsi(gcString).ToPointer()); in order to convert how ever I'm...
14
by: =?Utf-8?B?Sm9hY2hpbQ==?= | last post by:
I have seen the following function to convert from a System::String^ to a const wchar_t*. I would like to get a LPCTSTR and AFAIK LPCTSTR is equal to const wchar_t*. Then it should all work right?...
7
by: justin001 | last post by:
In my _UNICODE & _MBCS build project, I have LPCTSTR string (i.e.it will be wchar_t*) .The following function is not giving proper result and instead it is producing junk data. I have confirmed it...
4
by: gw7rib | last post by:
I'm using a system in which TCHAR is typedef-ed to represent a character, in this case a wchar_t to hold Unicode characters, and LPCTSTR is typedef-ed to be a pointer to constant wchar_t. I presume...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.