Startbeitrag von Leo am 01.11.2010 18:27
Hi,
I'm trying to use a .NET DLL into a windev 12 project (tell me if my problem could be solved with 14 or 15). I have to issues i can't work around:
1) I have an event in my .net library that returns an Image as an argument. I'd like to catch that event, but I cant figure how to add the event with the argument in windev. My .NET argument has this signature:
Public Event evtMyNetEvent(ByVal MyImage As Drawing.Bitmap)
As the windev documentation says, i have to add the event handler. If I define something like this, the project compiles and I can run the application:
MyObject:add_evtMyNetEvent (DotNetDelegate("MyEvent", "MyNetObject.evtMyNetEvent"))
But I get a run time error, something about the missing argument. The windev documentation says that the definition should be something like this:
MyObject:add_evtMyNetEvent (DotNetDelegate("MyEvent", "MyNetObject.evtMyNetEvent"))
I can't define the without getting a design time error. I don't know what should be en this case. Anyone could help? And how does my windev's procedure definition has to be to capture that event an put that image in a picture control?
2) My .NET libraries has several functions returning object collections:
System.Collections.ObjectModel.Collection(Of MyObject)
How can I retrieve that collection in windev, and how can I iterate its elements?
Regards!
I'm trying to use a .NET DLL into a windev 12 project (tell me if my problem could be solved with 14 or 15). I have to issues i can't work around:
1) I have an event in my .net library that returns an Image as an argument. I'd like to catch that event, but I cant figure how to add the event with the argument in windev. My .NET argument has this signature:
Public Event evtMyNetEvent(ByVal MyImage As Drawing.Bitmap)
As the windev documentation says, i have to add the event handler. If I define something like this, the project compiles and I can run the application:
MyObject:add_evtMyNetEvent (DotNetDelegate("MyEvent", "MyNetObject.evtMyNetEvent"))
But I get a run time error, something about the missing argument. The windev documentation says that the definition should be something like this:
MyObject:add_evtMyNetEvent (DotNetDelegate("MyEvent", "MyNetObject.evtMyNetEvent"))
I can't define the without getting a design time error. I don't know what should be en this case. Anyone could help? And how does my windev's procedure definition has to be to capture that event an put that image in a picture control?
2) My .NET libraries has several functions returning object collections:
System.Collections.ObjectModel.Collection(Of MyObject)
How can I retrieve that collection in windev, and how can I iterate its elements?
Regards!
Antworten:
Old Post -Re: .NET DLL - event's arguments and object collections
I am having a similar problem with DotNetDelegate. I can't create a delegate that is accepted by the .NET assembly. I have a C# example that works. I can access many of the initialization functions in the .NET assembly except for setting the callbacks. See below. I show only the "Streaming" callback for example purposes.
If anyone can help, I would gladly pay for help as long as I can afford it!
Thanks,
Jeff
My WD code and procedure:
C# Example code:
von Jeff Graham - am 05.10.2013 16:04