🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.tools.mfc
Article #34

Re: HELP - CString conversion?

#34
From: Richard Clarke
Date: Tue, 23 Jan 1996 21:18
46 lines
2000 bytes
In article <NEWTNews.16531.822443361.Postmaster@Jerusalem.netvision.net.il>
           iti@Jerusalem.netvision.net.il  writes:

> 
> 
> When I try to read the text from a Edit Control (IDC_EDIT1) with the
> following code:
> 
> --------------------------------------------------------------
> CString callBuf;
> int msgLen = GetDlgItemText(IDC_EDIT1, callBuf, sizeof(callBuf));
> --------------------------------------------------------------
> 
> I get the following error:
> 
> --------------------------------------------------------------
> error C2664: 'GetDlgItemText' : cannot convert parameter 2 from 'class 
> 
> ::CString ' to 'char __far *'
> --------------------------------------------------------------
> 
> 
> I am using Visual C++, how can I read the text directly into the CString?
> I know that I am doing something REAL STUPID so if you can be of any help-
> 
> Please send any advice you have for me to my EMail address:
>         iti@netvision.net.il
> 
> Thanks
> Yaakov
> 
> 

Unless I am much mistaken, this should do what you want
 
  CString strTest;
  ((CEdit *)GetDlgItem(IDC_EDIT1))->GetWindowText(strTest);

I am not emailing this because the point of newsgroups is
to share information and benefit the developer community,
not to answer 1 developer's question.

Good luck!

-- 
Richard Clarke
Technical Details
Message-ID: <822431890snz@richardc.demon.co.uk>
Path: arc1-ca.pugleaf.net!mail2news.demon.co.uk!richardc.demon.co.uk
References: <NEWTNews.16531.822443361.Postmaster@Jerusalem.netvision.net.il>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!mail2news.demon.co.uk!richardc.demon.co.uk
From: Richard Clarke <Richard@richardc.demon.co.uk>
Newsgroups: comp.os.ms-windows.programmer.tools.mfc,comp.os.ms-windows.apps.compatibility.win95,comp.lang.c++
Subject: Re: HELP - CString conversion?
Date: Tue, 23 Jan 96 21:18:10 GMT
Organization: Insert-Organisation-Here
Message-ID: <822431890snz@richardc.demon.co.uk>
References: <NEWTNews.16531.822443361.Postmaster@Jerusalem.netvision.net.il>
Reply-To: Richard@richardc.demon.co.uk
X-NNTP-Posting-Host: richardc.demon.co.uk
X-Newsreader: Demon Internet Simple News v1.29
X-Mail2News-Path: richardc.demon.co.uk