• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

Why I choose SDK over anything else

Started by Patrice Terrier, August 01, 2007, 10:35:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Patrice Terrier

#75
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.

...


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

José Roca

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:


#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
' ========================================================================================


Patrice Terrier

#77
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. 

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

Patrice Terrier

QuoteI'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

Frederick J. Harris

This thread is almost 5 years old and has been read almost 15000 times!

Patrice Terrier

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

Peter Weis

#81
Hello property still someplace the disk lie around of PBDK. Anybody needs the disk? :)

Windows via Interrupt! ;D

Greetings Peter

Patrice Terrier

#82
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.
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Peter Weis

#83
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!

Patrice Terrier

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

Theo Gottwald

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.

Patrice Terrier

#86
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.

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

José Roca

¿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.


Patrice Terrier

#88
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++.

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

Charles Pegge

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:


  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