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

getbytes function

hi, I'm working on vc++ with MFC( MBCs) and I want to convert a string to a byte array.
Expand|Select|Wrap|Line Numbers
  1. char* buffer= new char[6];
  2. buffer="ABF010101D9";
  3. CString str(buffer);
  4.  
  5. byte_buffer = str.getBytes();
  6.  
but there is an error:
Expand|Select|Wrap|Line Numbers
  1. error C2039: 'getBytes': is not a member of 'ATL::CStringT<BaseType,StringTraits>'    
  2.  
thanks for help
Mar 16 '11 #1
1 2129
Plater
7,872 Expert 4TB
That is a java function, not a .NET function.
Look up the Encoding classes (most commonly Encoding.ASCII.GetBytes() )
Mar 17 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Tiraman | last post by:
Hi , I have a Stored Procedure that return an xml (by using the xml auto or explicit) in to some XmlReader and i m getting the following error . Invalid attempt to GetBytes on column ''....
5
by: cloudx | last post by:
Hi there, I have got the following piece of VB code to be translated to C#, I used System.Text.Encoding.Default.GetBytes(myStr, 1, 10, aBytes, 0) but the result of aBytes is different from what...
16
by: les | last post by:
I'm trying to http post xml data to a remote server and I get this error: BC30518: Overload resolution failed because no accessible 'GetBytes' can be called with these arguments: Line 20: Dim...
2
by: Guoqi Zheng | last post by:
Sir, When I call the asc function to return an interger value of one byte. it can only return up to 128, which function I can use to return > 128? I use ascw, but it seems to be the same, so I...
1
by: devgrt | last post by:
Checking if proper/best way to do this... I have to pass a C# string to a C++ DLL. The function in the DLL (gethostbyname) requires a null terminated string. It seems like when you do byte var =...
1
by: Noah Roberts | last post by:
Trying to use boost::function in a C++/CLI program. Here is code: pragma once #include <boost/function.hpp> #include <boost/shared_ptr.hpp> #include <vector> using namespace System;
10
by: Victor | last post by:
hi guys. In my project, now I am using a asp.net login control and a customized membership provider to do the form authentication. Now I want some function that user can skip the login form and be...
1
by: DR | last post by:
mySqlBytes.buffer is getting converted to BigEndian even though both SQL server 2005 and the CLR function are on the same machine which shows BitConverter.IsLittleEndian == true in tsql: select...
5
by: DaveD | last post by:
Can anyone help me get this compiled ? void Write<T>(T val) { byte bytes = BitConverter.GetBytes(val); Array.Reverse(bytes); writer.Write(bytes); } The problem is that for T=bool,...
1
by: ahmee | last post by:
please explain getbytes method in string with simple examples and let me lknw why it is used
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.