|
Either use the Unicode function _wtoi() , or GetDlgItemInt() which will do the conversion for you.
|
|
|
|
|
amitmistry_petlad wrote:
WCHAR w_Year[260];
GetDlgItemText(hDlg,IDC_EDIT_YEAR,w_Year,MAX_PATH);
<code>char * Year=" ";
sprintf(Year,"%s",w_Year);</code>
int int_Year=atoi(Year); is there any other way to get int value;
That is part of your problem - even though you are creating a non-const pointer Year , you are assigning it to a constant string, not a real writable buffer, so the code will crash in sprintf(...) when it tries to copy into the memory pointed to by Year . (BTW - %s and %S can be used to format ANSI or Unicode strings in either kind of build; the uppercase %S version formats the opposite type, so in an ANSI build, %S formats a wide string into a narrow buffer, and in a Unicode build it does the opposite.)
The other solutions you have received will get you the integer value of the string obtained from IDC_EDIT_YEAR , but you still should know that what you have tried to do is dangerous.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hello,
I'm trying to create a CArchive ar (&f, CArchive::load) object from file f, but when i'm using ar.ReadString()it returns wide characters from chinese charset.The file contains only ascii characters. UNICODE is defined in the application.Do you know what may be the problem? Is there any function usefull?
|
|
|
|
|
Post some code to others understanding.
|
|
|
|
|
Hi all.
I wont to write windows service using "Windows Service" in CLR, but I dont know how it works and whot I can do - whot I cant do.
if you know some booke (English or Russa[Russia]) tell me where can I find it.
thanks for help.
|
|
|
|
|
|
|
Thanks it help me lot.
David.
|
|
|
|
|
Hi!
I need to display a 2-D array as a graph (using a dialog). The data of the array comes from a file using ostream. Im using VC 6.
How do I go abt doing it? Im totally clueless.
Can I use CBitmap and how?
Thanks in advance.
|
|
|
|
|
You need to get the device context first. then use functions from CDC class.
The functions in this class take various parameters. These parameters could be the values that you read from the file using ostream as you are doing already.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
If you need to display a graph, you can take a look here[^] and see if that is what you are looking for.
|
|
|
|
|
Dear all,
This is venkat. We have a very huge project, migrated from vc6.0 to vc7.1
But there is a problem arising at the compilation time.
When the project is compiled for the first time, its giving some compiler errors saying few identifiers are not found even with argument look up etc..etc... But when the same code is being compiled for the second time, without doing any modifications, the compile is success and its working.
I would be glad if anyone helped me to avoid this situation in our compilation...
Thanks and Regards,
venkat.
hi
|
|
|
|
|
Many times what happens is, when u compile the project without CLEANING the project, it gives many or rectified errors, etc. So everytime when u compile the project, first remember to Clean, then Build or ReBuildAll.
Come online at:-
jubinc@skype
|
|
|
|
|
Dear Don,
Thank you for the reply.
Actually we are compiling a fresh copy of the project. even then it is giving the same. can you please suggest me any other methods to follow through the problem.
with regards,
venkat.
hi
|
|
|
|
|
Are you sure they are compiler errors and not warnings? error's will cause the compile to fail and are shown each time you attempt to compile. Warnings on the other hand will not fail, and are only shown the one time, unless you re-compile the same file.
Since you are changing the compiler for a newer version, I would guess many of your 'errors' are actually warnings about the use of deprecated functions.
Either clean then re-build the whole solution, or go into your options and disable the "minimal rebuild" feature. Either way this will rebuild your whole solution and display all the warnings.
|
|
|
|
|
Dear WalderMort,
Thank you for the reply. But let me explain clearly what is happening here with us....
The situation is like the following....
Our project resides in the Visual Source Safe server. We get the latest versions daily from the server to work with that local copy of the same project. When we give the build for the first time...(or press the Run button |> )
Some compiler errors are popping up..like missing semi colon ';', '(',etc... or it is saying undeclared identifiers..etc..
But when we press the run button for the second time...(without any modifications to the code...)
The exe is getting generated properly...
Please help me in this issue...
Thanks and regards,
venkat.
hi
|
|
|
|
|
Could it be that somewhere, somehow, in your Project you are generating Code?
When this code is missing, you see the errors, and in the second run, when the code is already there, everything compiles fine.
Then this would be a problem of compile-time-dependencies, to be set as "Project Build order".
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Hello,
I want to create a user defined class which has to work like CButton. That means, from any application by instanciating CButton we can create the CButton window as a child. In the similar manner i require a class which will create a group box and a radio button if we instantiate the button like below.
CMyControl myControl(_T("GroupBox Title"), _T("RADIO BUTTON"), CRect, this ptr)
In this first parameter is used to put the title for Group Box and the second parameter is for type of the control to be created inside the group box. Third is for size of th group box. Fourth parameter is for ptr to where this control needs to be attached.
For the time being we can use the label of radio button be "Radio 1". Can any one help me to write a class like this?
Thanks,
KirriK
|
|
|
|
|
Derive u'r class from CWnd and then u can create button-like, radio-like or checkbox-like controls.
Come online at:-
jubinc@skype
|
|
|
|
|
Can i have any samples? I am sorry i can't come online now. I am in my workplace there it is not possible to come online.
-KirriK
|
|
|
|
|
hi
I would kike to know how we can change the buffer size of eicon card for receiving and sending data.
Arun
|
|
|
|
|
hi,
I have to write a function which accepts Xml file (ex:sample.xml) as input and sending it to other function,
Please help me by giving your suggestions.
Thanks in advance.
Siddharth
|
|
|
|
|
siddharthsan wrote: I have to write a function which accepts Xml file (ex:sample.xml) as input and sending it to other function,
do you need FileName or File COntent!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Thanks
Actually, it should accept the file content as input and it should send it to a parser(other function).
Siddharth
|
|
|
|
|
where do u want our suggessions is it reagarding accepting the file or regarding parser?
KIRAN PINJARLA
|
|
|
|