slang-users mailing list

[2000 Date Index] [2000 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Slang & Windows


I got it to compile as a DLL in VC++ 4.0 a long
time ago.

One problem I encountered was that I was using Slang
in a GUI.  The default way WIN32 slang is compiled
it expects to be linked with the console-based libs.
So, when you try to link with a gui, it goes boom.

I made 0.9x into a DLL a while ago.

1.2.x and 1.3.x suffered the GUI cant link with
the libs made with the makefile business.

(fixing this is just changing one switch in the makefile).

As far as making the 0.99 DLL.

Steps I *RECALL* I did (this could be DAMN wrong,
and I was using VC++)

1) Make a new .DLL project 
2) manuall add ALL the SLang .c files to the 
project as appropriate, including Slwin32tty.
In a gui project the funcs in slwin32tty will compile
& link but they won't do anything as there is no console.
3) In a seperate header or slang.h [ :-( ], make sure you
__declspec(dllexport) all the slang files you figure you
might need to call.  Or, do it some other way (if the
compiler still uses .def's)

The steps were easiest for me, because by doing step #1
the darn build flags, etc, were set right and I didnt have
to spend anytime scratching my head over why the dll/imp
lib isnt building.

steps #1 and #2 together will take 10 mins or so.

I believe in 15 minutes or so I built a DLL with NO exports
(which of course made it unusable).  Then a .def file
or something of the sort to export quickly followed.


In the end, I used slang 0.9x (forget exactly the ver
number) in a MFC/COM application.

It worked like this:

The MFC app had plugins.  Each plugin was basically
had of course dialogs, etc that could pop up.  Slang was
used to do "form validation" on the dialogs.  Each
plugin came with its own ".sl" file.  The "plugin"
was a COM component which followed the "plugin" interface.

During  "plugin->init()", the COM object would load
the slang script it came with, and would call its
script function (naming standard was used to avoid clashes)
to validate data entry.

The MFC app would load a "standard library" consisting
of intrinsics and a slang file that plugins could use
to aid them.  

The app was distributed to clients over a WAN.  
re-releasing files costed serious $$$.  Slang was used
because the minimum size for a DLL in this case was
50-70k+, where slang scripts tended to be less than 5-8k
and compressed like mad!  It definitly saved ALOT OF
MONEY, as the previous release of the project had
accumulated alot of cost via releases specficially because
of validation related changes.

Also, it gave onsite people the ability to modify 
validation rules in events of emergency.
(one rule, ie, must be 21 or older was universally true,
except ONE day in ONE city where they wanted the rule
to be 18 for 24 hrs.  No prob -- we can dial into
that site and fix it in 35 seconds).

Anyway -- I ramble.  The whole point -- the DLL worked,
and we DLL-ified it in case fixes to slang came out in
which we needed so all we had to do was send down slang
instead of a multi-meg patch (expensive).  I know at the
time the project was complete I emailed Jdavis and said
"Thanks a meeelion for slang."

I've used it on other projects as well, and current
ones, which are exciting... but NDA'd.


----- Original Message ----- 
From: Marius Gedminas <mgedmin@xxxxxxxxxx>
To: <slang-workers@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, January 20, 2000 4:54 AM
Subject: Re: S-lang & Windows


> On Wed, Jan 19, 2000 at 08:17:31PM +0000, Andre Renaud wrote:
> > Has anyone had any luck getting S-lang to compile to .DLL or
> > something similar under windows? I've had a go using MingW32,
> > but I seem to be missing vital header files (ioctl.h I think it
> > was). This is all being done using the cross compiler btw,
> > compiling under linux for a windows DLL.
> 
> I did once (using CygWin under Windows NT).  Actually, I was trying to
> compile Mutt, but it wouldn't work without the curses emulation which is
> disabled in the Win32 version :(  I'm still going to try it again some
> day (that's why I've subscribed to this list).
> 
> Marius Gedminas
> -- 
> Never trust a smiling Gates.



[2000 date index] [2000 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]