Author Topic: Why I choose SDK over anything else  (Read 65848 times)

0 Members and 1 Guest are viewing this topic.

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2022
    • www.zapsolution.com
Re: Why I choose SDK over anything else
« Reply #75 on: October 19, 2011, 04:42:25 PM »
Bob,

I am not bending the truth, this thread is entitled "why i choose SDK over anything else"

I can't see any denigration, i just wrote SDK produces faster and smaller EXE/DLL, that's a fact (and this is also true with the C++ runtime, managed code, and WinDev).

PowerBASIC programmers have the choice to use either the DDT encapsulation, or direct call to the core API.

You give us the choice, and that is fine thank you.

...
 

« Last Edit: October 19, 2011, 10:47:13 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline JosÚ Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2534
    • JosÚ Roca Software
Re: Why I choose SDK over anything else
« Reply #76 on: October 20, 2011, 01:35:44 AM »
I like the power of SDK, but also like simplicity. Therefore, currently I'm using my own wrappers and classes. For GUI programming, the main class is CWindow, that is Ansi, Unicode and High DPI aware, and 100% SDK compatible.

A simple example with a text box and a button:

Code: [Select]
#COMPILE EXE
#DIM ALL
%UNICODE = 1

' // Include files for external files
#INCLUDE ONCE "CWindow.inc"   ' // CWindow class

%IDC_TEXTBOX = 101

' ========================================================================================
' Main
' ========================================================================================
FUNCTION WinMain (BYVAL hInstance AS DWORD, BYVAL hPrevInstance AS DWORD, BYVAL lpszCmdLine AS WSTRINGZ PTR, BYVAL nCmdShow AS LONG) AS LONG

   ' // Set process DPI aware
'   SetProcessDPIAware

   ' // Create an instance of the class
   LOCAL pWindow AS IWindow
   pWindow = CLASS "CWindow"
   IF ISNOTHING(pWindow) THEN EXIT FUNCTION

   ' // Create the main window
   pWindow.CreateWindow(%NULL, "CWindow Test", 0, 0, 0, 0, 0, 0, CODEPTR(WindowProc))
   ' // Set the client size
   pWindow.SetClientSize 500, 320
   ' // Center the window
   pWindow.CenterWindow

   ' // Add a text box control
   pWindow.AddTextBox(pWindow.hwnd, %IDC_TEXTBOX, "This is a textbox", 150, 100, 200, 23)

   ' // Add a button
   pWindow.AddButton(pWindow.hwnd, %IDCANCEL, "&Close", 350, 250, 75, 23)

   ' // Default message pump (you can replace it with your own)
   pWindow.DoEvents(nCmdShow)

END FUNCTION
' ========================================================================================

' ========================================================================================
' Main callback function.
' ========================================================================================
FUNCTION WindowProc (BYVAL hwnd AS DWORD, BYVAL uMsg AS DWORD, BYVAL wParam AS DWORD, BYVAL lParam AS LONG) AS LONG

   ' // Process window mesages
   SELECT CASE uMsg

      CASE %WM_COMMAND
         SELECT CASE LO(WORD, wParam)
            CASE %IDCANCEL
               ' // If the Escape key has been pressed...
               IF HI(WORD, wParam) = %BN_CLICKED THEN
                  ' // ... close the application by sending a WM_CLOSE message
                  SendMessage hwnd, %WM_CLOSE, 0, 0
                  EXIT FUNCTION
               END IF
         END SELECT

      CASE %WM_DESTROY
         ' // End the application
         PostQuitMessage 0
         EXIT FUNCTION

   END SELECT

   ' // Pass unprocessed messages to Windows
   FUNCTION = DefWindowProc(hwnd, uMsg, wParam, lParam)

END FUNCTION
' ========================================================================================

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2022
    • www.zapsolution.com
Re: Why I choose SDK over anything else
« Reply #77 on: October 20, 2011, 10:47:09 AM »
JosÚ,

Yes, that is a good example of the power offered by SDK coding style.
Wrinting our own encapsulation without any limitation, gives us the control on everything.

Also SDK is a must, to write small and fast low level addon DLLs. 

...
« Last Edit: October 23, 2011, 09:16:06 AM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2022
    • www.zapsolution.com
Re: Why I choose SDK over anything else
« Reply #78 on: January 27, 2012, 02:15:38 PM »
Quote
I'm just showing the facts. Pure SDK is harder to use but produces faster and smaller executables

JosÚ Roca
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Frederick J. Harris

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 942
    • Frederick J. Harris
Re: Why I choose SDK over anything else
« Reply #79 on: February 05, 2012, 10:11:54 PM »
This thread is almost 5 years old and has been read almost 15000 times!

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2022
    • www.zapsolution.com
