CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Help Needed for CSerialPort v1.27

    Quote Originally Posted by newborn2 View Post
    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

  2. #17
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Help Needed for CSerialPort v1.27

    Quote Originally Posted by newborn2 View Post
    ... 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

  3. #18
    Join Date
    May 2014
    Posts
    17

    Re: Help Needed for CSerialPort v1.27

    double dbl = _tcstod(m_Voltin);

    error = too few arguments n function call

  4. #19
    Join Date
    May 2014
    Posts
    17

    Re: Help Needed for CSerialPort v1.27

    error = too few arguments in function call. typing error

  5. #20
    Join Date
    May 2014
    Posts
    17

    Re: Help Needed for CSerialPort v1.27

    how to solve that error?

  6. #21
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    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)

  7. #22
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Help Needed for CSerialPort v1.27

    Quote Originally Posted by newborn2 View Post
    double dbl = _tcstod(m_Voltin);

    error = too few arguments n function call
    Quote Originally Posted by 2kaud View Post
    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.
    2kaud is right.
    Sorry for non/correct reply. Just was too lazy to look at the docs.
    Victor Nijegorodov

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured