473,396 Members | 2,013 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,396 software developers and data experts.

CString to BYTE* conversion

Wich way I can to take the BYTE*-pointer to a string of characters that
contain
into CString-object?
Nov 17 '05 #1
5 3979
>Wich way I can to take the BYTE*-pointer to a string of characters that
contain
into CString-object?


Igor,

Are you looking for the CString methods: GetBuffer & ReleaseBuffer?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #2
I'm looking for any method that can to receive a CString object as parametr
and
return a pointer of BYTE* type to the character string that are contained
into the
CString object.

"David Lowndes" <da****@example.invalid> wrote in message
news:5v********************************@4ax.com...
Wich way I can to take the BYTE*-pointer to a string of characters that
contain
into CString-object?


Igor,

Are you looking for the CString methods: GetBuffer & ReleaseBuffer?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Nov 17 '05 #3
>I'm looking for any method that can to receive a CString object as parametr
and
return a pointer of BYTE* type to the character string that are contained
into the
CString object.


As I said, have a look at GetBuffer & ReleaseBuffer.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #4
Thanks but it isn't help me. GetString metod is the solution. Thanks

"David Lowndes" <da****@example.invalid> wrote in message
news:bo********************************@4ax.com...
I'm looking for any method that can to receive a CString object as
parametr
and
return a pointer of BYTE* type to the character string that are contained
into the
CString object.


As I said, have a look at GetBuffer & ReleaseBuffer.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Nov 17 '05 #5
>Thanks but it isn't help me. GetString metod is the solution. Thanks

Are you sure?

You wanted a BYTE * (I presumed you wanted a buffer you could change).
Note that GetString returns a const pointer, and the documentation
says:

"The returned PCXSTR pointer is const and does not allow direct
modification of CSimpleStringT contents"

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #6

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

Similar topics

6
by: Markus Hämmerli | last post by:
I ' ll tra to convert a Cstring to char* without success. I working in a Unicode enabled environment this is working in Unicode CString source = _T("TestString"); TCHAR *szSource =...
0
by: Chris | last post by:
Hi all, Just converted our 95 project workspace file from VC++ 6.0 to .NET, and things have gone...um...pretty well. Down to the last of the suffering - our main server application is doing...
9
by: Fausto Lopez | last post by:
I'm getting the following error: 'strlen' : cannot convert parameter 1 from 'class CString' to 'const char *' when I try to compile the following code: HRESULT AnsiToUnicode(CString pszA,...
5
by: Paul | last post by:
Hi, Any one knows how to convert CString to LPCWSTR? Please advice, thanks! -P
5
by: Neo | last post by:
how convert CString to char *? regards, Mohammad Omer Nasir
0
by: npotnis | last post by:
Hi All, I am trying to compile an existing C++ unamanaged application with the /clr switch in VS.Net 2003, as I need to use managed extensions in the code. In a cpp file I have the following...
16
by: Norman Diamond | last post by:
In an antique obsolete version of MFC, a CString expression could be subscripted in order to retrieve one element. Visual Studio 2005 defines CSimpleStringT::operator. At first glance it looks...
1
by: YouPoP | last post by:
For a reason i don't know, if i convert a float to a cstring, it does not convert to an exact value for all values except round numbers or 1/2 numbers; the following code (used to convert and...
0
by: Carl Forsman | last post by:
given the following base64_encode function, I will read bytes from a file and encode the binary data into a single line CString; but something wrong with the following code with errors! ...
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
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.