|
First, check this: Typename, Disabling Keys in Windows XP with TrapKeys[^]
> ...the main purpose is to lockout children from windows system
I'm not quite sure if this is an option, but in WinXP you could simply add a new account and start your program instead of explorer.exe. Go to:
Start -> Run -> gpedit.msc -> Administrative Templates -> System -> Custom User Interface
This way most of the Windows hotkeys will go away for free. But two of them will stay: Ctrl-Shift-Esc and Ctrl-Alt-Del (both are intercepted by Winlogon). To get rid of them you could either disable Task Manager (gpedit.msc -> Administrative Templates -> System -> Ctrl+Alt+Del Options). If you are happy with the notification message that pops up when pressing those hotkeys thereafter, then you are all done. If not, or if you simply need complete control over those hotkeys, you have to write a replacement for msGina.dll (search for GINASTUB in MSDN as a starter example; unfortunately the sources were thrown out of MSND .NET, so you'll have to stick with the Visual Studio 6.0 version). In your custom GINA:
1) Gobble WlxStartApplication in order to disable Ctrl-Shift-Esc.
2) To handle Ctrl-Alt-Del either gobble WlxLoggedOnSAS (you get an ugly flicker) or call
DWORD dwOld;
pWinlogonFunctions->WlxSetOption( hWlx, WLX_OPTION_USE_CTRL_ALT_DEL, 0, &dwOld ); (now the screen-saver won't be started anymore).
Isn't it always true: You get something but in the same moment you lose something else.
RK
|
|
|
|
|
Robert Kuster wrote:
Isn't it always true: You get something but in the same moment you lose something else.
Yes you are right
It sems to be that way.
I knew that this would not be the easiest thing to do!
Thank you!
|
|
|
|
|
Can anybody tell me why when I compile the following program using VCC 6.0
#include <vector>
#include <string>
using namespace std;
int main(int argc, char* argv[]){
vector<string> v;
return 0;
}
I get these warnings?
Compiling...
stlTest1.cpp
c:\program files\visual studio\my projects\stltest1\stltest1.cpp(11) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,std::basic_string<char,std::char_traits<char>,std::allocator<ch
ar> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,int>' : identifier was truncated to '255' characters in the debug information
c:\program files\visual studio\my projects\stltest1\stltest1.cpp(11) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,
std::basic_string<char,std::char_traits<char>,std::allocator<char> > &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,int>' : identifier was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\vector(39) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
>::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\vector(60) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
>::~vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
stlTest1.obj - 0 error(s), 4 warning(s)
It compiles fine if I use vector<int>
instead of vector<string>
Thanks in advance.
|
|
|
|
|
|
Thanks, I did pragma it away but I wasn't sure why I was getting the warnings about an indentifier being to long, I didn't know what identifier it was talking about.
Now I know to expect lots of stl warning noise which will save a lot of gray hair in the future
Thanks again.
|
|
|
|
|
I'm trying to make an open file dialog appear but the problem is that myy code won't compile I get the following errors:
error C2274: '->' : illegal as right side of '.' operator
error C2446: '==' : no conversion from 'const int' to 'int (__thiscall CFileDialog::*)(void)'
There are no conversions from integral values to pointer-to-member values
error C2040: '==' : 'int (__thiscall CFileDialog::*)(void)' differs in levels of indirection from 'const int'
error C2659: '=' : overloaded function as left operand
error C2065: 'UpdateDate' : undeclared identifier
The code I'm using is below
OnMFile()
{
CString m_sMeshName();
CFileDialog m_lpDialog(true);
if(m_lpDialog.DoModal() == IDOK)
{
m_sMeshName = m_lpDialog.GetFileName();
UpdateDate(false);
}
}
I'm using VC6, what could be the problem guys
|
|
|
|
|
Lets see if we can fix these one at a time
error C2274: '->' : illegal as right side of '.' operator
Double click this error message and see what code it goes to.
the last error is just a misspelled word, it should be "UpdateData(FALSE)"
|
|
|
|
|
I made the change (thanks for pointing out the typo ) and here is my code
OnMFile()
{
// TODO: Add your command handler code here
CString m_sMeshName();
CFileDialog m_lpDialog(true);
if(m_lpDialog.DoModal() == IDOK)
{
m_sMeshName = m_lpDialog.GetFileName();
UpdateData(FALSE);
}
}
These are the errors
error C2274: '->' : illegal as right side of '.' operator
error C2446: '==' : no conversion from 'const int' to 'int (__thiscall CFileDialog::*)(void)'
There are no conversions from integral values to pointer-to-member values
error C2040: '==' : 'int (__thiscall CFileDialog::*)(void)' differs in levels of indirection from 'const int'
error C2659: '=' : overloaded function as left operand
The error
error C2274: '->' : illegal as right side of '.' operator
corresponds to the code line:
CFileDialog m_lpDialog(true);
The error
error C2446: '==' : no conversion from 'const int' to 'int (__thiscall CFileDialog::*)(void)'
There are no conversions from integral values to pointer-to-member values
error C2040: '==' : 'int (__thiscall CFileDialog::*)(void)' differs in levels of indirection from 'const int'
corresponds to the line:
if(m_lpDialog.DoModal() == IDOK)
The error:
error C2659: '=' : overloaded function as left operand
corresponds to the line
m_sMeshName = m_lpDialog.GetFileName();
I literally copied this code form a book, but it gives the errors as mentioned what could be wrong ?
|
|
|
|
|
try this, it compiles on my machine
OnMFile()
{
CString m_sMeshName();
CString sFilter = _T("Load Files (*.txt)|*.txt"); // change .txt to something else
// if needed
CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY, sFilter);
if(dlg.DoModal() == IDOK)
{
m_sMeshName = dlg.GetFileName();
UpdateData(FALSE);
}
}
|
|
|
|
|
Thanks man this opens up my load file dialog. The thing is that now I want to pass the name of the file selected as a character array or char * instead of a CString object. any function in CString that does this
|
|
|
|
|
gamerPotatoe wrote:
The thing is that now I want to pass the name of the file selected as a character array or char * instead of a CString object. any function in CString that does this
CString s( "abcd" );
LPTSTR p = s.GetBuffer( 10 );
strcpy( p, "Hello" );
s.ReleaseBuffer( );
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Something is very wrong - the compiler is seeing a -> operator where there is none. I'd say that's the root of the trouble. Also, this line:
CString m_sMeshName(); doesn't do what you want. That is a prototype for a function called m_sMeshName that returns a CString and takes no parameters. Remove the () .
While I'm thinking of it, your Hungarian is a bit messed up. That makes me wonder if you don't have actual member variables in that class with the same names, and the name collision is causing the errors.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt
Kosh reminded me of some of the prima-donna programmers I've worked with. Knew everything but when you asked them a question; never gave you a straight answer.
-- Michael P. Butler in the Lounge
|
|
|
|
|
Hi, all
I am trying to update an Access file. After i called
AddNew()function, there is no any change in the Access file. But when i did test by calling MoveLast(), the new inserted record is there. It seems like AddNew() function does not change the original Access file. Is it right? How can i update the original Access file.
Thanks. Happy holidays!
|
|
|
|
|
did you called rs.Update() after AddNew(); ?
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Yes, i did. Actually, i already figured it out. The problem is from Access. I tyied my function with Access 97, it works.
Thank you for your suggestion. Have nice holidays.
|
|
|
|
|
Hi everyone,
My pseudo code and question are folowing:
//Code_Start
void CTryDlg::OnStart3()
{
CFile f;
DWORD dwStatus;
DWORD dwBuffLen = sizeof(dwStatus);
BOOL bSuccess;
CHttpConnection *cn;
CHttpFile *httpf;
CString strSentence,strGetSentence;
CString strHttpName = "http://www.eee.com/login.asp";
char opt[] = "UserName=uuu&Password=ppp";
CString strHeaders = "Content-Type: application/x-www-form-urlencoded\r\n";
CInternetSession session("IE 5.0");
try {
cn = session.GetHttpConnection("www.dailygraphs.com",0,INTERNET_DEFAULT_HTTP_PORT,NULL,NULL);
httpf = cn->OpenRequest(CHttpConnection::HTTP_VERB_POST,"login.asp",NULL,1,NULL,NULL,INTERNET_FLAG_EXISTING_CONNECT|INTERNET_FLAG_KEEP_CONNECTION|INTERNET_FLAG_NO_CACHE_WRITE|INTERNET_FLAG_FORMS_SUBMIT);
httpf->SendRequest(strHeaders,(LPVOID)(LPCTSTR)opt,strlen(opt));
bSuccess = httpf->QueryInfo(HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER,&dwStatus, &dwBuffLen);
strGetSentence = "";
if( bSuccess && dwStatus>= 200 &&dwStatus<300 )
{
while(httpf->ReadString(strSentence)){
strGetSentence = strGetSentence + strSentence + char(13) + char(10);
}
}
} catch (CInternetException *e) {
TRACE("err code is %d",e->m_dwError);
}
f.Open("out.htm",CFile::modeCreate|CFile::modeWrite);
f.Write(strGetSentence,strGetSentence.GetLength());
f.Close();
}
//Code_End
Maybe you have understood what I want.Just post data and get response from server.But result is out.htm is empty,I can not get response.
What's the problem with my code?
Thanks!
|
|
|
|
|
Hi,
I am trying to update(add,edit,delete) records to MS Access database from a dialog box. I created a dialog box by using AppWizard. Also, i created a derived class of CRecordset by using ClassWizard. The following is my ONOK function:
void CComplaintDlg::OnOK()
{
complaintRecord cr;
cr.Open();
cr.AddNew();
UpdateData();
cr.m_CallerName = m_Complaint_Name;
cr.Update();
cr.Requery();
cr. Close();
CDialog::OnOK();
}
After i compile and run it, it does not update the original data file. What did i do wrong?
Thanks in advance.
Happy holidays!
csgogogo
|
|
|
|
|
Did you select DynaSet while making the DAO class or did you selected Snapshot?
check ur default SQL string in complaintRecord Class !
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
When I use the MAPISendMail command with the MAPI_DIALOG flag it brings up the dialog in Outlook (loading mapi32.dll library) and Outlook Express (loading msoe.dll library). If the mail client is closed, the message will send in Outlook Express, but will sit in the outbox of Outlook until the program is opened and the send/receive button is pressed.
How can I change this behavior?
I can't create a new process of outlook.exe because I do not know if the mail has been sent before killing the process...
Help please. Thank you in advance...
~LizardWiz()
|
|
|
|
|
One solution is to drop MAPI and use SMTP instead. PJ Naughter has written a very handy, easy to use, MFC class that wraps the SMTP protocol. You can get it at http://www.naughter.com/smtp.html[^].
The only potential drawback on using this class is that the mail sent is not stored in your OE Sent Items folder so you will have to devise your own method of logging out going emails if you want to keep track of them.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks for the reply but unfortunately the people who I am doing this project for want the Outlook message email dialog to come up (the one with the <SEND> button), hence the need for the MAPI.DLL...unless someone has a better idea.
Too bad your a Canucks fun but I am willing to overlook that fact because you are a hockey fan...Go Kings!
~LizardWiz()
|
|
|
|
|
I am doing a c++ program and i met some problems in order to call the declaration function. what should I do in order to call the implementation function properly?
Thank you for you all helping.
in the declaration part,.....
mxArray * mlfImproved_DA1(mxArray * * targets,
mxArray * train_features,
mxArray * params) {
int nargout = 1;
mxArray * features = mclGetUninitializedArray();
mxArray * targets__ = mclGetUninitializedArray();
mlfEnterNewContext(1, 2, targets, train_features, params);
if (targets != NULL) {
++nargout;
}
features = Mimproved_DA1(&targets__, nargout, train_features, params);
mlfRestorePreviousContext(1, 2, targets, train_features, params);
if (targets != NULL) {
mclCopyOutputArg(targets, targets__);
} else {
mxDestroyArray(targets__);
}
return mlfReturnValue(features);
}
in the main program......
mwArray *features;
mwAarray **targets; //109
features = mlfImproved_DA1( targets, x, m1 ); //110
……………..
after Compiling...
matlabfunction.cpp
C:\foo\matlabwizard\matlabfunction.cpp(109) : error C2065: 'mwAarray' : undeclared identifier
C:\foo\matlabwizard\matlabfunction.cpp(109) : error C2100: illegal indirection
C:\foo\matlabwizard\matlabfunction.cpp(110) : error C2664: 'mlfImproved_DA1' : cannot convert parameter 1 from 'class mwArray' to 'struct mxArray_tag ** '
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Error executing cl.exe.
matlabfunction.obj - 3 error(s), 0 warning(s)
Vincent Sim
|
|
|
|
|
What is mwAarray?
Kuphryn
|
|
|
|
|
mwArray is the variable declaration used for MATLAB C++ LIBRARY.
merry xmas , kuphryn
vincent sim
|
|
|
|
|
;)
Don't you know about mwarray, let me give you a big good referece. see the book written by Deitel .
I really want to discuss visual C++.
|
|
|
|
|