-
May 27th, 2014, 08:59 AM
#16
Re: Help Needed for CSerialPort v1.27
Originally Posted by newborn2
this is what I'm doing.. below is my code. when I push Readpot button, the another dialogue will pop up which consists of 2 edit control box named m_Voltin1 and m_Voltin2 which double type data...
the pop up dialogue name is IDD_Potentiometer with CPotentiometer class while the main dialogue is IDD_My3DbalanceDlg with CMy3DbalanceDlg class.
both data are read from PIC (COMPort). thats why I ask for the conversion from CString to double.
Well I alreadi showed you how to convert text to double (it will work if your CString contains a text representation of the double value, something like "12345.67890".)
Victor Nijegorodov
-
May 27th, 2014, 09:01 AM
#17
Re: Help Needed for CSerialPort v1.27
Originally Posted by newborn2
... Where I should put the COMPort setup like above? in the IDD_My3DbalanceDlg.cpp or IDD_Potentiometer.cpp?
If both dialogs work with the same port then, perhaps, in the main dialog.
Victor Nijegorodov
-
May 27th, 2014, 09:14 AM
#18
Re: Help Needed for CSerialPort v1.27
double dbl = _tcstod(m_Voltin);
error = too few arguments n function call
-
May 27th, 2014, 09:15 AM
#19
Re: Help Needed for CSerialPort v1.27
error = too few arguments in function call. typing error
-
May 27th, 2014, 09:18 AM
#20
Re: Help Needed for CSerialPort v1.27
-
May 27th, 2014, 09:42 AM
#21
Re: Help Needed for CSerialPort v1.27
See http://msdn.microsoft.com/en-us/library/kxsfc1ab.aspx
_tcstod() takes 2 paramaters. The second is a pointer to the char that stops the scan.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
May 27th, 2014, 10:08 AM
#22
Re: Help Needed for CSerialPort v1.27
Originally Posted by newborn2
double dbl = _tcstod(m_Voltin);
error = too few arguments n function call
Originally Posted by 2kaud
2kaud is right.
Sorry for non/correct reply. Just was too lazy to look at the docs.
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|