473,513 Members | 2,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CString to char* conversion VC++

24 New Member
can someone help me to convert a CString to a char*?I'm working on VC++(with MFC)
I tried the following code:
Expand|Select|Wrap|Line Numbers
  1. int len = m_adresse_ip.GetWindowTextLength()+1;
  2. LPTSTR  ip_adress= new TCHAR[len]; 
  3. m_adresse_ip.GetWindowText(ip_adress,len);
  4. theApp.ConnectToServer(ip_adress,Port);
  5.  
error:
Expand|Select|Wrap|Line Numbers
  1. can not convert from LPTSTR to char*
  2.  
(because the first function parameter is char*)

so I tried to change Unicode by MBCs but I find this error:
Expand|Select|Wrap|Line Numbers
  1. general error c101008a: Failed to save the updated manifest to the file ".\Debug\Client.exe.embed.manifest". Paramhtre incorrect.    
  2.  
  3.  
Can someone help me please?
Mar 7 '11 #1
0 1265

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

Similar topics

2
26404
by: Ying Yang | last post by:
Hi, What is the simplest way of converting an int into a char*? I realized type casting did not work for some reason. Anyway, I'm looking for just a single line statement, which can do this. ...
2
21876
by: Mendon?a | last post by:
I cant seem to find on borland help files anything about AnsiString to char conversion. Just the opposite. Can u help me?
1
5093
by: Eric Sommer | last post by:
I've been battling with this a little bit. The Marshal class Copy method should do this. but...... I have the following (simple - not real code) String * strString =...
9
12198
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,...
3
7993
by: Q. John Chen | last post by:
It should be easy but I am not familier with javascript. I have a string that is encoded simply by replacing the letter with the next letter in the alphabeta. I need a function to convert it...
4
12268
by: jim_geissman | last post by:
I have data tables that include ZIP code, as char(5). The values look like integers, but they are padded with leading zeroes to fill out 5 characters, '00234'. There are SPs to look up data,...
34
31225
by: Perro Flaco | last post by:
Hi! I've got this: string str1; char * str2; .... str1 = "whatever"; .... str2 = (char *)str1.c_str();
1
5570
by: TDK02 | last post by:
Hi, I need someones help to Convert C++ strings to a C-style string (char*) in VC++ 6.0. What I need to do is something as follows. There is a string as, string sh = “hello”;
4
22129
by: jsl | last post by:
how to convert a 'const char *' to 'char *' in vc++
2
1324
by: selvialagar | last post by:
i'm new to vc++.net...I'm doing a project to send a packet to another machine like ping command...in this i'm using sendto() function..i have to convert all the class parametes to char*... my code...
0
7166
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
7386
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
7543
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
7534
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
5689
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,...
1
5094
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...
0
3226
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
459
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.