Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 2 Jahren, 6 Monaten
Letzter Beitrag:
vor 2 Jahren, 4 Monaten
Beteiligte Autoren:
Ned!, Jeff Graham

[WD18] DotNetDelegate parameters

Startbeitrag von Ned! am 17.12.2015 12:09

Hi,

I am calling a method in a .net dll and I need to catch the events that are generated.

I have added a DotNetDelegate command to my code which I believe is correct (no compilation errors)


ClMyClass:add_Responded(DotNetDelegate(ppResponded,"clientApi.EventHandler"))


The documentation says to use a procedure like:

PROCEDURE ppResponded(src,args)

to process the events.

What I don't understand is what variable type "src" and "args" should be.

Can anybody help me out?

Thanks
Ned!

Antworten:

Hi Ned,

You probably have worked this out but here is an example that might help. The first parameter is just an object and the second parameter is the arguments as passed from the dll which should match that in the DotNetDelegate command.


PROCEDURE setDotNetDelegateProcedure(LOCAL sProcedureName is string)
WHEN EXCEPTION IN
:m_donWDEventHandler = DotNetDelegate(sProcedureName,"WDEventHandler[LT symbol]WDResultArgs[GT symbol]")
:m_onWDAccess.m_PsWin.add_wdResult(:m_donWDEventHandler)
RESULT True
DO
Error("Unable to setDotNetDelegateProcedure.","Check for correct argument format. Class code has example.",ExceptionInfo(errFullDetails))
RESULT False
END


PROCEDURE PvsEventNET(par_Object, par_Args is WDResultArgs)
sReqType is string = par_Args.reqType
nResult is int = par_Args.code
sPvsID is string = par_Args.sID
....

von Jeff Graham - am 01.01.2016 16:27
Hi Jeff,

Thanks for this info... It has moved me a bit further forward, but now I dont know what I should be putting between the [LT symbol] and [GT symbol]?

i.e. How do I find out what the WDResultArgs should be?

Sorry if this seems like a simple quetion!

Thanks
Ned!

von Ned! - am 03.02.2016 12:12
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.