|
1. Are you 100% positive you are always unlocking your locks?
2. Do you have any deadly embraces in your locks. (i.e. thread #1 locks lock A then lock B while thread #2 locks lock B then lock A.)
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
As far as I know I don't have these problems. Would either problem cause random mutex lockups? I can see where #2 could potentially be the culprit as there looks like a race condition there.
Cheers,
Clint
|
|
|
|
|
Both examples cause lockups. The first because some thread never released the mutex. The second for the race condition you saw.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
It was a deadly embrace.
Thanks for you help.
Cheers,
Clint
|
|
|
|
|
hey guys
I have run into this problem now. In my application, I use FindWindow to search for a window with a specific title text. This is all fine as long as the language is english. But what do I do for non-english versions of Windows? One solution is to have a string table with the text for the title in various languages. But is there some easier simpler way to do this that I am not aware of?
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Couldn't you ID the windows with an internal hard-coded (in english ) string ?
Max.
|
|
|
|
|
Maximilien wrote:
Couldn't you ID the windows with an internal hard-coded (in english ) string ?
Not a window created my me unfortunately. This is the IE save-as window. I am using a browser control in my dialog and using IE to save the html and all the reqd images. problem is I wanna automate this and I find the save as window, find the save button and send a click to it.
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
The IE Save As box does not save the page with images, it just saves the source HTML.
To save with images is quite an involved process, but basically what you have to do is this:
1. Open the page in your Web Browser control
2. Get the IHTMLDocument2 handle (using GetHtmlDocument)
3. Get a list of images from the IHTMLDocument2 (get_images)
4. iterate through each image:
a. Download the image to a file.
b. iterate through each IMG tag on the page, and if the
image is referenced in the HREF tag, modify the HREF
tag to point to your newly save file. (This comparison
is non trivial, because you have to connonicize both
filenames first.)
5. When you have rewritten the images, get the HTML text
from the IHTMLDocument2 and save it.
|
|
|
|
|
nde_plume wrote:
The IE Save As box does not save the page with images, it just saves the source HTML.
It does save images and style sheets and everything else, if you use ExecWB with OLECMDID_SAVEAS. Thanks for your suggestion though. If nothing else works I'll try that out I guess.
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Hi y'all I'm new here.
I've searched and searched and can't find an easy and seamless method of keeping my desktop and laptop email in sync that doesn't require an exchange server.
So I guess it looks like I have to write one myself.
Anyone got any comments, interest, warnings?
George
|
|
|
|
|
hi. i have an Empty Document of MFC (Demo). in this Document i design a Dialog box that is open beside the Document Windows. My Dialog have a Simple Edit Box. I Creat a Class From this Dialog (CDlg) and Add a Variable to this Class for that Edit box (m_str)
how can i change this Variable in my DemoView.cpp or for example Control that if a Button is Clicked on that Dialog. (i mean i want to Control that Dialog Remotly on my DemoView.cpp)
thanx
-=Ehsan-de-Burge=-
|
|
|
|
|
I think one method is to send your CDlg a user message from your DemoView.cpp.
|
|
|
|
|
I want to print a filled in triangle
that looks like |> squished together.
I want it to say
Total |>
and that triangle sort of points to
what the actual total is. Any ideas?
I couldn't find anything in ascii.
Please, any response any one can give
me will be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
according to the chart that MSDN shows, ASCII char #16 (0x10) looks like that (right-pointing arrow head)
-c
I'm not the droid you're looking for.
|
|
|
|
|
I tried lots of different things, but I keep
ketting carriage return!! How can I get the
symbol as a CString?
Please any response you can give me will be
greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
How can i use a dialog from a thread ?
Code below doesn't work.
DWORD WINAPI s(LPVOID params)
{
CDialog d;
d.DoModal(); // ASSERT problem here
}
CreateThread(NULL,0,s,(LPVOID)this,0,&thID)));
|
|
|
|
|
If you are using MFC, then using MFC to create your thread, not WIN32.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
1. What does the ASSERT say?
2. Is the CDialog class really called "CDialog"? It should be a class derived from CDialog, not CDialog itself.
3. Have you thought of using a modeless dialog instead? It simulates a modal dialog box on a separate thread:
static CMyDialog s_dlg;
if (!::IsWindow(s_dlg.m_hWnd))
s_dlg.Create(CMyDialog::IDD);
s_dlg.ShowWindow(SW_SHOWNORMAL);
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
I've overriden WM_TIMER in my ListView class,and put SetTimer in OnInitUpdate(),but my WM_TIMER called only one time.Any idea?
::SetTimer(NULL,NULL,10000,NULL);
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
give ur timer an id
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
No change.It called only once again.
::SetTimer(GetSafeHwnd(),10000,10000,NULL);
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
I find it out.It called whenever the view is focused. Thanks.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
I'll make this as concise as possible.
I have an MDI application which performs some mathematical
calculations. The end result is a double. I would like
to have that double value displayed in the client area of the
MDI window, at the location of the mouse pointer, when a user clicks the right mouse button. As it stands right now, when OnRButtonDown() is called, the calculation is done and I use an AfxMessageBox() call to display the double value. I don't particularly like the effect of this, so I would like to display the value using a call something like:
void ShowText(double Value2Show, CDC* pDC)
{
// Do nifty stuff to show number on DC
}
I suppose the biggest problem I have is changing the double
to a form to be displayed on the DC. Is there an easy way of doing this?
Could someone enlighten me as to what the "Do nifty stuff" part should contain?
|
|
|
|
|
The double needs to be converted to a string so that it can be displayed using an appropriate CDC method, such as TextOut.
CString strValue;
strValue.Format(_T("%lf"), Value2Show);
pDC->TextOut(123, 456, strValue);
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
If you want to display the text at the location of the mouse pointer then put the following in your OnRButtonDown handler
CClientDC dc(this);
OnPrepareDC(&dc);
dc.DPtoLP(&point);
dc.TextOut(point.x, point.y, yourstring);
The DPtoLP function converts the mouse coordinates from device coordinates to logical coordinates
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|