在PowerBuilder中.NET互操作程序 [英] .NET interop in PowerBuilder

查看:262
本文介绍了在PowerBuilder中.NET互操作程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个方式做一个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.

  • 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互操作程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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