怎么让vc自动加载 void IncomingConnectionsControls:Apply()
如何让vc自动加载 void IncomingConnectionsControls::Apply() ?
void IncomingConnectionsControls::Apply()
{
// Save the password if one was entered
BOOL isShort = SetPasswordSettings(IDC_PASSWORD);
// Save the password (view only) if one was entered
BOOL isShortViewOnly = SetPasswordSettings(IDC_PASSWORD_VIEWONLY);
// Warn about passwords longer than eight characters
if (!isShort || !isShortViewOnly) {
MessageBox(NULL,
"WARNING: You have entered passwords of length exceeding\n "
"eight characters, but the standard VNC authentication scheme\n "
"does not support such long passwords.\n\n "
"Your passwords will be truncated to just eight characters. ",
szAppName, MB_ICONEXCLAMATION | MB_OK);
}
// Save the new settings to the server
m_server-> SetAutoPortSelect(IsChecked(IDC_PORTNO_AUTO));
// Save port numbers if we 're not auto selecting
if (!m_server-> AutoPortSelect()) {
if (IsChecked(IDC_SPECDISPLAY)) {
// Display number was specified
BOOL ok;
UINT display = GetDlgItemInt(m_hwnd, IDC_DISPLAYNO, &ok, TRUE);
if (ok)
m_server-> SetPorts(DISPLAY_TO_PORT(display),
DISPLAY_TO_HPORT(display));
} else {
// Assuming that port numbers were specified
BOOL ok1, ok2;
UINT port_rfb = GetDlgItemInt(m_hwnd, IDC_PORTRFB, &ok1, TRUE);
UINT port_http = GetDlgItemInt(m_hwnd, IDC_PORTHTTP, &ok2, TRUE);
if (port_rfb != port_http) {
if (ok1 && ok2)
m_server-> SetPorts(port_rfb, port_http);
} else {
MessageBox(NULL,
"WARNING: You have entered equal RFB and HTTP port numbers.\n\n "
"Your changes to port numbers will not be saved. ",
szAppName, MB_ICONEXCLAMATION | MB_OK);
}
}
}
m_server-> SockConnect(IsChecked(IDC_CONNECT_SOCK));
// Wallpaper handling
m_server-> EnableRemoveWallpaper(IsChecked(IDC_REMOVE_WALLPAPER));
m_server-> SetBlankScreen(IsChecked(IDC_BLANK_SCREEN));
// Enabling/disabling file transfers
m_server-> EnableFileTransfers(IsChecked(IDC_ENABLE_FILE_TRANSFERS));
Validate(TRUE);
}
想让void IncomingConnectionsControls::Apply()程序运行就加载,最好不要把void IncomingConnectionsControls::Apply()移动位置,只是加个什么东西?
thanks in advance
------解决方案--------------------
void IncomingConnectionsControls::Apply()
{
// Save the password if one was entered
BOOL isShort = SetPasswordSettings(IDC_PASSWORD);
// Save the password (view only) if one was entered
BOOL isShortViewOnly = SetPasswordSettings(IDC_PASSWORD_VIEWONLY);
// Warn about passwords longer than eight characters
if (!isShort || !isShortViewOnly) {
MessageBox(NULL,
"WARNING: You have entered passwords of length exceeding\n "
"eight characters, but the standard VNC authentication scheme\n "
"does not support such long passwords.\n\n "
"Your passwords will be truncated to just eight characters. ",
szAppName, MB_ICONEXCLAMATION | MB_OK);
}
// Save the new settings to the server
m_server-> SetAutoPortSelect(IsChecked(IDC_PORTNO_AUTO));
// Save port numbers if we 're not auto selecting
if (!m_server-> AutoPortSelect()) {
if (IsChecked(IDC_SPECDISPLAY)) {
// Display number was specified
BOOL ok;
UINT display = GetDlgItemInt(m_hwnd, IDC_DISPLAYNO, &ok, TRUE);
if (ok)
m_server-> SetPorts(DISPLAY_TO_PORT(display),
DISPLAY_TO_HPORT(display));
} else {
// Assuming that port numbers were specified
BOOL ok1, ok2;
UINT port_rfb = GetDlgItemInt(m_hwnd, IDC_PORTRFB, &ok1, TRUE);
UINT port_http = GetDlgItemInt(m_hwnd, IDC_PORTHTTP, &ok2, TRUE);
if (port_rfb != port_http) {
if (ok1 && ok2)
m_server-> SetPorts(port_rfb, port_http);
} else {
MessageBox(NULL,
"WARNING: You have entered equal RFB and HTTP port numbers.\n\n "
"Your changes to port numbers will not be saved. ",
szAppName, MB_ICONEXCLAMATION | MB_OK);
}
}
}
m_server-> SockConnect(IsChecked(IDC_CONNECT_SOCK));
// Wallpaper handling
m_server-> EnableRemoveWallpaper(IsChecked(IDC_REMOVE_WALLPAPER));
m_server-> SetBlankScreen(IsChecked(IDC_BLANK_SCREEN));
// Enabling/disabling file transfers
m_server-> EnableFileTransfers(IsChecked(IDC_ENABLE_FILE_TRANSFERS));
Validate(TRUE);
}
想让void IncomingConnectionsControls::Apply()程序运行就加载,最好不要把void IncomingConnectionsControls::Apply()移动位置,只是加个什么东西?
thanks in advance
------解决方案--------------------