|
What is the type of SnapList (is it a MFC list ?) ? How do put elements in this list ? How do you create the CSnp objects ?
|
|
|
|
|
Its a CObList object. Add elements by using
CSnp *pCSnp = new CSnp;
SnapList.AddTail(pCSnap);
Anu
|
|
|
|
|
Run it in the debugger with a breakpoint at the delete line -
is the pSnp pointer valid? Does it point to a valid object?
Are you sure the problem isn't in the line BEFORE the delete?
Why is that cast there?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
modified on Saturday, August 16, 2008 2:42 PM
|
|
|
|
|
I have wrote the following code for login as admin and edit boot.ini file
if( SetPrivilege(hToken, lpszPrivilege, bEnablePrivilege))
{ if(LogonUser(username,".",password,LOGON32_LOGON_INTERACTIVE,LOGON32_PROVIDER_DEFAULT,&hToken))
{
if(ImpersonateLoggedOnUser(hToken))
{ if(CreateProcessAsUser(hToken,0,cmdLine,0,0,FALSE,CREATE_NEW_CONSOLE,0,0,&si,&pi))
{
editbootini();CloseHandle(pi.hThread); CloseHandle(pi.hProcess);
return TRUE;
}
else
{
AfxMessageBox("Failed");
}
closeHandle(hToken);
}
}
else
{
AfxMessageBox("Administrator password is wrong");
exit(0);
}
}
The boot.ini file is edited in non-admin successfully but cmd.exe as administrator is still running after finishing edit.how i kill that in vc++
|
|
|
|
|
This is the main error from a series of compiler problems I ran into, and complained about in the Lounge. This forum seems more relevant for this particular problem.
When switching from one computer to another (both with Visual Studio 2005), I got "fatal error C1902: Program database manager mismatch; please check your installation" when compiling.
The help for this error says: "A program database file (.pdb) was created using a newer version of mspdb80.dll than the one found while compiling."
Deleting the Debug directory and reinstalling the compiler had no effect; the error remains. The code compiles and links perfectly on the other machine.
Does anyone have any ideas what could be causing this problem? Thanks!
|
|
|
|
|
Does one machine have a service pack installed?
I've never had any problems moving all binaries and
source back and forth between machines.
(sorry I haven't seen the lounge posts)
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Good idea. I'll check if service packs have been installed. Thanks!
|
|
|
|
|
That solved the problem! (I'd give you another 5 if I could!)
|
|
|
|
|
Awesome! Thanks for the update - good to know
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
One thing I have had to do was make Visual Studio completely forget the prior compile, and compile again. Delete the .NCB file and the .SUO file. Delete all of the files in the Release directory and the Debug directory. Make sure you keep the .SLN and VCProject files. You indicate that this is an install on a new machine. You may be encountering some collisions with GUIDs on the new machine. Do the following from an editor other than Visual Studio. Execute guidgen.exe using the Register Format, create a new GUID, copy to clip board, exit, use the editor to replace the GUID for the solution. Repeat for the project, but remember that this GUID exists in several places in the solution and also in the project. Do this for each different project. In each .VCProject file, do the same thing for any GUIDs created for IncludeFiles, SourceFiles, etc. Close the editor for the solution and all of the projects. Click on the solution and Visual Studio will rebuild all of the deleted files.
This works for me, your mileage may vary.
Tell us here whether this works.
Note. All program files used by the compile must be transfered to the new computer, in the same directories. If different directories, then edit the project files first with the non-Visual Studio editor, not the IDE.
Dave Augustine.
|
|
|
|
|
Hi,
I am working with Treecontrol that has checkboxes first time. How can I handle the click of checkboxes?
Which WM I have to use?
|
|
|
|
|
|
I am getting the error, I think this is for CListView
"error C2065: 'TVN_ITEMCHANGED' : undeclared identifier"
modified on Friday, August 15, 2008 1:13 PM
|
|
|
|
|
My bad - TVN_ITEMCHANGED seems to require at least Vista.
|
|
|
|
|
MPTP wrote: How can I handle the click of checkboxes?
Check out TVN_ITEMEXPANDING and TVN_ITEMEXPANDED .
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hello everyone,
I am writing a client which could acccess server using .Net passport authentication approach. i.e. my client handles client side logics for .Net passport authentication.
Any reference implementations? I have searched for quite some time, no sample client implementation.
thanks in advance,
George
|
|
|
|
|
It seems to be that my array has a problem because when I perform Arithmetic Operations it gets only the last string but I force it to double. here is the code.
#include <iostream>
#include <string>
#include <stack>
#include <cctype>
#include <cassert>
using namespace std;
#include <sstream>
string infixTOposfix(string);
int evaluarRPN(string);
int main ()
{
string infix,
dummy,
posfixWspaces;
double result;
char repeat;
do {
cout << "\nPlease enter the expression in INFIX: ";
getline(cin,infix);
posfixWspaces = infixTOposfix(infix);
cout << "This is the expression in POSTFIX: " << posfixWspaces << endl;
result = evaluarRPN(posfixWspaces);
cout <<"the expression is valid.";
cout <<"the answer is "<<result;
cout << "\nDo you want to repeat? Enter 'y' ";
cin >> repeat;
getline(cin,dummy);
} while ( repeat == 'y');
system("PAUSE");
return 0;
}
string infixTOposfix(string exp)
{
char token;
char topToken;
stack <int>opStack;
string postfixExp;
const string BLANK = " ";
for (int i = 0; i < exp.length(); i++ )
{
token = exp[i];
switch(token)
{
case ' ' : break;
case '(' : opStack.push(token);
break;
case ')' : for (;; )
{
assert (!opStack.empty());
topToken = opStack.top();
opStack.pop();
if (topToken == '(') break;
postfixExp.append(BLANK + topToken);
}
break;
case '+' : case '-' :
case '*' : case '/': case'%':
for (;; )
{
if (opStack.empty() ||
opStack.top() == '(' ||
(token == '*' || token == '/' || token == '%') &&
(opStack.top() == '+' || opStack.top() == '-'))
{
opStack.push(token);
break;
}
else
{
topToken = opStack.top();
opStack.pop();
postfixExp.append(BLANK + topToken);
}
}
break;
default :
postfixExp.append(BLANK + token);
for(;; )
{
if ( !isalnum(exp[i+1]) ) break;
i++;
token = exp[i];
postfixExp.append(1, token);
}
}
}
for (;; )
{
if (opStack.empty()) break;
topToken = opStack.top();
opStack.pop();
if (topToken != '(')
{
postfixExp.append(BLANK + topToken);
}
else
{
cout << " *** Error in infix expression ***\n";
break;
}
}
return postfixExp;
}
int evaluarRPN(string posfijo)
{
stack<int> numStack;
int x,
y,
toInt;
string number;
for (int i = 0; i < posfijo.length(); i++ )
{
if ( isdigit(posfijo[i]) )
{
number = posfijo[i];
stringstream ss( number );
ss >> toInt;
numStack.push( toInt );
}
else if (posfijo[i] != ' ' )
{
y = numStack.top();
numStack.pop();
x = numStack.top();
numStack.pop();
if (posfijo[i] == '+')
numStack.push( x+y );
else if (posfijo[i] == '-')
numStack.push( x-y );
else if (posfijo[i] == '*')
numStack.push( x*y );
else
numStack.push( x/y );
}
}
return numStack.top();
}
</int></int></sstream></cassert></cctype></stack></string></iostream>
could someone help me pls.
|
|
|
|
|
Maito Gai wrote: could someone help me pls.
The two questions here remain unanswered.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hello everyone,
Does anyone have a recommendation for a simple reference implementation for Http basic and digest implementation, as mentioned in RFC 2617?
I have made some search but failed to find.
thanks in advance,
George
|
|
|
|
|
Hai Dear;
Can anyone tell me how to get a data or member variable value from one class to another class. Thanks for help.
Regards,
Selvan.S
|
|
|
|
|
Well, that's not a very good question, is it?
Let's take two classes, A and B. Now B wants to make a query to A. So, A must implement a method, which in turn queries the value of the member variable and returns it.
The answer is way too generic, because the question was generic too. If you show us some code on what and how are you trying to do something, we may guide you further. I am asking you to be a little more specific.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
humm global variable should be automatic advice for beginners
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
I want to learn visual C++ and I read some chapters of Visual C++ In 21 Days by I didn't enjoy it .
please give me a hand with this !!
tnx
|
|
|
|
|
razi_Seyyedi wrote: ...I read some chapters of Visual C++ In 21 Days by I didn't enjoy it .
please give me a hand with this !!
You need a hand reading?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|