delphi如何调试com+组件?????,应该注意什么问题

解决方案 »

  1.   

    首先注册Com+组件。
    然后进行调用如下:function QueryMyData(const sSQLCommand:string):string;
    var
      vObj:Variant;
      vData:OleVariant;
    begin
      CoInitialize(nil);
      vObj := CreateOleObject('Library_ADO.DelphiADOServer');//注册的COM组件名称
      try
        vObj.QueryMyData(sSQLCommand,vData);
        Result := vData;
      finally
        vObj := unassigned;
        CoUninitialize;
      end;
    end;
      

  2.   

    project-〉options-〉linker-〉include Td32 info 和 include remote debug symbol 选上
    再选择客户端工程运行
      

  3.   

    1.运行RUN|PARAMETERS
      HOST APPLICATION 填入 {系统路径}\system32\dllhost.exe
      PARAMETERS       填入 /processID:{xxxxxxxxxxxxxxxxxxxxxxxxxxxxx}
    2.打开组件管理
      选择组件安装所在的组的属性,在高级这页里选择调试,打勾就可以了。
    月亮:有时断点断不下来是不是因为没有勾上include Td32 info 和 include remote debug symbol?
    现在组件多了,调试不过来,只好自己showmessage:)
      

  4.   

    调试COM+与调试DLL有点类似,不过觉得这种调试结果不是很理想,正在寻求一种更高级的调试方法!
      

  5.   

    只要关联正确的EXE文件和正确的输出路径,调试COM+和DLL不是差不多吗?