简体   繁体   English

VB6-从字节数组调用函数

[英]VB6 - Call Function from Byte Array

In C#, you could call, 在C#中,您可以调用

Assembly.Load(byte[]).GetType("Class").GetMethod("method").Invoke(null, new object[] {
                    "I'm a parameter"
            });

Is there a VB6 equivalent? 是否有等效的VB6?

No, there are no equivalence. 不,没有对等的东西。 Since .COM don't have that feature. 由于.COM没有该功能。 But if you want to call with string(Also with nearest[I say it different because it is'nt from byte array), you can use 但是,如果您要使用字符串调用(也要使用最近的[我说的不一样,因为它不是字节数组中的字符),可以

CallByName(object as Object, funcName as String, functype as vbCallType, paramArray args as any)

object is object that you want to invoke. 对象是您要调用的对象。 It can be a result of CreateObject() function, funcName is a string describing a name, functype is a type of function. 它可以是CreateObject()函数的结果,funcName是描述名称的字符串,functype是函数的类型。 It can be a sub, function get or set. 它可以是一个子函数,功能get或set。 The arg is a arg you want to pass. arg是您要传递的arg。 The two last argument might wrong. 最后两个参数可能是错误的。 So please check out at object ecplorer. 因此,请在对象ecplorer中检出。 The arg might paramArray or an array. arg可能是paramArray或数组。 The enum name of functype might CallType or other. functype的枚举名称可以是CallType或其他。

Assembly.Load(parameter).[GetType]("Class").GetMethod("method").Invoke(Nothing, New Object() {"I'm a parameter"})

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM