Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Runtime.InteropServices;
- using binderoo;
- //----------------------------------------------------------------------------
- namespace somemodule
- {
- public static class rubbish
- {
- // Function somemodule.rubbish.generateSomeRubbish
- private static ImportedFunction func_generateSomeRubbish;
- private delegate float DelegategenerateSomeRubbish( );
- public static float generateSomeRubbish( )
- {
- if( func_generateSomeRubbish == null ) func_generateSomeRubbish = new ImportedFunction( "somemodule.rubbish.generateSomeRubbish", "float()" );
- DelegategenerateSomeRubbish call = (DelegategenerateSomeRubbish)Marshal.GetDelegateForFunctionPointer( func_generateSomeRubbish.FuncPtr, typeof( DelegategenerateSomeRubbish ) );
- return call( );
- }
- //--------------------------------------------------------------------
- // Function somemodule.rubbish.justPrintSomething
- private static ImportedFunction func_justPrintSomething;
- private delegate void DelegatejustPrintSomething( );
- public static void justPrintSomething( )
- {
- if( func_justPrintSomething == null ) func_justPrintSomething = new ImportedFunction( "somemodule.rubbish.justPrintSomething", "void()" );
- DelegatejustPrintSomething call = (DelegatejustPrintSomething)Marshal.GetDelegateForFunctionPointer( func_justPrintSomething.FuncPtr, typeof( DelegatejustPrintSomething ) );
- call( );
- }
- //--------------------------------------------------------------------
- }
- //------------------------------------------------------------------------
- }
- //----------------------------------------------------------------------------
- public static class anothertestobject
- {
- // Function anothertestobject.doAThing
- private static ImportedFunction func_doAThing;
- private delegate void DelegatedoAThing( int foo, float bar );
- public static void doAThing( int foo, float bar )
- {
- if( func_doAThing == null ) func_doAThing = new ImportedFunction( "anothertestobject.doAThing", "void(int32_t, float)" );
- DelegatedoAThing call = (DelegatedoAThing)Marshal.GetDelegateForFunctionPointer( func_doAThing.FuncPtr, typeof( DelegatedoAThing ) );
- call( foo, bar );
- }
- //------------------------------------------------------------------------
- }
- //----------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement