Import c++ DLL with classes

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 375
Joined: Fri Dec 04, 2015 9:26 pm

Import c++ DLL with classes

Post by skinkairewalker »

hello guys, I would like to let you know that it would be interesting to import DLLs with classes in C++
this would make it easier to create wrappers and features for PB, an example of libraries with classes is the SteamWorks library ( steampowered.com )
User avatar
IceSoft
Addict
Addict
Posts: 1513
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: Import c++ DLL with classes

Post by IceSoft »

Code: Select all

#steam = 1
res = OpenLibrary(#steam, ".\steamworks_sdk_151\sdk\redistributable_bin\win64\steam_api64.dll")
Debug res
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Rinzwind
Enthusiast
Enthusiast
Posts: 388
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: Import c++ DLL with classes

Post by Rinzwind »

not helpful.

Anyway, won't happen c++ class style

This might help: "Flat interface for binding to other languages
The SDK has a few features to facilitate the creation of binding layers for other languages.

steam_api_flat.h declares a set of "flat" functions that mirror the interface functions in the SDK. This is not pure C code, but it does use plain C linkage and calling conventions, so it is easy to interop with other languages. These functions are exported by steam_api[64][.dll/.so/dylib]."

https://partner.steamgames.com/doc/sdk/api#thirdparty
Bitblazer
Enthusiast
Enthusiast
Posts: 453
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: Import c++ DLL with classes

Post by Bitblazer »

The upcoming PureBasic Version 6 should make this a lot different and easier.
Post Reply