没关系,我的也这样
你直接用就行了
m_addr.SetAddress(192,168,0,2);
一次就ok了
bug

解决方案 »

  1.   

    那用GetAddress(&dword)怎么分解呢?
      

  2.   

    msdn
    A reference to the address of a DWORD value that receives the IP address. See Res for a table that shows how dwAddress is filled
      

  3.   

    干嘛要分解?
    int GetAddress( BYTE& nField0, BYTE& nField1, BYTE& nField2, BYTE& nField3 );
    直接就得到了4个
      

  4.   

    呵呵,您可以直接调用GetAddress(BYTE&,BYTE&,BYTE&,BYTE&)来得到分割后的地址。您也可以自己来分割。有几个宏可以帮你完成这样的操作:FIRST_IPADDRESS(LPARAM lParam),SECOND_IPADDRESS(LPARAM lParam),THIRD_IPADDRESS(LPARAM lParam),FOURTH_IPADDRESS(LPARAM lParam);在设置的时候,您可以直接调用如下的方式:SetWindowText(_T("192.168.0.1")),或SetAddress(192,168,0,2)或DWORD dwAddress = MAKEIPADDRESS(192,168,0,2),SetAddress(dwAddress)
      

  5.   

    有谁能告诉我,该对象你实际用的成功的,而不是看MSDN得出的结果
    我实际使用时编译都能通过,但实际运行时就不能用了。
      

  6.   

    什么意思?
    我就成功了啊
    请看:
    BOOL CAboutDlg::OnInitDialog() 
    {
    CDialog::OnInitDialog();

    // TODO: Add extra initialization here
    m_addr.SetAddress(192,168,0,2);
    return TRUE;  // return TRUE unless you set the focus to a control
                  // EXCEPTION: OCX Property Pages should return FALSE
    }void CAboutDlg::OnOK() 
    {
    // TODO: Add extra validation here
    if(!UpdateData())return;
    BYTE b1,b2,b3,b4;
    m_addr.GetAddress(b1,b2,b3,b4);
    CString add;
    add.Format("%d.%d.%d.%d",b1,b2,b3,b4);
    MessageBox(add);
    CDialog::OnOK();
    }就这么点,我在控件上随便改,结果是对的,ok了
      

  7.   

    BUG: IntelliSense Limitations with C++ Classes 
    ID: Q190968 
    --------------------------------------------------------------------------------
    The information in this article applies to:Microsoft Visual C++, 32-bit Enterprise Edition, version 6.0--------------------------------------------------------------------------------
    SYMPTOMS
    This article discusses some of the limitations of IntelliSense when working with classes. The following problems are addressed: Class constructors do not activate Parameter Info. 
    Private members display in Members list for an object outside of the class definition.
    IntelliSense may not recognize standard Win32 data types in member functions when default parameters are used. 
    IntelliSense does not recognize the member functions of a few new MFC classes, such as CIPAddressCtrl, CMonthCalCtrl, CRebar, and CRebarCtrl. STATUS
    Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATION
    The following is a code sample that illustrates the limitations described in this article. This sample should be placed into a header file: 
       // 
       // Test.h : IntelliSense Class Limitations
       //    //void IntelliSenseFix(DWORD,UINT);   class CIntelliSense
       {
       public :
          CIntelliSense(int n=5) { Num = n; }
          void Win32Types(DWORD dw=10, UINT ui=6) {}
          void MFCProblem()
          {
             CMonthCalCtrl calCtrl;
          }   private :
          void PrivateFunction() {}
          int Num;
       } 
    Create a Visual C++ MFC project, and include the header file above into a source file. 
    Class Constructors Do Not Activate Parameter Info
    Type the following line of code into the source file:    CIntelliSense CIs( 
    Notice that no Parameter Info appears for the optional parameter "n" in the class constructor. 
    Private Members Display in Members List Outside the Class Definition
    Type the following lines of code into the source file:    CIntelliSense CIs;
       CIs. 
    The Members list for the CIntelliSense class should appear after typing the period. Notice that it contains the PrivateFunction member function and the Num member variable. Although these functions and variables appear in the Members list, they will generate a compiler error C2248 if used. Private member variables and functions can not be used outside of the class in which they are defined. IntelliSense May Not Recognize Standard Win32 Data Types in Member 
    Functions When Default Parameters Are Used
    Type the following lines of code into the source file:    CIntelliSense CIs;
       CIs.Win32Types( 
    Notice that only the first DWORD parameter appears in the Parameter Info for this function. IntelliSense does not provide Parameter Info for the second parameter of this function. When an unknown data type is used in a member function parameter list, IntelliSense stops parsing the function at that point. At times, IntelliSense does not recognize Win32 data types as valid data types when used in member functions. This is related to the use of default parameters, and it causes Parameter Info and Type Info to generate a truncated list of function parameters. The only way to avoid this problem is to use the data type outside of a default parameter list before it is used in the member function. This has to occur in the same file that contains the class definition. The following is a workaround: 
    Identify all of the data types that are having this problem. 
    Create a global function prototype above the class where the problem occurs. 
    Place each of the data types that IntelliSense doesn't recognize in the function's parameter list. 
    In the sample code, remove the comments from the global IntelliSenseFix prototype function. The complete Parameter Info and Type Info now appears for the Win32Types function. IntelliSense Does Not Recognize the Member Functions of a Few New MFC 
    Classes, such as CIPAddressCtrl, CMonthCalCtrl, CRebar, and CRebarCtrl
    In the CIntelliSense::MFCProblem function, enter a new line after the instantiation of the CMonthCalCtrl object. Insert the following code:    calCtrl. 
    The Members list will appear, but it does not include the member functions for CmonthCalCtrl; however, it does include the members for the CWnd class. REFERENCES
    For additional information, please see the following article in the Microsoft Knowledge Base: Q153284 Limitations of IntelliSense in Visual C++ 6.0 
    "About Automatic Statement Completion;" Visual C++ Documentation, Using Visual C++, Visual C++ Users Guide, Text Editor, Overview: Text Editor, About Automatic Statement Completion. "Automatically Completing Statements;" Visual C++ Documentation, Using Visual C++, Visual C++ Users Guide, Text Editor, How do I ... Topics: Text Editor, Automatically completing Statements. Additional query words: kbvc600 Keywords : 
    Version : WINDOWS:6.0 
    Platform : WINDOWS 
    Issue type : kbbug 
    Technology : kbvc