我正在寻找一个方式做一个PB对象和.NET(C#)客体之间的双向通信。在看着他的GUI 控制的布拉德的.NET版本,我看怎么给.NET对象的PB 对象的引用。但在这个例子中,它转换为成PowerObject(基本上)。 ,C#语言的代码只有PB对象上调用triggerEvent时()。
I'm looking for a way to do two-way communication between a PB object and a .NET (C#) object. In looking at Brad's .NET version of his GUI controls, I see how to give the .NET object a reference to the PB object. But in that example, it's cast as a PowerObject (basically). That C# code only calls TriggerEvent() on the PB object.
我要建立在C#中称为foo1的自定义类。我想创建一个foo1 法BAR1称为()。
I want to create a custom class in C# called foo1. I want to create a method on foo1 called bar1().
我想创建一个PB自定义类名为foo2的。我想创建一个foo2的方法调用BAR2()。
I want to create a custom class in PB called foo2. I want to create a method on foo2 called bar2().
我希望能够foo2的中创建foo1的一个实例。我想能够从foo2的中调用foo1.bar1()。
I want to be able to create an instance of foo1 within foo2. I want to be able to call foo1.bar1() from within foo2.
(我很好,直到在这里。)
(I'm good up until here.)
我希望能够从foo1中引用foo2的。我希望能够从foo1中调用foo2.bar2()。
I want to be able to reference foo2 from within foo1. I want to be able to call foo2.bar2() from within foo1.
推荐答案我肯定有更eligent方式做到这一点,但使用COM可能是最容易的。
I am sure there is a more eligent way to do this, but using COM might be the easiest.
- 的在PowerBuilder中使用COM
- 使用.NET
- Using COM in PowerBuilder
- Using COM in .NET
有人会说,COM是永远正确的答案,但我说使用合适的工作的正确工具。
Some people would say that COM is never the right answer, but I say use the right tool for the right job.
更多推荐
在PowerBuilder中.NET互操作程序
发布评论