Skip to content

petrSchreiber/Calling-PowerBASIC-DLL-from-Rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calling PowerBASIC DLL from Rust

The purpose of this project is to show how Rust can talk with PowerBASIC generated DLLs.

Let's get started

You will need PowerBASIC for Windows version 10.04 to compile the DLL and Rust to call it.

Installing PowerBASIC

  • If you are interested in this repo, you probably already have PowerBASIC for Windows.

Installing Rust

  • Download and install the Build Tools for Visual Studio.
  • Install Rust via Rustup. Please customize the installation to ensure 32 bit pipeline currently needed by PowerBASIC:
    • Run the rustup-init.exe
    • Press 2 to alter the default settings
    • For Default host triple? enter i686-pc-windows-msvc
    • For Default toolchain? enter stable
    • For Modify PATH variable? enter y
    • Proceed with installation with 1

How to make the DLL?

  • Open pblib/pblib.bas in PBEdit and press Ctrl+M
  • If you think it did nothing, it did - PowerBASIC is really a blazingly fast compiler
  • The DLL will be automagically put to pblib-test/target/release as pblib.dll

How to test the DLL?

  • Go to pblib-test directory
  • Execute cargo run --release in the root directory of this repo
  • go to pblib-test/target/release and run pblib-test.exe

IDE recommendations

I strongly recommend Sublime Text 3 for Rust editing. It is very elegant. Just boost it with rust-enhanced plugin.

About

Example of calling PowerBASIC dll from Rust lang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages