[lazarus] LCL Structure Discussion

Cliff Baeseman vbman at pcpros.net
Tue Oct 12 01:37:46 EDT 1999


Hi everyone,

  I would like to open up something here for discussion.

How about if we where to do somehting like this to move things along. First
a little story, for the last few weeks I have been writing a n-tiered app
running off of transaction server. I needed to find a way to communicate
with the sever in a very flexible and efficent manner with as few server
calls as possible. I also wished to do the development without breaking the
COM interface compatibility. Having worked on lazarus for so long I borrowed
one of our ideas.

I created a VB dll "Only because it supports ADO better" and this VB object
had only one public method call.

 Public Function Execute(intMessage as Integer, varData as Variant) as
Variant

Now my Delphi GUI Control just calls this execute method for any thing at
all it needs to do. For instance in my delphi code I call    myRecords =
vbdll.Execute(MSG_QUERY, 'SELECT * FROM tbl_Employee') now the VB dll sees
that this is a Query and takes the data sent and executes a database sql
query and returns a variant array containing the following. myRecords[1] =
status "fail or ok" myRecords[2] = statusmessage myrecords[3] row count 4
was field count and then the records.

Now here is where I am going with all of this. Say I was to build a C++
library that could handle all of the UI calls by passing something like
IntSendMessage(int Message, int WidgetID,  pointer varDataRecord). We then
define a single call back routine that would pass back the WidgetID and a
event message constant. Now the only single problem that I can see with this
is that you would have to have the library to run a lazarus app. On the
other hand we can easily code against GTK+ and KDE and NativeWindows using
this type of messaging. The linux side of the world would have to be written
in C++ but the Windows side of things could be written in a Delphi library
very easily. I do not mind writing the C++ library to handle things I am not
perfect at writing C++ but can hold my own. I do belive I can get some stuff
running very quickly in this fashion. Say for instance we need a source code
editor. We have a free one in linux and in windows, we just add that widget
to the library and away we go. The lcl would just have to recieve the
callback event and pass the message back to the widget ID specified. The
only issue I have not figured out is the data type of the sent in message,
maybe just a pointer to some data?

What do you think....Putting on the Flame Suit in case that sounded totally
stupid.

Cliff















More information about the Lazarus mailing list