|
TooShy2Talk wrote: I want to convert a CString to WCHAR but I don't know how to.
It depends on whether you have defined _UNICODE in your application or not. i.e if _UNICODE is define, the CString internally keeps a wchar* itself. so you can simply copy from cstring to wchar_t[] usinf wcscpy() fucntion. If _UNICODE is not define, CString will be internally keeping a char* pointer and you have to covert this char* to wchar_t[] using MultiByteToWideChar() API.
|
|
|
|
|
CString -> CStringW ?
Russell
|
|
|
|
|
If Unicode is not defined, check out the A2W() macro. If Unicode is defined, you can simply use _tcscpy() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sindse ATL 7.0 and MFC 7.0
You can use CStringW (or CStringA )
This code is valid for both Unicode and Multibyte:
CString cMyCString("Test");
CStringW cMyCStringW( cMyCString );
(LPCWSTR) cMyCStringW;
|
|
|
|
|
I am making a toolbar for a website. initially the toolbar is normal and when the user login the toolbar changes and takes the setting for the logged in user as is in the case of Yahoo.
If the user does not work on the website for 18 minutes i.e. if he takes no action he should be logged out and the toolbar should be in its initial state.
Now the problem for me is I am not able to track that no action has been taken on the website and the session of 18 minutes has expired and because of which I am not able to change my toolbar as a aresult of which what happens is that even if the user is logged out of the site after 18 minutes still my toolbar is having the settings for the logged in user.
I am using WIN32 ATL and WTL.
Please help me what to do.
Thanks in Advance.
Dhiraj Kumar Saini
|
|
|
|
|
I think this question would be better asked in a different forum, as it's not really a C++ coding issue - more of a html / webserver question.
Asking over in the Web Development forum would get people who know more than me looking at it!
Iain.
|
|
|
|
|
I have worked in both matlab & VC++ , the same pgm takes so much time when it runs in matlab than in VC++. one of my pgm runs 8 hours in matlab but just 6 mints in VC++.... y is it so??
|
|
|
|
|
Matlab is not an high performance software, it is build to be easy to be used, C++ is optimized during compiling.
If you want to run faster a Matlab routine you can try to write the code in a more optimized way (es. do not use 'for' loop when it is possible, but use matrix aritmetric like addictions or multiplications), then you can also try to compile it in a mex file.
But C++ will be always the fastest.
Russell
|
|
|
|
|
y it is so ? ya i have used matriz form . i wanna know exactly y matlab takes much complie time than VC++..??
|
|
|
|
|
not compile time...but execution time.
there aren't special rules...the only way is try to mesure the execution time (use tic; toc; on matlab)to find what function is slower.
But the general tip is do not use the keyword for , while , if when possible.
Russell
|
|
|
|
|
But Even v r using for, if , while keywords in c++ also??
|
|
|
|
|
it is a little tip that let you write faster matlab routines. In c++ you can use everything.
But, you know, you can write an optimized version of your program in Matlab... but probally you will gain half time(4hours)...surely you can't beat the C++ time (6min).
Russell
|
|
|
|
|
We have several cases where the Matlab-Version is not significantly slower than the C++-Version. Plus Matlab is easier developed.
You seem to have hit a point where recoding the algorithm in C++ gives real benefits.
But in our hands, whe had cases where the algos from 'numerical recipts" were actually slower.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Hi,
I am using VS 2005 on vista platform.
I want to set a registry entry located in HKEY_LOCAL_MACHINE.
The following function fails.
RegOpenKeyEx(HKEY_LOCAL_MACHINE,
"System\\CurrentControlSet\\Control\\Windows",
0,
KEY_SET_VALUE,
&hKey);
The return value of the above API is ERROR_ACCESS_DENIED.
I have logged in as an normal user without any admin privilages.
I know this funciton is failing because I donot have the privilage to perform any write operation.
How do I get around this problem without having Admin privileges?
I want to modify registry value located in HKEY_LOCAL_MACHINE.
Could anybody help me with this issue?
|
|
|
|
|
I think that it is not possilbe ...you need Admin privileges (that is the reason why Admin exist)
Russell
|
|
|
|
|
U will have to execute ur application as "Run as Adminstrator".
Sachin
|
|
|
|
|
Marimuthu.pesit wrote: How do I get around this problem without having Admin privileges?
Temporarily turn off UAC.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Normaly, you set the needed Keys in HKEY_LOCAL_MACHINE at installation time.
Programms write deviations from the defaults to HKEY_CURRENT_USER. That is writable without privileges.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
hi all
can anybody send me vc++ questions with mfc for interview
i go for one year experience in vc++
so please send me some questions which really help me
thanks
|
|
|
|
|
Hai,
I wish you all the best for getting a good job. Mostly questions are coming from C++, MFC basics, Doc/View architecture,controls, threading etc. So, concentrate on more on this. so that you can survive.
Wish you good luck.
|
|
|
|
|
thanks a lot sir
but can i get some sample questions please
|
|
|
|
|
like serialization, messagemaps, RTTI, Frames, dialogs, views, documents, DLL's, Threading concepts. You can easily downloaded from net. otherwise buy a book for interview questions. lot of books are available in roadsided or other book shops.
|
|
|
|
|
Dear friends
I want to write a program in such a way that,if any body tries to access my folder say E:\\chandu i should get an indication to my hidden program.
thanks in advance.
|
|
|
|
|
Have to go for some filter driver like "Filemon"
|
|
|
|
|
i want to know how can i can the api of some executable or better some component of windows.... i want to host some of the windows component in my mfc application... how can this be done...
tHeStRaT
|
|
|
|