Alaska Software Inc. - Starting a thread from within WAA
Username: Password:
AuthorTopic: Starting a thread from within WAA
Allen LeeStarting a thread from within WAA
on Mon, 20 Mar 2006 16:54:36 -0800
Thomas Braun
Re: Starting a thread from within WAA
on Tue, 21 Mar 2006 09:13:27 +0100
Allen Lee wrote:

> I wish to create a DLL as a small library of common routines.

Do you need to load this dynamically at runtime?

If not, just do it like me:

[PROJECT.XPJ]
    PACK1.DLL
    PACK2.DLL
    COMMON.DLL   this is my common function DLL

[COMMON.DLL]
    WAA1USER.LIB
    MYWAACLASS.PRG
    SOME_OTHER_ROUTINES.PRG

[PACK1.DLL]
    WAA1USER.LIB
    COMMON.LIB
    SOME_PACKAGE_FUNCTIONS.PRG

[PACK2.DLL]
    WAA1USER.LIB
    COMMON.LIB
    A_FEW_OTHER_PACKAGE_FUNCTIONS.PRG


I simply call all the functions in common.dll by their regular name -
that's it.

HTH
Thomas
Allen LeeRe: Starting a thread from within WAA
on Wed, 10 May 2006 19:29:14 -0700
Michael;

Thank you for your help.  Two questions for you.

1. Why do you add a reference to WAA1USER.LIB?
    What is in WAA1USER.DLL that you use?

2. Does it make a difference to:
    a) add COMMON.LIB to each DLL section of the XPJ file or
    b) add a #pragma Library("Common.lib") line to each of the program files
(as Phil suggested)?
Phil Ide
Re: Starting a thread from within WAA
on Thu, 11 May 2006 11:32:56 +0100
Allen,

> 2. Does it make a difference to:
>     a) add COMMON.LIB to each DLL section of the XPJ file or
>     b) add a #pragma Library("Common.lib") line to each of the program files
> (as Phil suggested)?

When you add a #pragma Library() statement to your code, when the compiler 
creates the *.obj it embeds a reference to the library in it.

When the linker loads the object, it sees the reference and attempts to open 
the library.

If you add the reference to the project file instead, the only difference is 
that the linker recieves the reference to the library on the command-line.

Using #Pragma has two benefits:

  1. You don't need to update your project file just to add the ref to the
     library
  2. It acts as a self-documenting option in your source - when you read the
     source file, you know it is going to require/use this library.

Aside from these semantics, there is no real difference between using a 
pragma and adding the library to the project.

Regards,

Phil Ide

***************************************
* Xbase++ FAQ, Libraries and Sources: *
* goto: http://www.idep.org.uk/xbase  *
***************************************

Shooting is not too good for my enemies.
          [Things I'd do as an Evil Overlord]
Allen LeeRe: Starting a thread from within WAA
on Thu, 11 May 2006 08:21:34 -0700
Phil;
Thanks for answering Q2
Do you have any knowledge about Q1 (waa1user.dll)?

And, Thomas, I apologize for referring to you as Michael (as in Hoffmann)
Phil Ide
Re: Starting a thread from within WAA
on Thu, 11 May 2006 19:06:04 +0100
Allen Lee,
> Phil;
> Thanks for answering Q2
> Do you have any knowledge about Q1 (waa1user.dll)?
> 
> And, Thomas, I apologize for referring to you as Michael (as in Hoffmann)

WAA1USER.DLL contains the following classes:

   CONTEXT - handles session management and fetching CGI information
   HTML3   - handles generation of html pages, sending files to
             web space application, setting http headers, fetching http
             variables and get/set cookies, plus it has error handling
             methods
   FRAMESET- creates frameset pages
   FRAME   - creates frames
   IOCACHE - handles interpolation between WAA and gateway application

Regards,

Phil Ide

***************************************
* Xbase++ FAQ, Libraries and Sources: *
* goto: http://www.idep.org.uk/xbase  *
***************************************

All naive, busty tavern wenches in my realm will be replaced with surly,
world-weary waitresses who will provide no unexpected reinforcement and/or
romantic subplot for the hero or his sidekick.
          [Things I'd do as an Evil Overlord]
Thomas Braun
Re: Starting a thread from within WAA
on Thu, 11 May 2006 19:40:22 +0200
Allen Lee wrote:


> 
> 1. Why do you add a reference to WAA1USER.LIB?
>     What is in WAA1USER.DLL that you use?

I'm using my own html3 class - the base class HTML3
is in waa1user.dll.

HTH
Thomas
Phil Ide
Re: Starting a thread from within WAA
on Tue, 21 Mar 2006 12:53:40 +0000
Allen,

> I wish to create a DLL as a small library of common routines.
> If  I have 2 DLLs loaded: MyFirst.dll and MySecond.dll
> and I have a function named MyTest in MyFirst.dll
> and from MySecond.dll I create a call:
>  
> MyFirstMyTest()
> 
> then I get: "error ALK2102 unresolved external symbol MYFIRSTMYTEST" when creating the MySecond DLL.
> 
> What am I missing here?

When you creating the dll's you need to resolve all references.  Create
MyFirst.dll, then somewhere in the source for MySecond.dll add this:

  #pragma Library("MyFirst.lib")

This will statically bind MyFirst.dll to MySecond.dll.

Regards,

Phil Ide

***************************************
* Xbase++ FAQ, Libraries and Sources: *
* goto: http://www.idep.org.uk/xbase  *
***************************************

All giant serpents acting as guardians in underground lakes will be fitted
with sports goggles to prevent eye injuries.
          [Things I'd do as an Evil Overlord]
Allen LeeRe: Starting a thread from within WAA
on Tue, 21 Mar 2006 11:41:47 -0800