Module BaseClass (Module as Object)

Share your advanced PureBasic knowledge/code with the community.
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Module BaseClass (Module as Object)

Post by mk-soft »

Ok.
i have changed my example :wink:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
step11
New User
New User
Posts: 7
Joined: Tue May 31, 2016 7:19 am

Re: Module BaseClass (Module as Object)

Post by step11 »

Great !! Thanks for your code.
Than what's your next plan?what about implementing multi interfaces? or even IDispatch interface?
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Module BaseClass (Module as Object)

Post by mk-soft »

It should not make any more difficult to create these ones.
For multiinterfaces only in QueryInterface has to call from another module the function New().

The function number and the name as key are already stored for IDispatch. Own Debuggerfunction ShowInterface.
However, the parameter list must still be stored.

But use less with Windows...
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Module BaseClass (Module as Object)

Post by mk-soft »

Update v1.27
- Bugfix BaseClass as DLL: Macros created codes as procedure encapsulated because on some Windows 7 machine crashed
- Code cleanup, some internal name changed
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Module BaseClass (Module as Object)

Post by mk-soft »

Update v1.28
- Changed internal class management because of the rules for creating DLLs
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Module BaseClass (Module as Object)

Post by mk-soft »

Update v1.29
- Dispose object work now revers
- Save LinkedList Initialize object and Dispose object over Mutex
- Added global ObjectCounter over all Classes

:wink:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Module BaseClass (Module as Object)

Post by mk-soft »

Update v1.31
- Spelling Correction: Initalize -> Initialize

Sorry, I did not notice it until ...

Correct your own projects with 'Search and Replace'.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Module BaseClass (Module as Object)

Post by Kwai chang caine »

Spelling Correction: Initalize -> Initialize
I have spent a long time to understand the error is always in the above code :oops: :lol:
Nice works, thanks for sharing 8)
ImageThe happiness is a road...
Not a destination
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Module BaseClass (Module as Object)

Post by mk-soft »

Thanks :wink:

I have now update example 9. We need threadsafe.

Code: Select all

CompilerIf #PB_Compiler_Thread = 0
  CompilerError "Use compiler option theadsafe"
CompilerEndIf
P.S. Now updated all examples :wink:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Module BaseClass (Module as Object)

Post by mk-soft »

Update v1.32
- Change internal Initialize and Dispose from list to array to avoid thread blocking
- Added small version of BaseClass. 'Modul_BaseClassSmall.pb'

:wink:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Module BaseClass (Module as Object)

Post by mk-soft »

BaseClass small version

Update v1.05
- Now compatible to extended version
+ Macro AsNewMethode, Macro CloneObject

Still the smallest code for creating objects 8)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Module BaseClass (Module as Object)

Post by mk-soft »

Update small v1.07 and advance v1.33
- bugfix FreeMutex
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: Module BaseClass (Module as Object)

Post by Andre »

If I will ever use "OOP-style" code for programming in PureBasic, then I start with this nice piece of code... :mrgreen:
Thank you :D
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Module BaseClass (Module as Object)

Post by mk-soft »

New version of small version :wink:

Update v1.09r3
- Map of classes encapsulated
- Check of the new class in procedure 'AddClass(...)' extended
- Change Macros because map of classes not longer global
- Change CheckInterface. Parameter is not longer required
- Name of classes not longer case sensitive (no case)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Module BaseClass (Module as Object)

Post by mk-soft »

Update v1.10
- Change ClassName Management.

The module name is no longer the internal class name.
This means that the interface name is now specified for inheritance, and not the module name.
Is therefore more logical.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply