1 . CRegKey::QueryValue 的详解及例子.
2 . 只知道控件的ID,如何得到对应类的指针?

解决方案 »

  1.   

    1 . CRegKey::QueryValue 的详解及例子.CRegKey::QueryValue
    LONG QueryValue( DWORD& dwValue, LPCTSTR lpszValueName );LONG QueryValue( LPTSTR szValue, LPCTSTR lpszValueName, DWORD* pdwCount )Return ValueIf successful, returns ERROR_SUCCESS; otherwise, an error value.ParametersdwValue[out] The value field’s numerical data.lpszValueName[in] Specifies the value field to be queried.szValue[out] The value field’s string data.pdwCount[in, out] The size of the string data. Its value is initially set to the size of the szValue buffer.ResRetrieves the data for the specified value field of m_hKey. The first version of QueryValue allows you to retrieve numerical data. The second version allows you to retrieve string data.2 . 只知道控件的ID,如何得到对应类的指针?
        GetDlgItem(YourID)->GetParent()
      

  2.   

    2.     ((CYourClass*)GetDlgItem(YourID))->....GetDlgItem(YourID)取得指针,但这是一个wnd类指针,使用强制类型转换后就是你的类的指针。