Request for loading Lib or DLL from C++

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
threedslider
Enthusiast
Enthusiast
Posts: 377
Joined: Sat Feb 12, 2022 7:15 pm

Request for loading Lib or DLL from C++

Post by threedslider »

Hello

I don't know if it was asked before but I request a special for the feature as CallClass(0, "Name classe", "Name constructor", "Name function1", "Name function2", ...)

And after reading the documentation from PB, I suggest to make as pseudo code :

Code: Select all

If OpenLibrary(0, "MyClass.lib")

InterfacePOO Myclass = CallClass(0, "MyClass")
PrototypePOO Constructor_default() = CallClass(0, "MyClass", "MyClass()")
PrototypePOO Constructor1(text.s) = CallClass(0, "MyClass", "MyClass(char)")
PrototypePOO Constructor2(number.i) = CallClass(0, "MyClass", "MyClass(int)")
PrototypePOO Constructor3(number2.f) = CallClass(0, "MyClass", "MyClass(float)")
PrototypePOO Destructor() = CallClass(0, "MyClass", "~MyClass()")
PrototypePOO Function() = CallClass(0, "MyClass", "myMethod())")
endInterfacePOO

myObjectClass.MyClass

myObjectClass\Constructor1("Hello")
myObjectClass\Constructor2(15055)
myObjectClass\Constructor3(15055)
myObjectClass\Function()

FreeOOP(myObjectClass.Destructor())

Endif
Any thought of that ? Is it good or not as style programming ?