|
I want to get hash values from two string. I am using the following code snippet for that purpose
locale loc("English_US");
LONG lValue1 = use_facet< collate<_TCHAR> >(loc).hash(&lpszString1, &lpszString1[_tcslen(lpszString1) - 1]);
LONG lValue2 = use_facet< collate<_TCHAR> >(loc).hash(&lpszString2, &lpszString2[_tcslen(lpszString2) - 1]);
This is working fine. But in a few XP system this piece of code is getting hanged. Do you have any clue what could be the possible reason.
Thanks.
modified on Tuesday, September 23, 2008 8:35 AM
|
|
|
|
|
Hello,
i looking for a multicolumn combo box(something like in VBA), is there any known article for this??
Thanks in advance!
termal
|
|
|
|
|
|
Hi,
thanks for help!
regards
termal
|
|
|
|
|
I'm trying to use RasDial to connect through a modem to a network
my code:
RASDIALPARAMS rdParams;
rdParams.dwSize = sizeof(RASDIALPARAMS);
rdParams.szEntryName[0] = '\0';
lstrcpy(rdParams.szPhoneNumber, strPhoneNr);
rdParams.szCallbackNumber[0] = '\0';
lstrcpy( rdParams.szUserName, strUserNr);
lstrcpy( rdParams.szPassword, strPassword);
rdParams.szDomain[0] = '\0';
HRASCONN hRasConn = NULL;
dwRet = RasDial( NULL, NULL, &rdParams, NULL, NULL, &hRasConn );
The RasDial call results in a XP bluescreen. Anybody ever got this error? What should i check for?
Thanks
|
|
|
|
|
eusto wrote: The RasDial call results in a XP bluescreen.
Does this mean that RasDial() is not returning?
"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
|
|
|
|
|
Yes, it is not returning. My whole computer dies.
The fix for me is to use the phone book feature of windows:
RASDIALPARAMS rdParams;
rdParams.dwSize = sizeof(RASDIALPARAMS);
lstrcpy(rdParams.szEntryName,strPredefinedConnectionName);
rdParams.szPhoneNumber[0] = 0;
rdParams.szPhoneNumber[0] = 0;
rdParams.szUserName[0] = 0;
rdParams.szPassword[0] = 0;
rdParams.szCallbackNumber[0] = '\0';
rdParams.szDomain[0] = '\0';
HRASCONN hRasConn = NULL;
dwRet = RasDial( NULL,
"C:\\Documents and Settings\\"
"All Users\\Application Data\\"
"Microsoft\\Network\\Connections\\Pbk\\rasphone.pbk",
&rdParams,
NULL,
NULL,
&hRasConn
);
It's a bit frustrating that i can't use this to work with "on the fly" dialup connections. The windows blue screen really scares me
|
|
|
|
|
So the only difference is the second argument? MSDN states that if this parameter is NULL , the function uses the current default phone-book file. The default phone-book file is the one selected by the user in the User Preferences property sheet of the Dial-Up Networking dialog box. Do you have this set up?
"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
|
|
|
|
|
The difference is in the way i specify the connection to use. I'm telling RasDial to use the strPredefinedConnectionName (ex: a connection named MyDialup that appears in network connections) from the specified phone book.
I've read that in MSDN also but i couldn't find the dialog for this setting. Do you think that the blue screen error is caused by the fact that my default user does not have a phonebook configured?
|
|
|
|
|
eusto wrote: Do you think that the blue screen error is caused by the fact that my default user does not have a phonebook configured?
I would hope not. The BSOD is when Windows has gotten really angry and something totally unexpected has happened in some code. Telling Windows to use a file that does not exist should simply result in a normal "error" message box (i.e., failing gracefully).
I'm sorry I do not have any better suggestions.
"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
|
|
|
|
|
Thanks man. I'll try to read further on this matter and i'll post my answer here
|
|
|
|
|
Hi,
I have a static text which is being initialized during runtime.
I want to change the font size of the static text.
Please tell how to do it.
Thanks & Regards.
Dhiraj Kumar Saini
|
|
|
|
|
with SetFont(), if it doesnt work make CStatic derived class to draww yourself as wanted.
Greetings from Germany
|
|
|
|
|
Hi all,
I am working on vc2008 and when i run its exe on any other machine it gives side by side configration error. I have tried both release and debug mode.
thanks in advance
|
|
|
|
|
missing redistributable libs ?
|
|
|
|
|
|
Someone asked you a question. Answer it first, or tell us that you didn't understand the question.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
ya actually i didn't understood it.....
i thought that it was an answer....
|
|
|
|
|
When you ship your project, you must make sure that the runtime components required by your application are installed on the target computer. All such components are packed as a redistributable by Microsoft and given to us.
The redist for VC 2008 (x86) is available here:
Visual C++ 2008 Redistributables[^]
The other user asked you if you have installed this redistributable on the target computer, where you get a side-by-side configuration error.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
The Dependency Walker will help you. It is a mighty tool in the DDK to find which dlls are needed.
The cryptic "missing redistributable libs ? " is the right answer. You got to install the VC-runtime in the right Version/Servicepack.
Greetings from Germany
|
|
|
|
|
I am progressing with my C++ learning. I am stuck with the following code.
void ChangeData(int** ptr){
int ab = 1000;
*ptr = &ab;
}
int _tmain(int argc, _TCHAR* argv[])
{
int a = 10;
int* aPtr = &a;
ChangeData(&aPtr);
cout << *aPtr << endl;
return 0;
} In the ChangeData method, I am assigning address of a local variable to the supplied parameter. When ChangeData returns to the main, I believe variable ab will get removed from the stack. I was expecing an error when I run the above application, but the above one works!
I am confused how this is happening? If ab is removed from stack, which address the pointer holds and how I am getting correct value?
|
|
|
|
|
The variable is destroyed, but not the contents.
You know the abbress s you can continue to check it's value...but, as you sad, it is wrong, so do not do it. The system can use the same locatio of that variable in any moment after that the variable is destroyed, so the contentents will be soon invalid.
Russell
|
|
|
|
|
Christian Flutcher wrote: I am confused how this is happening?
Because you were lucky (or in your case, not ). In your ChangeData function, your local variable has a certain address which you store in your ptr variable. When the function exits, your ptr variable still holds the same address but as you said, the variable has been 'removed' from the stack. But remove simply means that this memory can be used for other purposes, which in your case you don't so the memory is not overwritten (and still containing the same value). If now you would do other things before printing the value, chances are that it will not work anymore.
|
|
|
|
|
Cedric Moonen wrote: Because you were lucky
Yes, I am.
Cedric Moonen wrote: If now you would do other things before printing the value, chances are that it will not work anymore.
That makes sense.
Thank you all for the help.
|
|
|
|
|
Christian Flutcher wrote: If ab is removed from stack, which address the pointer holds and how I am getting correct value?
Actually, it is not "removed". That particular memory location is being marked as "available for use". But until you use it, the older value exists.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|