|
By default, the escape key triggers the OnCancel() event of a modal dialog. You must override the OnCancel function in your dialog class. Example from MSDN:
void MyDialog::OnCancel()
{
if ( AfxMessageBox("Are you sure you want to abort the changes?",
MB_YESNO) == IDNO )
return;
CDialog::OnCancel();
}
|
|
|
|
|
OnCancel is not only called by hitting ESC key, also called by closing dialog box, for settling this, I think u may overwrite CDialog::PreTranslateMessage funcion like this.
BOOL CdlgtestDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->hwnd == m_hWnd || ::IsChild(m_hWnd,pMsg->hwnd) && (pMsg->message == WM_KEYDOWN || pMsg->message == WM_KEYUP))
{
if(pMsg->wParam == VK_ESCAPE)
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}
life is like a box of chocolate,you never know what you r going to get.
|
|
|
|
|
I have created a file which stores the employee details.
now I am trying to ovrwrite the employee details based on the input EmployeeId
given by the user using
ofstream obj(filename::ios::out);
obj<
|
|
|
|
|
if the variable empName is of fixed length or upto the length that
u have to created intialise the variable value to zero of
its allocated length,
char empName[15];
//lenempName =15 or what ever its size
memset(empName, 0, sizeof (char )* lenempName );
hope it will help u.
|
|
|
|
|
Thank you kanduripavan.But i had tried it before but i couldn't find any changes(Still it writes box kind of characters in the file).If you get any new idea please info me...
Thanks & regards,
Harish
|
|
|
|
|
Hello,
I'm kind of a newbie in Visual C++ and I'm doing a image processing project in which I need to get specific pixel values whenever I click on a bitmap image.
I'd appreciate if you gave me some hints and code on how to do this
Thanks
|
|
|
|
|
I prefer u go through
CDC Class Its a class of device-context objects.
AND
You can refer GDI+
Below an example from MSDN shows how to get pixel from bitmap.
Bitmap myBitmap(L"Climber.jpg");
Color pixelColor;
myBitmap.GetPixel(25, 25, &pixelColor);
The GetPixel method gets the color of a specified pixel in this bitmap.
|
|
|
|
|
If you use of CImage class you can use of GetPixel for retrieves pixles and SetPixel and SetPixelRGB for set pixles
|
|
|
|
|
Hi all,
I'm busy working on a FTP client. The problem is when I send a command like 'LIST' to the server I get a response message that sates the following:
Unable to connect: No connection could be made because the target machine actively refused it.
Can anyone please help me ??
Many Thanks.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Check out if firewall is stopping it.
If not, check out address used by client and server are same.
|
|
|
|
|
DestinyDrive wrote: Check out if firewall is stopping it.
I turned off the Windows Firewall for both the Server and Client.
DestinyDrive wrote: If not, check out address used by client and server are same
A connection is made, the problem occures when a command is sent.
Thank you for the reply.
Regards,
-- modified at 5:27 Wednesday 11th April, 2007
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Use another FTP program to check that the Server and the connection are working correctly. Once you have confirmed that they are working, run something like ethereal to sniff the packets to check that you are sending the same requests that the working FTP program does. The same requests should elicit the same response.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Thank you for the reply cp9876.
It seems like the problem setting the Passive Mode. By default I set it to zero, but after setting it to 1, it works.
Wikipedia:
In active mode, the FTP client opens a random port (> 1023), sends the FTP server the random port number on which
it is listening over the control stream and waits for a connection from the FTP server. When the FTP server initiates
the data connection to the FTP client it binds the source port to port 21 on the FTP server.
In passive mode, the FTP Server opens a random port (> 1023), sends the FTP client the server's IP address to connect
to and the port on which it is listening (a 16 bit value broken into a high and low byte) over the control stream and
waits for a connection from the FTP client. In this case the FTP client binds the source port of the connection to a
random port greater than 1023.
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
how can i set or change windows volume?
|
|
|
|
|
You mean to say size, isn't it ?
Prasad
MS MVP - VC++
|
|
|
|
|
i mean the actually volume control, who can i change the volume?
|
|
|
|
|
Again, you are not clear. What do you mean by windows volume ? Is it x * y * z ? Or , you are talking about volume of sound ?
vimarsh puneet wrote: i mean the actually volume control,
I never heard of this type of control. Probably, you need to use slider.
Prasad
MS MVP - VC++
|
|
|
|
|
ya sound volume. how can i control that.
|
|
|
|
|
You need to use waveOutSetVolume , in combination with a slider control , as said earlier.
I found this[^] article on CP. This should be helpful to you in some way.
Prasad
MS MVP - VC++
|
|
|
|
|
i already tried with that. Its working , but wanted to know if one could change the sound volume of the windows. like if you mute on the dialog the windows volume is muted
|
|
|
|
|
You could try the mixerXxx functions in the MultiMedia section to control the volume of the speaker output device.
Judy
|
|
|
|
|
I have one batch file.That has one exe.When i am executing the bacth file the console window appear.
I try to hide the console window using RunConsoleWindow.exe / cmdow utility that is worked but when i am used that in program it does not worked.
Any Alternate to do this.plz help me??????????
|
|
|
|
|
Go to the command line and type "start /?". The /B is what you're looking for.
Phil
|
|
|
|
|
|
My Batch file content is:
@echo off
rem Add a new TAP-Win32 virtual ethernet adapter
"C:\Program Files\OpenVPN\bin\tapinstall.exe install "C:\Program Files\OpenVPN\driver\OemWin2k.inf" tap0801
|
|
|
|