Hi Tony,
We have exactly what you asked. Here is how we deal with :
1. Create 1 DLL per customer with the same name (mydll.dll)
2. In the DLL, create a dummy function like this :
FUNCTION fInitDLL() AS VOID
RETURN
3. For any class in the DLL, add this following code for Init
and Axit methods :
METHOD Axit() CLASS MyClass
IF !InCollect()
UnRegisterAxit(SELF)
ENDIF
RETURN NIL
METHOD Init() CLASS MyClass
RegisterAxit(SELF)
RETURN SELF
4. Add the following code in your EXE where you want initialize
the DLL :
pJam := _VOLoadLibrary("mydll.dll")
IF pJam == NULL_PTR
TextBox{,"MyApp","DLL could not be loaded
!!!",BOXICONHAND}:Show()
//QUIT APP or do something else
ELSE
IF !( pAddress := GetProcAddress( pJam , PSZ("fInitDLL") )) ==
NULL_PTR
PCALL(pAddress)
ELSE
TextBox{,"MyApp","DLL Entry point 'fInitDLL' is missing
!!!",BOXICONHAND}:Show()
//QUIT APP or do something else ENDIF
ENDIF
As somebody wrote before in the thread, it's recommended to have
the same functions, cl*****, methods, ... in each DLL
With this, you don't need to include the DLL or DLL prototypes
in the EXE.
If you need more info., send me an email.
HTH,
--
Phil Mermod
Crystal Re****ts Library for Visual Objects
http://www.pkl.ch/dev/
Tony Holland wrote:
> Hey, here's a question I know some-one can answer -
>
> I wish to provide the same functions (im****t and ex****t) for
> different customers where each customer has a different
> transfer protocol.
>
> I have all the different protocols in the App and the setup
> selects the appropriate protocol for the installation.
>
> Question: Can I put the different protocols into different DLLs
> (thereby reducing the EXE size) and distribute just the one
> dll to each. I suspect all the DLLs will have the same name so
> the App can call it as needed, but each one will perform it's
> role differently as required by the customer.
>
> Question 2: did the first question make sense?
>
> Thanks
> Tony


|