|
Hi all,
I would like to know that "how to hide dialog box" on pressing the command button.
rajesh
|
|
|
|
|
|
Actually this is not working in my program.
I would like to explain my question.
I insert three dialog box(d1,d2 and d3) and also make their
classes for each dialog box(CD1,CD2 and CD3), derived from CDialog.
d1 contains two botton "Back and Next".On Clicking on the "Next" button, it calls d2(second dialog box).d2 also contains two button "Continue and Cancel".Again I press the "Continue" button, it calls d3(third dialog box).
Now I want to do that when I click on "Continue" button,it calls d3 and dismiss(hide) the both dialog box(d1 and d2)simultaneously.
I wrote code something like that:
void CD1::OnNext()
{
CD2 dlg2;
dlg2.DoModal();
}
............
..............
void CD2::OnContinue()
{
CD3 dlg3;
dlg3.DoModal();
}
Please help me
How to write code on the "Coninue" button so that d1 and d2 will be hide together?.
rajesh
|
|
|
|
|
void CD1::OnNext()
{
CD2 dlg2(this);
ShowWindow(SW_HIDE);
dlg2.DoModal();
}
void CD2::OnContinue()
{
CD3 dlg3(this);
ShowWindow(SW_HIDE);
dlg3.DoModal();
}
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Can anyone suggest any resource that describes the contents of the dev studio workspace file?
|
|
|
|
|
Have you tried opening the file in Notepad? It's not a binary file so you should be able to go through it.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I got that far.
What I was wondering was...
Is there a way of setting variables with a workspace scope, so that all the individual projects can see them?
|
|
|
|
|
someone plz suggest how to write a custom GINA.dll for Windows XP for Voice Based Login System
thanks in advance
Anshuman
|
|
|
|
|
how to bind a edit control in a ADO to a combo box control ?
which class in MFC will help,
|
|
|
|
|
What do you mean by binding an edit control to a combobox control?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
it means a current Record set called as a ADO Data bound dialog , where i have all static and edit boxs as default ,i need to place a new combobox to call the data of a field from second record set of database
|
|
|
|
|
So are you wanting to populate a combobox with the results of a recordset query?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Yes,i want to place a combobox on a ADO data dialog with a result of a recordset query to get only a selected field from the table in this combobox as a dropdown, Please help me this
|
|
|
|
|
Asha Rams wrote:
...a ADO data dialog...
I've never heard of one of these. What is it?
In any case, perhaps this article will help.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I am having problems trying to capture the HDN_ITEMDBLCLICK message of a HeaderCtrl of a ListCtrl. MSDN docs refer to seting HDS_BUTTONS style for the HeaderCtrl. I have tried doing this during the ListCtrl:OnCreate procedure. It appears to be changing the style and when you left click on a header column, it depresses like a button control would.
Any help would be appreciated.
Thank you.
|
|
|
|
|
Hi,
I have been using a wrapper class around IXMLDOMDocument to save to an XML file. (Available here on CP)
How can i save the type of encoding in that XML file?
Best regards,
Jens
|
|
|
|
|
I am using a list control, where i am displaying around 5 columns and 25 rows. I want to update only the 2nd and 3rd column items values for every second. This is working by updating it in OnTimer function. To reflect the changes Invalidate(TRUE) is used. But the problem is, the control is FLICKERING every second when it is updated.
Is there any way to update/refresh the control without flickering?
Please let me know ASAP.
vidya
|
|
|
|
|
InvalidateRect() can be used to identify the area of the window/control that requires repainting. The entire window is always repainted. BUT, using InvalidateRect allows you to specify which parts of the window are erased before repaint. The flickering is caused by the erasing/repainting method. If the unchanged areas of the window/control are not erased before a repaint, they will not flicker, but will remain the same.
A plain english example: Take a paper and a pen. Draw a line on the paper. Now, if you used Invalidate , you'd first erase the line, then draw it again. If you used InvalidateRect and specified an empty section of the paper, you'd draw the same line again over the previous one without erasing it first, thus avoiding the flicker effect.
This is a valid approach as long as the other columns do not change. If they do, the entire window must be erased before repainting, otherwise it will paint over the previous display, resulting in incorrectly drawn text or other cell contents.
To get the rectangles, you can either test different kinds of values which suits the situation best, or you can get each cell in the 2nd and 3rd column independently and use GetClientRect to fetch their rectangles. Easier way is, of course, to fit a rectangle to cover the two columns just by testing different values. It takes time, and patience, though.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi nnvidya,
Try this: http://www.codeproject.com/vcpp/gdiplus/what_is_a_basename_.asp
In my experience, this works. Also check out the article by Keith Rule that the author mentions.
Good luck,
Mick
|
|
|
|
|
hi ! thru : bool CreateMsgService(LPTSTR lpszService, LPTSTR lpszDisplayName)
we can create a service , but that pops up a property sheet page thru which user has to enter data to create the service.How can we fill in the information programatically ? I have seen a lot of applications automatically add services.I thought of two possible ways.One is that they might be an option using some other API or modified version of this one, or else use Inter process communication to send a WM_MINIMIZe to the property sheet page , and then using SetWindowText( ) after retrieveing the windows handle and detecting the fields.This is theoritically possible but sounds a bit clumsy isn't it ? I am sure it is possible somehow...you have any idea ?
Can you also explain to me the usage of ConfigureMsgService ? I could not find the proper docs in MSDN..
Thanks in advance
Regards
Kane
"Some guys hack just to get themselves a girlfriend.What a pathetic reason ,huh ?"
|
|
|
|
|
HI ,
Can any one tell me how can i send data to paralle port . n how can i recive from it
i think there is also a difference to send and recive on windows 98 and on NT n XP
is it
plz send me any sample
thanx
|
|
|
|
|
Hi,
You can use platform SDKs File Storage operations also for writing and reading data from communication resources (such as parallel and serial ports).
Check out CreateFile() , WriteFile() and ReadFile() from MSDN.
Cohen
|
|
|
|
|
Why do MS prefer to provide a new function, CWnd::CreateEx, rather than override CWnd::Create()?
|
|
|
|
|
The first one calls CreateWindowEx and allows access to the extended window flags, and the latter calls CreateWindowEx , but specifies the extended window flags as zero. Or, at least this is the way it does in MFC v7.0..
The biggest reason is backwards compatibility. The first function offers a superseded set of options related to window creation. However, the MFC library MUST support older versions also. Like, if a client has MFC version 7.0 libraries installed, this library must also support programs designed for MFC 6.0 or earlier. Thus, if a program used to call CWnd::Create , and the behaviour of this function was altered when the version changed, the results would become unpredictable, and the program might not work correctly. Thus, Microsoft preferred to provide a new function.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I am attempting to write a CListCtrl with CustomDraw for PocketPC 2002 in Embedded C++ 3.0. I hoped to have the list control handle custom draw messages (to display red text for negative numbers) so three dialogs could benefit. Have found that ON_NOTIFY_REFLECT messages never arrive in the control. Brad Spencer at Group1 Software verified that list controls don't receive custom draw events. I began catching NOTIFY messages in the dialog and directly handing them off to a custom draw message handler in the control. The handler code follows below:
The PosDialog transfers control to a public function of the control which hands the call to a (protected) custom draw message handler.
ON_NOTIFY( NM_CUSTOMDRAW, IDC_PosList, OnCustDrwPosLst )
void CPosDialog::OnCustDrwPosLst( NMHDR* pNMHDR, LRESULT* pResult )
{ CRBListCtrl* pLC = (CRBListCtrl*)this->GetDlgItem( IDC_PosList );
pLC->ReflectCustomDraw( pNMHDR, pResult );
}
The control passes control to a handler written to respond to ON_NOTIFY_REFLECT messages (which never arrive). In the control's .h file:
public:
void ReflectCustomDraw( NMHDR* pNMHDR, LRESULT* pResult )
{ OnCustomDraw( pNMHDR, pResult); };
and its .cpp file:
ON_NOTIFY_REFLECT( NM_CUSTOMDRAW, OnCustomDraw )
void CRBListCtrl::OnCustomDraw( NMHDR* pNMHDR, LRESULT* pResult )
{ NMLVCUSTOMDRAW* pCustomDraw = (NMLVCUSTOMDRAW*)pNMHDR;
NMCUSTOMDRAW nmcd = pCustomDraw->nmcd;
int rr = nmcd.dwItemSpec;
DWORD drawStage = nmcd.dwDrawStage;
switch ( drawStage )
{ case CDDS_PREPAINT:
*pResult = CDRF_NOTIFYITEMDRAW;
break;
case CDDS_ITEMPREPAINT:
*pResult = CDRF_NOTIFYSUBITEMDRAW;
break;
case CDDS_ITEMPREPAINT | CDDS_SUBITEM:
{ // which subitem?
int si = pCustomDraw->iSubItem;
CString cst = GetItemText( rr, si );
bool red = (cst[0] == '-'); //access violation
CDC* dc = CDC::FromHandle( nmcd.hdc );
dc->SetTextColor( red ? RGB(255,0,0) : RGB(0,0,0) );
*pResult = CDRF_NOTIFYPOSTPAINT;
break;
}
case CDDS_ITEMPOSTPAINT | CDDS_SUBITEM:
{ CDC* dc = CDC::FromHandle( nmcd.hdc );
dc->SetTextColor( RGB(0,0,0) );
*pResult = CDRF_DODEFAULT;
break;
}
default:
break;
}
}
GetItemText() above returns a CString which (if accessed) will produce a memory access violation.
The other possibly relevant code is functionally identical to Mike Blazczak's AddPool() on p. 443 of "MFC with Visual C++ 6", excerpted here:
LPTSTR CPosDialog::AddPool( CString* cst )
{ CString& nxCStr = cstPool[ nextFreeSlot ];
nxCStr = *cst;
// an access violation occurs below when AddPool() is a
// member of the list control, but it works as part of
// the dialog (here)
LPTSTR retVal = nxCStr.LockBuffer();
pBufPool[ nextFreeSlot ] = retVal;
nxCStr.ReleaseBuffer();
if ( ++nextFreeSlot > 2 ) nextFreeSlot = 0;
return retVal;
}
The control displays everything just fine (in black) if you comment out the offending GetItemText() call. When you replace the ?: color selector in SetTextColor(), so the line reads dc->SetTextColor( RGB(255,0,0) ), you'd think all of the text would be red, but its still black.
This patch of code is driving me nuts. I'd be particularly grateful (will send $50) to the first responder with a working solution to an issue mentioned above: 1) How to get a CString from GetItemText() that won't produce an access violation. 2) Explain how to get the text color to change to red (basically, explain what I'm doing wrong).
Thanks, Mike Landis
|
|
|
|