1:程序无法注册,必须手写regsvr32命令才可以
我的注册文件:
HKCR
{
WordAddin.Addin.1 = s 'Addin Class'
{
CLSID = s '{DFEE930E-DE5D-4AC4-A9CA-5105E822C4E1}'
}
WordAddin.Addin = s 'Addin Class'
{
CLSID = s '{DFEE930E-DE5D-4AC4-A9CA-5105E822C4E1}'
CurVer = s 'WordAddin.Addin.1'
}
NoRemove CLSID
{
ForceRemove {DFEE930E-DE5D-4AC4-A9CA-5105E822C4E1} = s 'Addin Class'
{
ProgID = s 'WordAddin.Addin.1'
VersionIndependentProgID = s 'WordAddin.Addin'
ForceRemove 'Programmable'
InprocServer32 = s '%MODULE%'
{
val ThreadingModel = s 'Apartment'
}
'TypeLib' = s '{AD6E596C-0AA0-4861-A763-B83EAA45BBAE}'
}
}
}
HKCU
{
  Software
  {
    Microsoft
    {
      Office
      {
        Word
        {
          Addins
          {
            ''WordAddin.Addin''
            {
              val FriendlyName = s ''WORD Custom Addin''
              val Description = s ''Word Custom Addin''
              val LoadBehavior = d ''00000003''
              val CommandLineSafe = d ''00000000''
            }
          }
        }
      }
    }
  }
}

解决方案 »

  1.   

    2:我在其中添加了一个ATL的对话框,在对话框中添加了一个combox,但是不知道怎样用代码控制它,比如给它添加item等
      

  2.   

    1) 你是说编译的时候不能自动注册? 而手工运行regsvr32 xxx.dll 可以? 那么是不是自定义的后处理指令没了?
    2) SendDlgItemMessage
      

  3.   

    to krh2001(边城浪子):
    1) 就是编译的时候不能自动注册而手工运行regsvr32 xxx.dll可以,什么是自定义的后处理指令没了?2)用SendDlgItemMessage可以设置combox中的text的值即
    SendDlgItemMessage(IDC_COMBO1,WM_SETTEXT,0,(LPARAM)"aaaa"); 
    但是用SendDlgItemMessage(IDC_COMBO1,WM_ADDSTRING,(LPARAM)"aaaa"); 却没办法添加item,要怎么样添加item呢?
      

  4.   

    HKCR
    {
    OfficePlug.OfficeAddIn.1 = s 'OfficeAddIn Class'
    {
    CLSID = s '{EF09EAB1-89F9-4646-9403-C1D2456323DE}'
    }
    OfficePlug.OfficeAddIn = s 'OfficeAddIn Class'
    {
    CLSID = s '{EF09EAB1-89F9-4646-9403-C1D2456323DE}'
    CurVer = s 'OfficePlug.OfficeAddIn.1'
    }
    NoRemove CLSID
    {
    ForceRemove {EF09EAB1-89F9-4646-9403-C1D2456323DE} = s 'OfficeAddIn Class'
    {
    ProgID = s 'OfficePlug.OfficeAddIn.1'
    VersionIndependentProgID = s 'OfficePlug.OfficeAddIn'
    ForceRemove 'Programmable'
    InprocServer32 = s '%MODULE%'
    {
    val ThreadingModel = s 'Apartment'
    }
    'TypeLib' = s '{BB5888D5-2D27-4894-BCC6-4230E86A698D}'
    }
    }
    }HKCU
    {
    Software
    {
    Microsoft
    {
    Office
    {
    Word
    {
    Addins
    {
    'OfficePlug.OfficeAddIn'
    {
    val FriendlyName = s '数字金刚'
    val Description = s '数字天空'
    val LoadBehavior = d '00000003'
    val CommandLineSafe = d '00000000' 
    }
    }
    }
    }
    }
    }
    }
    不能自动注册是因为你编译器设置的事[忘记是哪一项了]
      

  5.   

    1)
    告诉你怎么设置: 你可以先检查一下是不是没有定义这个:
    在工程设置对话的 Custom bulid 页下. Command 里有没有这样一行:regsvr32 /s /c "$(TargetPath)"没有的话, 加上去,就可以编译后自动注册了2) 我想你搞错了, 设置文本是 WM_SETTEXT 没错, 但不要以为 其它消息也是 以 WM_ 开头的.
    向 COMBOBOX 添加一个串 是 消息 CB_ADDSTRING:CB_ADDSTRING
    An application sends a CB_ADDSTRING message to add a string to the list box of a combo box. If the combo box does not have the CBS_SORT style, the string is added to the end of the list. Otherwise, the string is inserted into the list, and the list is sorted. To send this message, call the SendMessage function with the following parameters. SendMessage( 
      (HWND) hWnd,              // handle to destination window 
      CB_ADDSTRING,             // message to send
      (WPARAM) wParam,          // not used; must be zero
      (LPARAM) lParam          // string to add (LPCTSTR)
    );
    Parameters
    wParam 
    This parameter is not used. 
    lParam 
    Pointer to the null-terminated string to be added. If you create the combo box with an owner-drawn style but without the CBS_HASSTRINGS style, the value of the lParam parameter is stored as item data rather than the string it would otherwise point to. The item data can be retrieved or modified by sending the CB_GETITEMDATA or CB_SETITEMDATA message. 
    Return Values
    The return value is the zero-based index to the string in the list box of the combo box. If an error occurs, the return value is CB_ERR. If insufficient space is available to store the new string, it is CB_ERRSPACE. 
      

  6.   

    HKCR
    {
    NoRemove AppID
    {
    '%APPID%' = s 'WordAddin'
    'WordAddin.DLL'
    {
    val AppID = s '%APPID%'
    }
    }
    }HKCU
    {
        NoRemove Software
        {
            NoRemove Microsoft
            {
                NoRemove Office
                {
                    NoRemove Word
                    {
                        NoRemove Addins
                        {
                            ForceRemove WordAddin.WwxAddin 
                                    {
                                    val 'FriendlyName' = s 'Word2000 Addin'
    val 'Description' = s 'Word2000 Addin'
    val 'LoadBehavior' = d 3
    val 'CommandLineSafe' = d 1
                                    }
                        }                }            }        }    }}
      

  7.   

    第一个在Project Setting->Custom Build里
    第二个可以SDK函数解决,如果你在工程里先择了MFC支持的话可以用CComboBox类,如果没有选择又想使用CComboBox的话,可以下一个WTL(最近老是向别人推荐WTL^_^)。
      

  8.   

    to krh2001(边城浪子):1)Project Setting->Custom Build里面为:
      command:regsvr32 /s /c "$(TargetPath)" 
    echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" 
      output:$(OutDir)\regsvr32.trg
    2)上面写错了,我用的就是CB_ADDSTRING 还是不行
      

  9.   

    to  firmbird(firmbird) :
    我试了WTL,但是ADDSTRING仍然没反应
      

  10.   

    HWND hWnd=::GetDlgItem(对话框窗体句柄,控件ID)
    CComboBox box(hWnd);
    box.AddString(itemA);
    box.AddString(itemB);
    这样不行吗?