PureBasic

Python과 DLL로 연동

홍사훈     0건     369회

본문

1. dlltest.pb 파일 만들기

ProcedureDLL MyFunction() 

   MessageRequester("Hello", "This is a PureBasic DLL !", 0) 

EndProcedure

 


2. DLL로 컴파일

   29ea1c58c70f3a48955b38256ee77c74_1666528

 

3. PureBasic에서 DLL활용

If OpenLibrary(0, "Dlltest.dll") 

   CallFunction(0, "MyFunction")

   CloseLibrary(0)

EndIf

 

4. python에서 DLL활용 

import ctypes as c 

mydll = c.WinDLL('E:\\05_PureBasic\\Dlltest.dll')

myfunc = mydll['MyFunction']

myfunc()

 

   29ea1c58c70f3a48955b38256ee77c74_1666528
 

 

등록된 댓글이 없습니다.



Copyrightⓡ1996~2025, sahoon.com All Rights Reserved.