StrictImport pub.Win32 ?Win32 'Import "-lshell32" Extern "Win32" Function FreeLibrary:Int(hModule:Int) End Extern ?Graphics (800, 600)Global WantedLib:String = "DllsToBeCompiled/MyDllLib.dll"Local CurrentText:String#dannyRepeat Cls Local A If KeyHit(KEY_1) Then Local Library DrawText ("Reading Lib", 50, 50) Library = LoadLibraryA (WantedLib) If Not Library Then LibError(WantedLib) 'Local PrintSomething:String() = GetProcAddress (Library, "PrintSomething") 'Print PrintSomething() 'PrintSomething = Null FreeLibrary(Library) Delay (100) Print "DoneFree" A = 1 End If DrawText("Press 1 to load Lib", 10, 10) DrawText(CurrentText, 10, 30) If A = 1 Then Print "A=1" Flip Until KeyDown(KEY_ESCAPE)'--------------------------------'Function LibError(LibURL:String) Notify "Library not Loaded or not Found: " + LibURLEnd Function
You can navigate around this by ending your declaration with ! . This means 'use this above all else'
Type Example_Type Method Play() Print "Testing" End MethodEnd Type