VB Script code not calling c# function

你离开我真会死。 提交于 2019-12-11 03:23:47

问题


I have created a C# dll and registerd as Com object. (Used ProgID, Set Comvisible True and Sign the assembly using Strong name).

I am trying to call c# method using the below vbscript code

Option Explicit 
Dim testwfhandler 
Set testwfhandler= CreateObject("CoreComponentWorkflow.WorkflowHandler") 
If Not testwfhandler Is Nothing Then     
Call testwfhandler.test()     
End If 
Set testwfhandler= Nothing 

am i missing anything? or am doing anything wrong?

The below is the registry informaton of my registered dll.


回答1:


Make sure you have set ComVisible to True for the C# assembly

Register the assembly using:

regasm /codebase YourAssembly.dll

Then call it as you have above.



来源:https://stackoverflow.com/questions/11418353/vb-script-code-not-calling-c-sharp-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!