Microsoft.Windows.ActCtx在Windows XP [英] Microsoft.Windows.ActCtx on Windows Xp

查看:428
本文介绍了Microsoft.Windows.ActCtx在Windows XP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这几天我正在开发一个ActiveX / COM应用程序非常忙。我们的一些客户是根据严格限制Windows环境中工作。所以,我决定把我的应用程序regfree。我发现这genman32.exe可以轻松地创建清单(也就是mt.exe有用)。一切都很好,但是当我试图,因为应用程序的工作原理上的COM服务器 -



<$ P执行从WSH(VBS或JS)我的应用程序首位,而其有义务为我的情况$ p> 设置O =的CreateObject(Application.Interface)

//没有对象引用

由于的CreateObject看起来到系统登录并没有系统登录入口:)然后我搜索,发现是actctx的东西。这是很容易实现在一个dot.net环境。但是,我必须执行从WSH(VBS或JS)我的应用程序;),所以我决定寻找那么一点点找到

 集合O =的CreateObject(Microsoft.Windows.ActCtx)
o.manifest =L:\\Application.dll.manifest
组应用= o.CreateObject(Application.Interface)
app.Launch()//这是我执行的函数

问题 -
Microsoft.Windows.ActCtx界面在Windows XP机器提供即使在SP3 - 微软不容易让它 -
是否有解决这一问题?你知道吗,创建该接口的任何其他方法或Windows更新?


解决方案

我想通了这个问题与我的清单。我跟其他人谁可能是碰上了类似的问题分享。



使用时,请注意,您必须指定进程id =属性在您的清单这与Microsoft.Windows.ActCtx界面,否则你得到的ActiveX组件无法创建对象错误

 < comClass 
CLSID ={ED59F192-EF2E-4BCC-95EB-85A8C5C65326}
进程id =myclass.process
的ThreadingModel =公寓/>



下面的清单的例子应该让你和运行:)

 <?XML版本=1.0编码=UTF-8独立=YES>?; 
<装配的xmlns =瓮:架构 - 微软COM:asm.v1
manifestVersion =1.0>

< assemblyIdentity
型=win32的
NAME =MyClass的
版本=1.0.0.0/>

<文件名=myclass.dll>

< comClass
CLSID ={ED59F192-EF2E-4BCC-95EB-85A8C5C65326}
进程id =myclass.process
的ThreadingModel =公寓 />

<类型库tlbid ={7AE20C3A-48C2-42C1-A68D-A1C3EB0A2C65}
版本=1.0HELPDIR =/>

< /文件>

< comInterfaceExternalProxyStub
NAME =_ PROCESS
IID ={187D0811-470D-44C0-B68C-C1C7F3EEFDA0}
proxyStubClsid32 ={00020424-0000 -0000-C000-000000000046}
baseInterface ={00000000-0000-0000-C000-000000000046}
tlbid ={7AE20C3A-48C2-42C1-A68D-A1C3EB0A2C65}/>

< /装配>


These days I'm very much busy on developing an activex/com application. Some of our customers are working under heavily restricted windows environments. So i decided to make my application regfree. I found genman32.exe which can easily create manifests (also mt.exe is useful). Everything went fine but when i tried to execute my application from wsh(vbs or js) -which is obligated for my the situation because the application works on a com server-

set o = CreateObject("Application.Interface") 

// No object reference

Because "CreateObject" looks to the registery and there is no registery entry :) then i searched and found the thing that is "actctx". It is very easy to implement in a dot.net environment. But i must execute my application from wsh(vbs or js) ;) so i decided to search a little then found

set o = CreateObject("Microsoft.Windows.ActCtx")
o.manifest = "L:\\Application.dll.manifest"
set app = o.CreateObject("Application.Interface")
app.Launch() // which is my executing function

Problem - "Microsoft.Windows.ActCtx" interface is not available in Windows Xp machines even in SP3 - Microsoft never lets it easy - Is there any solution to that problem? Do You know any other methods or windows update that creates that interface?

解决方案

I figured out the problem with my manifest. I'll share it with anyone else who may have run into a similiar problem.

Please be aware that you MUST specify the progid="" property in your manifest when using this with the "Microsoft.Windows.ActCtx" interface otherwise you get ActiveX Component Can't Create Object error.

<comClass
clsid="{ED59F192-EF2E-4BCC-95EB-85A8C5C65326}"
progid="myclass.process"
threadingModel = "Apartment" />

The following manifest example should get you up and running :)

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" 
  manifestVersion="1.0">

<assemblyIdentity
   type="win32"
   name="myclass"
   version="1.0.0.0"/>

<file name = "myclass.dll">

<comClass
    clsid="{ED59F192-EF2E-4BCC-95EB-85A8C5C65326}"
    progid="myclass.process"
    threadingModel = "Apartment" />

<typelib tlbid="{7AE20C3A-48C2-42C1-A68D-A1C3EB0A2C65}"
       version="1.0" helpdir=""/>

</file>

<comInterfaceExternalProxyStub 
    name="_PROCESS" 
    iid="{187D0811-470D-44C0-B68C-C1C7F3EEFDA0}"
    proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"
    baseInterface="{00000000-0000-0000-C000-000000000046}"
    tlbid = "{7AE20C3A-48C2-42C1-A68D-A1C3EB0A2C65}" />

</assembly>

这篇关于Microsoft.Windows.ActCtx在Windows XP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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