|
Unplugging the network cable doesn't close a socket. Plug the cable back and data transfer should continue, TCP/IP is designed to handle unreliable physical connections.
|
|
|
|
|
hi,
on my application i have lib file for toolbar and i want host( attach ) this lib file to Internet Explorer but i dont know how
thanks
|
|
|
|
|
I am doing a printscreen, but would like to delay call by 1 s. What function can I call to delay execution for 1 s?
|
|
|
|
|
sleep() or sleepEx()
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
This is the part of program I need a slight time delay without the client knowing a time delay exists. Here is the code segment I have problems with The message box does not appear on first printout, only on subsequent ones.
void CWaterHammer::OnBnClickedPrint()
{
CPrntScreen * ScrCap;
ScrCap = new CPrntScreen();
m_caveat="This publication is intended for use as a piping system guide. It should not be used in place of a professional engineer’s judgment or advice and it is not intended as installation instructions. ";
GetDlgItem(IDC_EDIT2)->ShowWindow(true);
CEdit* pCEditBox = (CEdit*)this->GetDlgItem(IDC_EDIT2);
pCEditBox->SetWindowText(m_caveat);
ScrCap->DoPrntScreen(1,0,true); //Client area, Printer menu
delete ScrCap;
ScrCap = NULL;
}
|
|
|
|
|
What I want to do is wait to call prsntscreen until the text appears on the screen. SetWindowText returns an error code, how can I use this?
|
|
|
|
|
Must the text appear on the screen before capturing it? How about adding the text to the captured screenshot?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
There is a delay in the text appearing before the next fuction is called to do the screenshot. I Even used GetErrorMsg(), which released a non-error code from SetWindowText(..) call. Thus, this is not applicable, since text appearing on client screen and executable are out of sync. I also tried using Sleep() in PrinScreen function, this affected the text appearing on screen as well. Go figure.
Yes the only solution is to append the text to the captured and printed bitmap before releasing printer. Another function call needs to be made to do this, it would be similiar to sizing the bitmap image after screen capture.
Thank you,
Diana
|
|
|
|
|
DiMats wrote:
Yes the only solution is to append the text to the captured and printed bitmap
See my article on rendering text on a bitmap for how to do this.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
I have a CSocket object that I need to share between two threads in two different objects (one thread in each object). I am using a Console App that supports MFC using VC++ 6.0.
I create the CSocket object in the 'main' function of the console app and then pass a pointer to the CSocket into the 2 objects. I then fire up the threads in the two objects.
When I try to perform a 'Receive' call on the CSocket in the thread, I get an assertion error. The line that crashes is 'ASSERT(pState->m_hSocketWindow != NULL)' found in 'CSocket::PumpMessages()'. I checked the pointer value of the CSocket and it matches the CSocket object that was created in the 'main'.
I know there are certain MFC objects that cannot be shared across thread boundaries - is the CSocket one of them?
Thanks!
|
|
|
|
|
take a look at this ^
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Thanks a lot! That's exactly what I needed to know!
|
|
|
|
|
I have created several layers of dialog boxes using MFC C++ .Net. However, I do not want to automatically go back to calling dialog when I hit return anywhere in the active dialog. I want to just be able to click on OK button to do this.
I have set the OK button as not the Default button, but clicking anywhere in Dialog box still always closes the active Dialog Box and goes back to calling Dialog box. Is there a fix?
|
|
|
|
|
Override the OnOK function in your dialog and do not call CDialog::OnOK in your override. The CDialog::OnOK function is automatically called when you hit the enter key unless your dialogs override it.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
I thought so too but he indicated that it happens with a click (of the mouse), rather than the pressing of a key.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
This is a subdialog.. Called by another dialog box. This happens on hitting the return/enter key,not by the click of a mouse.
|
|
|
|
|
Adding a visible blank button as default button and then prescribing an OnOK button works.
Thanks all.
|
|
|
|
|
For future reference...
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...
|
|
|
|
|
I took a wild guess base on his reference to the enter key in the previous sentence
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Smart guy.
Reminds me of those word problems i used to get in math as a kid... the ones where they start out by giving you 20 specific details, most of which are confusing or wrong, but only a couple of which are actually relevant.
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...
|
|
|
|
|
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
|
|
|
|