vo_to_net:pcall
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| vo_to_net:pcall [2018/07/11 15:10] – wolfgangriedmann | vo_to_net:pcall [2018/07/29 05:22] (current) – wolfgangriedmann | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| The X# compiler needs a typed function pointer for '' | The X# compiler needs a typed function pointer for '' | ||
| - | < | + | < |
| RETURN 0 | RETURN 0 | ||
| .... | .... | ||
| Line 10: | Line 10: | ||
| dword( _cast , PCALL( hFunc ,@struOS) )</ | dword( _cast , PCALL( hFunc ,@struOS) )</ | ||
| The alternative (to not define such a function) is to use '' | The alternative (to not define such a function) is to use '' | ||
| - | < | + | < |
| PCALLNative< | PCALLNative< | ||
| The .NET way would be the definition of a delegate (i.e. a typed function pointer). Please see [[: | The .NET way would be the definition of a delegate (i.e. a typed function pointer). Please see [[: | ||
| A sample for the delegate version is the following: | A sample for the delegate version is the following: | ||
| - | < | + | < |
| local oFunc as RtlGetVersionDelegate | local oFunc as RtlGetVersionDelegate | ||
| Line 22: | Line 22: | ||
| To simplify the code, a static method could help: | To simplify the code, a static method could help: | ||
| - | < | + | < |
| static method CreateDelegate< | static method CreateDelegate< | ||
| Line 36: | Line 36: | ||
| end class</ | end class</ | ||
| and to be used: | and to be used: | ||
| - | < | + | < |
| (Code courtesy of Chris Pyrgas) | (Code courtesy of Chris Pyrgas) | ||
vo_to_net/pcall.1531321837.txt.gz · Last modified: 2018/07/11 15:10 by wolfgangriedmann