注册免费的COM与Windows 7 VB6 [英] Reg Free Com with VB6 on Windows 7

查看:175
本文介绍了注册免费的COM与Windows 7 VB6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我从VB6代码中使用了一些.NET代码。我一直通过创建列出的依赖.NET组件的VB6.exe.manifest文件开发了这个XP的机器上。

I have some .NET code I use from VB6 code. I have always developed this on an XP machine by creating a VB6.exe.manifest file that listed the dependent .NET assemblies.

例如,说我的2 .NET程序集是Some.Assembly.A.dll和Some.Assembly.B.dll,这里是VB6.EXE.manifest长相喜欢(我用的版本= 1.1.0.0下方,因为这是我在AssemblyInfo.cs中的.NET的AssemblyVersion设置版本):

For example, say my 2 .NET assemblies are Some.Assembly.A.dll and Some.Assembly.B.dll, here is what VB6.EXE.manifest looks like (I use version=1.1.0.0 below because that is the version I set on the .NET AssemblyVersion in AssemblyInfo.cs):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
   manifestVersion="1.0">
  <assemblyIdentity
              type = "win32"
              name = "client"
              version = "1.1.0.0" />
  <dependency>
    <dependentAssembly>
      <assemblyIdentity
                  type="win32"
                  name="Some.Assembly.A"
                  version="1.1.0.0" />
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity
                  type="win32"
                  name="Some.Assembly.B"
                  version="1.1.0.0" />
    </dependentAssembly>
  </dependency>
</assembly>

然后,在同一目录下的DLL文件一起,我有集会和自己的清单文件。下面是一个例子Some.Assembly.A.dll.manifest:

Then, along with the DLLs in the same directory, I have the assemblies and their own manifest files. Here is an example "Some.Assembly.A.dll.manifest":

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" 
  manifestVersion="1.0">
  <assemblyIdentity
      type="win32"
      name="Some.Assembly.A"
      version="1.1.0.0" />
  <clrClass
      clsid="{F1234567-1234-1234-1234-123456789012}"
      progid="Some.Assembly.A.Class1"
      threadingModel="Both"
      name="Some.Assembly.A.Class1" >
  </clrClass>
  <file name = "Some.Assembly.A.dll" />
</assembly>



我还引用的DLL运行 tlbexp 创建TLB文件,而这正是我在VB6的项目文件中引用。

I also run tlbexp on referenced DLLs to create TLB files, and this is what I reference in my VB6 project file.

我想移动到Windows 7 64位机。用同样的方法,当我打的实例化WIN7机器上的.NET对象VB6的代码中,我得到

I want to move to a Windows 7 64 BIT machine. Using the same methods, when I hit the VB6 code that instantiates the .NET object on the WIN7 machine I get

ActiveX组件 ŧ创建
对象。

"ActiveX Component Can't Create Object."

在XP中,它成功。如果我故意拼错从属大会VB6.EXE.manifest - 在XP中,我得到

On XP, it succeeds. If I purposely misspell the Dependent assembly in VB6.EXE.manifest - on XP I get

此应用程序未能启动
,因为德的应用程序配置
不正确。重新安装
程序可能修复问题。

"This application has failed to start because teh application configuration is incorrect. Reinstalling the application may fix this problem."

在WIN7 ,VB6只是加载。这就像它忽略了对WIN7的清单,因此,使用WIN7上免费REG我的方法不能载入我的.NET对象。如果我 regasm 的DLL,一切正常。结果
如何使VB6的工作与WIN7(64位)章免费的COM任何想法?

On WIN7, VB6 just loads. It's like it ignores the manifest on WIN7, so I can't load my .NET object using REG FREE methods on WIN7. If I regasm the DLL, everything works.
Any ideas on how to make VB6 work with reg free com on WIN7 (64 BIT)?

推荐答案

您是否尝试过简单的安装和放大器;在WinXP中兼容模式下运行VB6?

Have you tried simply installing & running VB6 in WinXP compatability mode?

这篇关于注册免费的COM与Windows 7 VB6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