Re: Why I choose SDK over anything else
« Reply #80 on: February 06, 2012, 08:52:56 AM »
I made the big jump myself, at the time of PBDK, if this is something you can remember :)
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 334
Re: Why I choose SDK over anything else
« Reply #81 on: February 06, 2012, 09:19:44 AM »
Hello property still someplace the disk lie around of PBDK. Anybody needs the disk? :)

Windows via Interrupt! ;D

Greetings Peter
« Last Edit: February 06, 2012, 05:11:46 PM by Peter Weis »

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2022
    • www.zapsolution.com
I have learned the passing of Bob Zale (november 6, 2012)
« Reply #82 on: November 27, 2012, 09:23:47 AM »
That was a very sad news, and i think many will felt abandoned, fortunatly SDK coders will survive.

Thank you Bob for your invaluable contribution to the programming community.
« Last Edit: November 27, 2012, 09:25:20 AM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 334
RE: I have learned the passing of Bob Zale (november 6, 2012)
« Reply #83 on: November 27, 2012, 11:12:04 AM »
Hello I thinks that also the very bad one news is!

A black day for the Basic world! :'(

Remembers that Bob would be happy who the PowerBASIC project was continued!
« Last Edit: November 27, 2012, 11:14:45 AM by Peter Weis »

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2022
    • www.zapsolution.com
Re: Why I choose SDK over anything else
« Reply #84 on: November 27, 2012, 12:30:47 PM »
Peter,

With such a strong personnality Bob had, i wonder who could take up on his work...
 
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 965
    • it-berater
Re: Why I choose SDK over anything else
« Reply #85 on: November 27, 2012, 05:48:20 PM »
There will be a gap of course. Always when a strong personality leaves there is a gap.

A gap in competence and more important a gap in Leadership.

There is always a risk that the successors have different ideas and split or fight each other.
And if such happens, the gap can not be filled, and the ship will possibly sink.

In this case the only sollution is, to have one person to clearly have the last word and say where the boat should drive.
To just fill the gap as good as possible. And keep the boat swimming. Any clear direction will be Ok at this time.

Personally i think - but this only an assumption - that even with PB 10 there have been other programmers been involved.

I further assume that Bob could organize what happens next, so i hope they will now be strong and unique.
And keep the boat swimming.
I also believe that this is what Bob would expect of them.
They should not look back to much, but keep his boat in the wind, trying to make things as they expect he would have done them.
And especially be unique and stay together in this hard time.

At a later time they will get the chance to grow in new directions, if they pass this hard time and stay strong.

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2022
    • www.zapsolution.com
Re: Why I choose SDK over anything else
« Reply #86 on: November 27, 2012, 06:25:49 PM »
Theo,

I think you are very optimistic...

I had the dream that PB11 will allow me to create a 64-bit version of my WinLIFT/GDImage with just a {simple} recompile.
But i will probably have to refurbish my VS2010, in order to have it, and this means so much extra work in perspective.

However i think my situation is better than DDT users, and other third party addon providers.

...
« Last Edit: November 27, 2012, 06:28:21 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline JosÚ Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2534
    • JosÚ Roca Software
Re: Why I choose SDK over anything else
« Reply #87 on: November 27, 2012, 06:36:24 PM »
┐A simple recompile? The headers need to be changed as well as all these LONG and DWORD variables used to hold values such pointers and handles. Also the alignment on many of the structures and some other things.


Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2022
    • www.zapsolution.com
Re: Why I choose SDK over anything else
« Reply #88 on: November 27, 2012, 07:55:00 PM »
JosÚ,

Yes i know that, and this is the reason why i enclosed the word "simple" with braces {} ,
but anyway so much simple than to convert all my PB code to C or C++.

 :)
« Last Edit: November 27, 2012, 07:57:05 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Charles Pegge

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 704
    • Charles Pegge
Re: Why I choose SDK over anything else
« Reply #89 on: November 29, 2012, 04:29:42 AM »
It should be possible to produce 32/64 bit cross-compatible headers for PB.

In OxygenBasic I use a type called sys which automatically changes from 32 bits to 64 bits according to compilation mode.

For example:

Code: [Select]
  type WNDCLASSEX
  int cbSize
  int Style
  sys lpfnwndproc
  int cbClsextra
  int cbWndExtra
  sys hInstance
  sys hIcon
  sys hCursor
  sys hbrBackground
  sys lpszMenuName
  sys lpszClassName
  sys hIconSm
  end type

Alignment is internally adjusted so that 64 bit types are aligned to the next 64bit boundary.


Charles