|
ThatsAlok wrote: since you couldnot add char* to CString
yes, but the string resource is unicode, widechar, so not "char *", it is "wchar_t *", so IMHO is, as OP said it is wide char string, proper solution is to correct the logical error(type casted with LPCSTR), rather than fixing compilation error (CString (char *));
|
|
|
|
|
you are right! but could you add wchar_t* to CString?
I am giving answer to different question and you are different question and we both are right in our sense .. but just suffering misconception
"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/codeProject$$>
|
|
|
|
|
ThatsAlok wrote: you are right! but could you add wchar_t* to CString?
try this,
wchar_t * resource = L"wide char resource string";
CString str = CString ("Prefix") + resource;
CString has operator + for this.
ThatsAlok wrote: I am giving answer to different question and you are different question
I thought so (not now ), and i did't crossed your reply .
|
|
|
|
|
Rajkumar R wrote: wchar_t * resource = L"wide char resource string";
CString str = CString ("Prefix") + resource;
brother if that LPCTSTR, then how + operator work when envionment is UNICODE!
"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/codeProject$$>
|
|
|
|
|
ThatsAlok wrote: brother if that LPCTSTR, then how + operator work when envionment is UNICODE!
well,
try this,
LPCTSTR resource = _T("wide char resource string");
CString str = CString ("Prefix") + resource;
Have you tried before replying?
|
|
|
|
|
Rajkumar R wrote: LPCTSTR resource = _T("wide char resource string");
Sorry with LPCSTR not LPCTSTR
"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/codeProject$$>
|
|
|
|
|
what you are playing, u said with wchar_t *, then LPCTSTR, then now LPCSTR. for LPCSTR i already told that is wrong cast in this context.
|
|
|
|
|
Rajkumar R wrote: then LPCTSTR
man LPCTSTR will itself take care of type conversation!. anyway leave the topic, you win!.. where do you live!? it seems you are from india
"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/codeProject$$>
|
|
|
|
|
also it is nice discussion with you dude.. where so you work!
"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/codeProject$$>
|
|
|
|
|
|
see this [^]
And why you are using explicit resource loading for string, as LoadString() API is available.
|
|
|
|
|
neha.agarwal27 wrote: LPCSTR data = (LPCSTR)LockResource(hResData);
LPCTSTR data = (LPCTSTR) LockResource(hResData);
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You may try LPCTSTR or LPSTR. If LPCSTR doesnt exist then that is why you cannot cast the type. Maybe show the value of hResData and look up the return type of LockResource without type casting. Some type conversions are incorrect.
Wha, who,.... Oh, it was just a good dream. I keep having them. Why can't I have nightmares!?
|
|
|
|
|
Hi...
In Button Event Iwrote
CMatlabEng matlab;
matlab.Open(NULL);
Here CMatlabEng is Predefined Class...
In MySystem MATLAB Is Opening ..because In My PC MATLAB is Installed.. In Other PC's MATLAB Is not Opening...Because MATLAB Is not Installed..PLZ Any Body Help me...Plz ....
#sanroop#
|
|
|
|
|
johnalek wrote: In MySystem MATLAB Is Opening ..because In My PC MATLAB is Installed.. In Other PC's MATLAB Is not Opening...Because MATLAB Is not Installed
i think you answered.
|
|
|
|
|
johnalek wrote: In Other PC's MATLAB Is not Opening...Because MATLAB Is not Installed..PLZ Any Body Help me...Plz ....
then you have check there weather MATLAB is installed or not! or create the utlity which check weather MATLAB is installed or not, if it not install then install matlab on that PC
"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/codeProject$$>
|
|
|
|
|
Hi Can you please let me know some article or API??
Thanks,
Sandip.
|
|
|
|
|
|
Thanks!!
|
|
|
|
|
You're welcome.
|
|
|
|
|
Hamid. wrote: You're welcome.
hows life dude!
"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/codeProject$$>
|
|
|
|
|
Hi Alok
How are you?I think you are busy.
ThatsAlok wrote: hows life dude!
Well near to terrible!
|
|
|
|
|
Hamid. wrote:
Well near to terrible!
he he he! what happen!
"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/codeProject$$>
|
|
|
|
|
Well I want to leave computer and science computer because I could not find a programming job with C++ even secretary.
|
|
|
|
|
hey why so.. you are genius in c++ programming!
"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/codeProject$$>
|
|
|
|