俺初学COM技术内幕,在配书源码的第十一章中的程序总是运行出错,请大侠帮忙解决:-)
编译都是对的
我先执行register.bat注册,然后启动server,在命令行中执行client
选1时client报错如下
To which server do you want to continue?
1) In-proc Server
2) Local Server
:1
Client:  Attempt to create in-proc component
CUnknow:  Not aggregating: delegate to nondelegating iUnknow.
Component: LoadRegTypeLib Failed, now trying LoadTypeLib.
Error (8002801d): Library not registered.Component:    LoadTypeLib Failed.
Error (80029c4a):  Error loading type library/DLL.CUnknown:   Increment reference count for final realease.
Component:  Destroy self.
Client:     Could not create component.
Error (80029c4a): Error loading type library/DLL.
我的环境提WinXP+VC6.0

解决方案 »

  1.   

    应该是LINK中的PROJECT OPTION中的LIB要设置一下吧
      

  2.   

    我把程序打包放在[email protected]的草稿箱中密码00000000程序编译可以通过,注册后运行就是不成功,请高手帮忙解决对了不要修改我的邮箱密码噢,谢谢!!!
      

  3.   

    怎么老是没人回帖,这里没有COM高手吗?
      

  4.   

    开始放在桌面上,跟了一下,没看见什么问题,发现同你结果一样。
    后面放到C:\目录下,就正确了。如下:C:\CHAP11\CHAP11>client
    To which server do you want to connect?
    1) In-proc Server
    2) Local Server.
    :1
    Client:         Attempt to create in-proc component.
    CFactory::CreateInstance
    CUnknown:       Not aggregating; delegate to nondelegating IUnknown.
    Client:         Successfully created component.
    Client:         Use interface IX.
    Component:      FxStringIn received a string:  This is the test.
    Client:         FxStringOut returned a string:  [String from FxStringOut]
    Client:         Release IX.
    CUnknown:       Increment reference count for final release.
    Component:      Destroy self.
    应该是注册时汉字路径问题,注册类不支持汉字,双字节字符,你自已改改吧,反正在C:\目录下是对的。