Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Opening a console window from a Windows form project Pin
David Crow24-Jul-06 8:55
David Crow24-Jul-06 8:55 
Questionmouse & keyboard disabling Pin
RomTibi24-Jul-06 8:06
RomTibi24-Jul-06 8:06 
AnswerRe: mouse & keyboard disabling Pin
Chris Losinger24-Jul-06 8:36
professionalChris Losinger24-Jul-06 8:36 
AnswerRe: mouse & keyboard disabling Pin
Steve Echols24-Jul-06 14:08
Steve Echols24-Jul-06 14:08 
GeneralRe: mouse & keyboard disabling Pin
RomTibi25-Jul-06 7:47
RomTibi25-Jul-06 7:47 
QuestionTile View problem when using Owner Data [modified] Pin
Justin Tay24-Jul-06 7:54
Justin Tay24-Jul-06 7:54 
QuestionPreTranslateMessage not called?? [modified] Pin
Rob Hounsell24-Jul-06 7:40
Rob Hounsell24-Jul-06 7:40 
QuestionPassing a variable Pin
DanYELL24-Jul-06 7:16
DanYELL24-Jul-06 7:16 
I have this code:

<br />
if (a = 1) dwID = IDC_EDIT1;<br />
if (a = 2) dwID = IDC_EDIT2;<br />
if (a = 3) dwID = IDC_EDIT3;<br />
<br />
GetString(pView, dwID);<br />


And then this function:

<br />
CString GetString(CView *pView, UINT dwID)<br />
{<br />
   CString str;<br />
<br />
   CWnd *pWndChild = pView->GetDlgItem( (UINT)dwID);<br />
   pWndChild->GetWindowText(str);<br />
<br />
   return str;<br />
}<br />


If I just called GetString(pView, IDC_EDIT1), the code works. But if I
use:

<br />
if (a = 1) dwID = IDC_EDIT1;<br />
if (a = 2) dwID = IDC_EDIT2;<br />
if (a = 3) dwID = IDC_EDIT3;<br />


I get an "unhandled exception" and it points to this code:

<br />
void CWnd::GetWindowText(CString& rString) const<br />
{<br />
	ASSERT(::IsWindow(m_hWnd));<br />


Is there any way I can call

GetString(pView, dwID)

or something like this instead of

GetString(pView, IDC_EDIT1);

Please, any response any one can give me will be greatly appreciated.

Sincerely,
Danielle Brina
AnswerRe: Passing a variable [modified] Pin
Harold_Wishes24-Jul-06 7:24
Harold_Wishes24-Jul-06 7:24 
GeneralRe: Passing a variable Pin
DanYELL24-Jul-06 7:40
DanYELL24-Jul-06 7:40 
GeneralRe: Passing a variable Pin
DanYELL24-Jul-06 7:44
DanYELL24-Jul-06 7:44 
QuestionRe: Passing a variable Pin
David Crow24-Jul-06 8:05
David Crow24-Jul-06 8:05 
AnswerRe: Passing a variable Pin
prasad_som24-Jul-06 19:00
prasad_som24-Jul-06 19:00 
Questioncin issues [modified] Pin
Harold_Wishes24-Jul-06 6:52
Harold_Wishes24-Jul-06 6:52 
AnswerRe: cin issues Pin
David Crow24-Jul-06 6:54
David Crow24-Jul-06 6:54 
GeneralRe: cin issues [modified] Pin
Harold_Wishes24-Jul-06 7:07
Harold_Wishes24-Jul-06 7:07 
QuestionRe: cin issues Pin
David Crow24-Jul-06 7:52
David Crow24-Jul-06 7:52 
AnswerRe: cin issues Pin
Harold_Wishes24-Jul-06 8:08
Harold_Wishes24-Jul-06 8:08 
GeneralRe: cin issues Pin
David Crow24-Jul-06 8:32
David Crow24-Jul-06 8:32 
GeneralRe: cin issues Pin
Zac Howland24-Jul-06 9:13
Zac Howland24-Jul-06 9:13 
GeneralRe: cin issues Pin
David Crow24-Jul-06 9:22
David Crow24-Jul-06 9:22 
GeneralRe: cin issues Pin
Zac Howland24-Jul-06 9:30
Zac Howland24-Jul-06 9:30 
GeneralRe: cin issues [modified] Pin
Harold_Wishes24-Jul-06 9:28
Harold_Wishes24-Jul-06 9:28 
GeneralRe: cin issues Pin
Harold_Wishes24-Jul-06 9:23
Harold_Wishes24-Jul-06 9:23 
GeneralRe: cin issues Pin
Zac Howland24-Jul-06 9:34
Zac Howland24-Jul-06 9:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.