|
Stop calling EndDialog() in your OnLButtonDown() method...
Ok, that might not be exactly what's happening. But dialogs don't normally close when you click on them, so you've done something to alter that. Dialogs normally close when they recieve a command message with the IDOK or IDCANCEL, an Enter or Escape keypress, or a WM_CLOSE message... be sure you know where all these can come from before moving on.
Shog9
I'm not the Jack of Diamonds... I'm not the six of spades.
I don't know what you thought; I'm not your astronaut...
|
|
|
|
|
Actually I didn't do this. However I solved problem by putting in a visible "do nothing" buttonand defining the OK button in the code. This works. I have a deadline so I will look to see what bug actually is when I submit project.
Thanks for such quick replies!!!!
|
|
|
|
|
I'm using a GSM/GPRS modem and some times (don't know why) it gets dumb, only de carrier detect and the power leds are on, and i can't do ping. The only way to solve this problem is unpluging the prower cord but this will not be posible because it will work on an unattended PC, so.... i think if i reset the modem i'll work again but how do i reset the thing? AT commands or win32 API? any advice? thanx in advance, everybody
"I don't want to achieve immortality through my work... I want to achieve it through not dying."
Woody Allen
|
|
|
|
|
I had a motorola phone that worked the same way, and if I looked in my modem properties i saw that it took a com port. So i suggest that you open the port using createfile and write an AT reset command to it.
Good luck.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
I am doing a number plate recognition system, i am having great difficulty with the segmentation of the characters, there are loads of papers out there but not much code im currently using visual c++ but could use java as a back end any one any ideas????
|
|
|
|
|
hi,
On my application, i have many Lock and Unlock operations that slowdown a performance. How can I minimise it?
Thanks.
|
|
|
|
|
That depends a lot upon the architecture and purpose of the application. Generally speaking, I would see if the locking could be made more granular and if I could partition the data in such a way that locking is reduced to just the data that I want to update, rather than the entire list/table/array etc. Also, I would see if I could use critical sections, rather than kernel object locks like mutexes, semaphores.
However, without an understanding of what your app does, these suggestions are purely general and may be wrong.
onwards and upwards...
|
|
|
|
|
I assume you are talking about locking and unlocking in the ciontext of a database. Yes? Is it optimistic or pessimistic? Pessimistic locking will have a potential performance penalty in a multiuser environment, since concurrent access to the same record may have to wait until completion of the application’s update process.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello,
I have PropertySheet with 11 PropertySheet pages. The proprtysheet has style - PSH_WIZARD97.
In this scenario I have individual dilaog procedures for each page in the wizard. The dialogs are designed using VC dialog editor and I have given them a caption using the dialog editor only.
Now I want to change the caption of that dialog dynamically. So in the WM_INITDIALOG, I am having a function call:
SetWindowText ( GetParent(hwnd), "Some header" );
If I do this then dialog caption changes for the first time the page is activated but then if I do {next} or {back} and come back to the same page, the title gets changed to the one that I provided in the dialog editor?
I have even tried the same thing in PSN_SETACTIVE: event without any help.
How can I always change the title?
Regards,
Ritesh
|
|
|
|
|
akhildhanuka wrote:
Now I want to change the caption of that dialog dynamically. So in the WM_INITDIALOG, I am having a function call:
SetWindowText ( GetParent(hwnd), "Some header" );
So I'm confused, are you trying to change the title on the prop sheet dialog? Are you doing this in the OnInitDlg of your parent app?
The reason I ask is that if you are doing this in the prop sheet shold you not be passing the handle of the prop sheet dialog to SetWindowText to change the title?
Here is what MSDN says:
hWnd
[in] Handle to the window or control whose text is to be changed.
Hope this helps
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
I am creating the wizard as suggested at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/CommCtls/PropSheet/wizards.asp
So lets say - i want to change the title of on of the page during runtime e.g. IntPage1DlgProc(...)
BOOL CALLBACK IntPage1DlgProc (
HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
LPSHAREDWIZDATA pdata = (LPSHAREDWIZDATA)
GetWindowLong(hwndDlg, GWL_USERDATA);
switch (uMsg)
{
case WM_INITDIALOG :
{
pdata = (LPSHAREDWIZDATA)
((LPPROPSHEETPAGE) lParam) ->
lParam;
SetWindowLong(hwndDlg, GWL_USERDATA,
(DWORD_PTR)pdata);
SetWindowText ( hwndDlg, "XXX" );
break;
}
does not work and the title remains same as one provided using resource editor.
I want to change it dynamically.
|
|
|
|
|
You need to postmessage in PSN_SETACTIVE and use
SetWindowText ( GetParent ( hwnd ), "your text" );
|
|
|
|
|
Hi:
which is the easiest way to insert a little image (maybe a BMP 30x30 pixels) in specific coordinates (x, y) into a view?
Thanks.
|
|
|
|
|
In the OnDraw handler of the view class, first create a HBITMAP struct. Then use LoadImage to load the bitmap image from a file into the struct. Then create a CBitmap object and attach it to the HBITMAP. Then use standard BitBlt techniques to blit the bitmap into the view.
Here's a code sample:
void CMyView::OnDraw(CDC* pDC)
{
HBITMAP hbmpMyBitmap;
hbmpMyBitmap = (HBITMAP) LoadImage( NULL, "C:\\Windows\\MyBitmap.bmp",
IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE );<DIV>
CBitmap objBitmap;
objBitmap.Attach( hbmpMyBitmap );<DIV>
CDC tempDC;
tempDC.CreateCompatibleDC( pDC );
CBitmap* pOldBitmap = (CBitmap*) tempDC.SelectObject( &objBitmap );<DIV>
pDC->BitBlt(x, y, width, height, &tempDC, 0, 0, SRCCOPY);<DIV>
tempDC.SelectObject( pOldBitmap );
return;
} Something like this. Remember to replace file path, destination coordinates and bitmap width and height with the correct values.
Hope it helps,
Antti Keskinen
----------------------------------------------
"If we wrote a report stating we saw a jet fighter with a howitzer, who's going to believe us ?"
-- R.A.F. pilot quote on seeing a Me 262 armed with a 50mm Mauser cannon.
|
|
|
|
|
|
I am creating a dialogbox(modal) from inside my parent dialog. On this dialog, there is a Finish button whose id = IDC_BUTTON6. When I click this button I would like to call my parent dialog's apply(); method.
However I don't know how to refer to IDC_BUTTON6 of Popup.cpp from inside the Parent.class.
Should I write something like;
if (nResponse == IDC_BUTTON6) which is erroneous,
or like
if (nResponse == Popup.IDC_BUTTON6) which is also erroneous.
How should I solve this simple case ?
Parent.cpp has the following ;
void SomeMethod()
{
myPopupDialog dlg(propertySheet->hRepository, propertySheet->pszObjectDN, &csName);
int nResponse = dlg.DoModal();
if (nResponse == IDC_BUTTON6)// where the error occurs
{
apply();
}
}
void apply(void)
{
//do something
}
*********************
Popup.cpp has the followind code;
void ColdGroupPopup::OnFinish() //Finish button's id = IDC_BUTTON6
{
}
Nice Özgürce
|
|
|
|
|
|
thank you Mike, your response helped..
|
|
|
|
|
any body can explain the AVL Tree insertion algorithm. or pls give some useful links for the same
Thanks,
Sarath
|
|
|
|
|
Hi !
I managed to hook a MDIChild window to a class of mine, which is derived from the class CHookWnd , supplied by J.P.Naughter (see article http://www.naughter.com/hookwnd.html)
I additionally do attach a Toolbar programmatically to the hooked MDIChild window, all works fine, meaning that 1)the toolbar is created and attached, 2) the messages are rerouted to my WindowProc.
There is one problem , though:
I am not able to intercept the WM_COMMAND message sent, whenever I click on one of the toolbar buttons, this message is sent directly to the child and not rerouted. I also DO NOT want to induce a redirection of the message from within the MDI child window, that would be pointless in my case.
QUESTION : How can I intercept the WM_COMMAND messages issued upon clicking the toolbar buttons such, that they will be redirected automatically to my WindowProc procedure.
The whole project is available upon request,
thanks to anyone trying to help,
Rubi
|
|
|
|
|
The problem is due to the way MFC routes the messages in the OnCmdMsg() function.
BOOL CFrameWnd::OnCmdMsg(UINT nID, int nCode, void* pExtra,
AFX_CMDHANDLERINFO* pHandlerInfo)
{
CPushRoutingFrame push(this);
CView* pView = GetActiveView();
if (pView != NULL && pView->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
return TRUE;
if (CWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
return TRUE;
CWinApp* pApp = AfxGetApp();
if (pApp != NULL && pApp->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
return TRUE;
return FALSE;
}
If you override this function in your mainframe you can add an extra stage to query the CMdiChild window.
e.g.
BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra,
AFX_CMDHANDLERINFO* pHandlerInfo)
{
CPushRoutingFrame push(this);
CView* pView = GetActiveView();
if (pView != NULL)
{
CWnd *pParent = pView->GetParent();
if (pParent != NULL && pParent->OnCmdMdg(nID, nCode, pExtra, pHandlerInfo))
return TRUE;
}
if (pView != NULL && pView->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
return TRUE;
if (CWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
return TRUE;
CWinApp* pApp = AfxGetApp();
if (pApp != NULL && pApp->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
return TRUE;
return FALSE;
}
If you vote me down, my score will only get lower
|
|
|
|
|
Thanks , but I should have explained better. What I needed to achieve was a way to cause my DLL to plug into an existing application by some other programmer, without having to involve the the other programmer .This way , he wouldn't have to change a bit. There would be only his application with a few MDI child windows created by him, while I hook up to those MDI child windows, I induce the creation of different toolbars for the respective MDI child and intercept all the messages to those windows, thus taking over the MDI children. I achieved it, everything works fine now. As I explained in the former posting, I do receive the rerouted messages. The WM_COMMAND message cannot be intercepted by me, it is intercepted in the MDI child, but I found a way around it. Whenever I create the toolbar, I keep record of the amount of buttons and record the rectangles within the toolbar, where they are located. Now, I need just to catch the WM_LBUTTONDOWN and ..BUTTONUP messages, thus enabling me to detect which button was pressed and take action... Works great !
Thank you for your interest !
Rubi
|
|
|
|
|
Any useful links to understand AVL Tree insertion Algorithm?
Sarath
|
|
|
|
|
hi all
does ne1 know the best way of extracting a sting
what i need to do i extract str1 out of str2
CString str1 = "7"
CSting str2 = "07HGN"
so the result for str2 would be "0HGN"
any ideas
thanks
si
|
|
|
|
|
Check out : CString members[^]
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|