Help Needed for CSerialPort v1.27 - Page 2
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

Thread: Help Needed for CSerialPort v1.27

  1. #16
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,605

    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 online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,605

    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
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,847

    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. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  7. #22
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,605

    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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center