Click here to Skip to main content
15,890,897 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: C++/MFC solution Convert string to integer only such that if it is alphanumeric or float it should show as invalid values. Pin
Richard MacCutchan18-Jul-12 3:14
mveRichard MacCutchan18-Jul-12 3:14 
AnswerRe: C++/MFC solution Convert string to integer only such that if it is alphanumeric or float it should show as invalid values. Pin
SoMad18-Jul-12 10:47
professionalSoMad18-Jul-12 10:47 
AnswerRe: C++/MFC solution Convert string to integer only such that if it is alphanumeric or float it should show as invalid values. Pin
Shivanand Gupta21-Aug-12 23:40
Shivanand Gupta21-Aug-12 23:40 
QuestionVisual Studio 10 Linker Pin
BarryPearlman15-Jul-12 14:52
BarryPearlman15-Jul-12 14:52 
AnswerRe: Visual Studio 10 Linker Pin
Richard MacCutchan15-Jul-12 22:13
mveRichard MacCutchan15-Jul-12 22:13 
QuestionHow to unload a memory-resident system dll from memory? Pin
creative2628-Jun-12 10:50
creative2628-Jun-12 10:50 
AnswerRe: How to unload a memory-resident system dll from memory? Pin
Richard MacCutchan28-Jun-12 22:26
mveRichard MacCutchan28-Jun-12 22:26 
QuestionHELP BUTTON Pin
Smart Zulu22-Jun-12 1:15
Smart Zulu22-Jun-12 1:15 
Hello everyone,i need your help,how do i add a code that will pop up a help menu when i click a button,on an MFC program that uses handles.? i have put a main code below
Quote:
#include "main.h"

#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

double *X,*Y;int N=0;

void InitDialog(HWND hDlg)
{

HWND hCombo=GetDlgItem(hDlg,IDC_MENU);
SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)L"Edit");
SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)L"Draw");
SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)L"About");
SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)L"Exit");
}
void PaintDialog(HWND hDlg)
{
HWND wnd=GetDlgItem(hDlg,IDC_PAINTBOX);
PAINTSTRUCT ps;HDC dc=BeginPaint(wnd,&ps);
RECT size;GetClientRect(wnd,&size);
Rectangle(dc,size.left,size.top,size.right,size.bottom);
DrawGraph(dc,size,X,Y,N);
EndPaint(wnd,&ps);
}
void DrawButton(HWND hDlg)
{
WCHAR BUF[MAX_PATH];
// анализ начала интервала
GetDlgItemText(hDlg,IDC_EDIT_START,BUF,MAX_PATH);
if(analysis(BUF)==NULL)
{
MessageBox(hDlg,GetErrorMsg(),L"Error",MB_ICONHAND|MB_OK);
return;
}
double start=calc(0);
// анализ конца интервала
GetDlgItemText(hDlg,IDC_EDIT_END,BUF,MAX_PATH);
if(analysis(BUF)==NULL)
{
MessageBox(hDlg,GetErrorMsg(),L"Error",MB_ICONHAND|MB_OK);
return;
}
double end=calc(0);
// анализ шага интервала
GetDlgItemText(hDlg,IDC_EDIT_STEP,BUF,MAX_PATH);
if(analysis(BUF)==NULL)
{
MessageBox(hDlg,GetErrorMsg(),L"Error",MB_ICONHAND|MB_OK);
return;
}
double step=calc(0);
GetDlgItemText(hDlg,IDC_EDIT_EXPR,BUF,MAX_PATH);
// анализ выражения
if(analysis(BUF)==NULL)
{
MessageBox(hDlg,GetErrorMsg(),L"Error",MB_ICONHAND|MB_OK);
return;
}
// расчёт интервала
if(!interval(start,end,step,&X,&Y,&N))
{
MessageBox(hDlg,GetErrorMsg(),L"Error",MB_ICONHAND|MB_OK);
return;
}
// отрисовка промежуточных значений
HWND hList=GetDlgItem(hDlg,IDC_LIST);
SendMessage(hList, LB_RESETCONTENT, 0, 0);
for(int i=0;i<n;i++)
{
="" swprintf(buf,max_path,l"(%4.4lf="" ,="" %4.4lf)",x[i],y[i]);
="" sendmessage(hlist,lb_addstring,0,(lparam)buf);
="" }
="" принудительная="" отрисовка
="" invalidaterect(hdlg,null,false);
}
void="" savebutton(hwnd="" hdlg)
{
="" wchar="" filename[max_path];=""
="" if(showsavedialog(
="" hdlg,
="" filename,
="" l"fndraw="" save="" to="" file",
="" null,="" l"c:\\windows\\desktop",="" l"bmp="" files="" (*.bmp)\0*.bmp\0"
="" ))
="" storeclientwindowbitmap(getdlgitem(hdlg,idc_paintbox),filename);=""
}
void="" helpbutton(hwnd="" hdlg)
{

}
="" оконая="" процедура
lresult="" callback="" dialogproc(hwnd="" hdlg,="" uint="" message,="" wparam="" wparam,="" lparam="" lparam)
{="" обработка="" сообщений
="" switch(message)
="" {="" инициализация="" окна
="" case="" wm_initdialog:
="" initdialog(hdlg);
="" return="" true;
="" отрисовка="" wm_paint:
="" paintdialog(hdlg);
="" break;
="" нажатых="" кнопок
="" wm_command:="" выбор="" switch(wparam)
="" потом="" убрать...
="" (hwnd)(idc_menu):
="" if="" (hiword(wparam)="=CBN_EDITCHANGE)
" int="" item="ComboBox_GetCurSel(GetDlgItem(hDlg,IDC_MENU));
" item;
="" break;="" сценарий="" закрытия="" loword(idc_button_exit):
="" enddialog(hdlg,0);
="" сохранений="" графика
="" loword(idc_button_save):="" savebutton(hdlg);
="" построения="" нового="" loword(idc_button_draw):
="" drawbutton(hdlg);
="" }="" wm_close:="" *enddialog(hdlg,0);="" *="" false;
}

int="" winapi="" winmain(hinstance="" hinstance,="" hinstance="" hprev,="" lpstr="" lpcmdline,="" ncmdshow)
{
="" initcommoncontrolsex="" icc;
="" icc.dwsize="sizeof(INITCOMMONCONTROLSEX);
" icc.dwicc="ICC_WIN95_CLASSES|ICC_STANDARD_CLASSES;
" initcommoncontrolsex(&icc);="" dialogbox(hinstance,="" makeintresource(idd_main),="" (dlgproc)="" dialogproc);=""
}<="" blockquote="">

QuestionUnable to drop a file on a new message in outlook 2007 Pin
sisrahul19-Jun-12 2:57
sisrahul19-Jun-12 2:57 
GeneralBug in ATL/MFC 8.0 CString Pin
XmlSeeker14-Jun-12 18:58
XmlSeeker14-Jun-12 18:58 
GeneralRe: Bug in ATL/MFC 8.0 CString Pin
Richard MacCutchan14-Jun-12 21:48
mveRichard MacCutchan14-Jun-12 21:48 
QuestionATL - Raise Event to all clients and acces to same variable Pin
ljubek7414-Jun-12 7:08
ljubek7414-Jun-12 7:08 
AnswerRe: ATL - Raise Event to all clients and acces to same variable Pin
barneyman17-Jun-12 14:51
barneyman17-Jun-12 14:51 
GeneralRe: ATL - Raise Event to all clients and acces to same variable Pin
ljubek7418-Jun-12 2:02
ljubek7418-Jun-12 2:02 
QuestionMFC exe to ATL service Pin
es196812-Jun-12 3:39
es196812-Jun-12 3:39 
AnswerRe: MFC exe to ATL service Pin
barneyman13-Jun-12 18:02
barneyman13-Jun-12 18:02 
QuestionAPI Decision Pin
Collin Biedenkapp11-Jun-12 18:53
Collin Biedenkapp11-Jun-12 18:53 
AnswerRe: API Decision Pin
Richard MacCutchan11-Jun-12 22:01
mveRichard MacCutchan11-Jun-12 22:01 
Questionhow to use an interface as a parameter in other atl objects? Pin
astupidboy31-May-12 20:41
astupidboy31-May-12 20:41 
AnswerRe: how to use an interface as a parameter in other atl objects? Pin
Richard MacCutchan31-May-12 21:26
mveRichard MacCutchan31-May-12 21:26 
GeneralRe: how to use an interface as a parameter in other atl objects? Pin
astupidboy31-May-12 22:29
astupidboy31-May-12 22:29 
GeneralRe: how to use an interface as a parameter in other atl objects? Pin
Richard MacCutchan31-May-12 22:35
mveRichard MacCutchan31-May-12 22:35 
GeneralRe: how to use an interface as a parameter in other atl objects? Pin
astupidboy31-May-12 22:56
astupidboy31-May-12 22:56 
GeneralRe: how to use an interface as a parameter in other atl objects? Pin
Richard MacCutchan31-May-12 23:08
mveRichard MacCutchan31-May-12 23:08 
GeneralRe: how to use an interface as a parameter in other atl objects? Pin
astupidboy31-May-12 23:24
astupidboy31-May-12 23:24 

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.