Click here to Skip to main content
15,884,298 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Time of reading text file Pin
econy11-Nov-14 6:56
econy11-Nov-14 6:56 
GeneralRe: Time of reading text file Pin
Richard MacCutchan11-Nov-14 7:05
mveRichard MacCutchan11-Nov-14 7:05 
GeneralRe: Time of reading text file Pin
econy11-Nov-14 7:17
econy11-Nov-14 7:17 
GeneralRe: Time of reading text file Pin
Richard MacCutchan11-Nov-14 7:25
mveRichard MacCutchan11-Nov-14 7:25 
AnswerRe: Time of reading text file Pin
Aescleal12-Nov-14 6:01
Aescleal12-Nov-14 6:01 
QuestionOptimized Solution for prime numbers.. Pin
Raunak Singh Chauhan6-Nov-14 6:20
Raunak Singh Chauhan6-Nov-14 6:20 
AnswerRe: Optimized Solution for prime numbers.. Pin
Nicolas Dorier6-Nov-14 6:45
professionalNicolas Dorier6-Nov-14 6:45 
GeneralRe: Optimized Solution for prime numbers.. Pin
Raunak Singh Chauhan6-Nov-14 6:49
Raunak Singh Chauhan6-Nov-14 6:49 
GeneralRe: Optimized Solution for prime numbers.. Pin
Nicolas Dorier6-Nov-14 6:56
professionalNicolas Dorier6-Nov-14 6:56 
AnswerRe: Optimized Solution for prime numbers.. Pin
Bernhard Hiller6-Nov-14 22:06
Bernhard Hiller6-Nov-14 22:06 
Questionget IP address from Net Address Control (Resolved) Pin
bkelly1310-Oct-14 16:06
bkelly1310-Oct-14 16:06 
AnswerRe: get IP address from Net Address Control Pin
Richard MacCutchan10-Oct-14 21:18
mveRichard MacCutchan10-Oct-14 21:18 
GeneralRe: get IP address from Net Address Control Pin
bkelly1311-Oct-14 9:11
bkelly1311-Oct-14 9:11 
GeneralRe: get IP address from Net Address Control Pin
Richard MacCutchan13-Oct-14 5:10
mveRichard MacCutchan13-Oct-14 5:10 
GeneralRe: get IP address from Net Address Control Pin
bkelly1318-Oct-14 10:44
bkelly1318-Oct-14 10:44 
GeneralRe: get IP address from Net Address Control Pin
Richard MacCutchan18-Oct-14 21:13
mveRichard MacCutchan18-Oct-14 21:13 
GeneralRe: get IP address from Net Address Control Pin
bkelly1319-Oct-14 8:42
bkelly1319-Oct-14 8:42 
Generalserial port access and communication using c Pin
Member 111402618-Oct-14 22:51
Member 111402618-Oct-14 22:51 
GeneralRe: serial port access and communication using c Pin
pasztorpisti8-Oct-14 23:18
pasztorpisti8-Oct-14 23:18 
GeneralRe: serial port access and communication using c Pin
Orjan Westin9-Oct-14 0:58
professionalOrjan Westin9-Oct-14 0:58 
GeneralRe: serial port access and communication using c Pin
pasztorpisti9-Oct-14 1:08
pasztorpisti9-Oct-14 1:08 
GeneralRe: serial port access and communication using c Pin
Orjan Westin9-Oct-14 4:50
professionalOrjan Westin9-Oct-14 4:50 
GeneralRe: serial port access and communication using c Pin
Orjan Westin9-Oct-14 0:55
professionalOrjan Westin9-Oct-14 0:55 
QuestionEnable a control/window in an MFC dialog, Resolved Pin
bkelly138-Oct-14 14:02
bkelly138-Oct-14 14:02 
Windows XP, Visual Studio 2008, MFC, Dialog, c++
A button in the main MFC dialog opens a second dialog with options to control the main app. In there is a button that starts disable and after a method is run, is to be enabled. The event handler that initiates that task and enables the button looks like this, so far:
void C_Prog_Control::OnBnClickBtnGetCurrentStates()
{
HWND *button_handle = NULL;
BOOL status = FALSE;
Get_Current_States();
GetDlgItem(  IDC_DO_THIS, &button_handle )
status = EnableWindow( button_handle, TRUE );  // error
}


Please forgive, but not ignore, any obvious typos as my work computer is in another room and cannot be connected to the internet. I cannot cut and paste. And now that's worse. I cannot post a message from work and must send the text home and post from there.
I have looked up the GetDlgItem() here: (When I paste in the Microsoft URL it will not display.)
And the EnableWindow function here: (Same for this link).

So the first looks like this on the MS web site:
HWND WINAPI GetDlgItem(
  _In_opt_  HWND hDlg,
  _In_      int nIDDlgItem
);

and the second looks like this:
BOOL WINAPI EnableWindow(
  _In_  HWND hWnd,
  _In_  BOOL bEnable
);


The EnableWindow code will not compile. The error is:
… error C2660: ‘CWnd::EnableWindow’ : function does not take 2 arguments.
The compiler does not see, or does not like that I want HWND::EnableWindow rather than CWnd. When I try to use CWnd there are other problems.
Intellisense shows the following signature:
BOOL EnableWindow( BOOL bEnable = 1 )
This differs from the MS page and there is only one signature.
So, given a button with the ID of: IDC_DO_THIS, how can I enable it?

EDIT RESOLVED
While at work, I stopped what I was doing several times and searched for the answer to this several times at work, through the Air Force Firewalls. After giving up there and posting this question from home, I finally found the good idea of searching from home. There in one of the first few pages was a good answer. Tried it, it worked. Just for the record:
C#
void Cvs_2008_get_port_numberDlg::OnBnClickedButton3()
{
  CWnd *pfield = GetDlgItem( IDC_BUTTON2 );
  pfield->EnableWindow( FALSE );
}


My lesson, try a search at work, but if it does not turn up the answer, search again from home. I presume the Air Force, and all military sites, are attacked so often that they have little choice but to set up things the way they are.
Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com



modified 8-Oct-14 22:20pm.

AnswerRe: Enable a control/window in an MFC dialog, Resolved Pin
Richard MacCutchan8-Oct-14 21:41
mveRichard MacCutchan8-Oct-14 21:41 

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.