🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.ms-windows.apps
1 messages
1 total messages Started by A.A. Olowofoyeku Mon, 11 Apr 1994 03:23
WinCmd (WCL) : hooks for programmers (MORE!)
#4071
Author: A.A. Olowofoyeku
Date: Mon, 11 Apr 1994 03:23
95 lines
5352 bytes
Hi all! (again)

         ADDING USER-DEFINED EXTENSIONS TO WCL: DEVELOPMENTS
         ---------------------------------------------------

A few days ago, I posted a message about providing hooks for programmers to
extend the WCL command set, or to add their own functionality. Many thanks
to all those who responded! But I have some further news for you. Some of
the restrictions in the interface I originally provided were as follows;

>
>
[...]
>2. The function which WCL will interface to takes a null terminated string
>   as the ONLY parameter, and returns an INTEGER. It must be defined,
>   EXACTLY thus;
>
>     [a] In Borland PASCAL
>          Function UserProc (Var Parm : PChar) : Integer;
>
>     [b] In C/C++
>          int UserProc (LPSTR Parm);   (or is it *Parm)?
>
[...]
>
> 4. You cannot do any output to the WCL window in your DLL (i.e., no
>    Writeln() in Pascal or output to STDOUT in C/C++) - all communications
>    with the user during the operation of your functions must be by Windows
>    dialog boxes.
>

I have now seen that the last restriction is unnecessary, and I have devised
a way of simplifying the process of directing output to the WCL window -
which should make this interface more useful overall. What I have done is to
pass on the handle of the WCL window to the UserProc() function in your
WCL_EXT.DLL. You can then retrieve the device context of that window with
GetDC() and can direct text to it with TextOut() from your DLL - and to your
heart's content. I am sure the information about the window handle is also
useful for many other things.

The way I have done it to date is to convert the HWnd handle to a string,
and then tag it to the end of the string parameter that you is passed to the
UserProc() function - when that string is parsed, the last substring in it
represents the WCL window's handle - convert this back to a numeric value,
and you get the HWnd (this method will not break anything that anyone has
done up till now, but seems cumbersome and inefficient).

The other way I can do it is to change the UserProc function into one that
takes 2 parameters;

  Pascal;
     Function UserProc (WclWindow : HWnd; Var Parm : PChar) : Integer;

   C/C++;
     FAR PASCAL int UserProc (HWnd WclWindow, LPSTR Parm); (my C is bad!)

This is more efficient and more straighforward, and this is how it will be
implemented when I send out the new version.

In any case, this will require a new copy of the beta package to be sent to
those who already have the first one. I am mindful of the fact that people
may not want me to be sending unsolicited stuff to them - so if you are one
of those who requested the original package, and you are interested in the
new version, please do mail me.

If you have received nothing from me, it is either because you were not
among the first 20 respondents to my original post, or because the stuff I
sent to you bounced back (about 5 have bounced back). I am setting up some
sort of automated response, so the limit of 20 does not apply again. So, if
you didn't get through the first time, please mail me again - I have
concluded that a limit of 20 is arbitrary, and not a good idea - and please
put an e-mail address at the end of your mail (in case the automated
response bounces - as otherwise I will not have any other way of contacting
you except through usenet).

Thanks for your attention and bye.


--
The Chief
---------
Dr. Abimbola Olowofoyeku ( The African Chief)
Keele University         ( All opinions are *not* personal and *do*)
England.	         ( reflect the views of the whole world.)

Email: laa12@keele.ac.uk
       chief@mep.com

Tel  : (0782) 621111
Fax  : (0782) 583228
---------------------------------------------------
"Do you see a man that is wise in his own conceit?
There is more hope for a fool than for him."
                                      King Solomon.
---------------------------------------------------
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads