DLLs called from COPIAFACTS should follow normal Windows calling conventions, as described in the example that follows:

An example of a trivial C program which could be called from COPIAFACTS is as follows:


                     DWORD fdwReason,

                     LPVOID lpReserved)


  switch (fdwReason)







  return TRUE;



__declspec(dllexport) int WINAPI TestFunc (int lineno, 

                                           int callno, 

                                           char * arg)


  return strlen(arg);


This program should be built with a definition file as follows:



TestFunc @1

You should select a base address for your library which does not conflict with other DLLs loaded by COPIAFACTS. Even though Windows is supposed to re-base DLLs to avoid conflicts, this is not always successful. Standard CopiaFacts DLLs use the space from 0x11000000 to 0x11FFFFFF but DLLs from hardware manufacturers may use other ranges.

If you encounter a conflict, loading your DLL may result in a Windows error. Re-run COPIAFACTS and key 'D' to display a list of DLL addresses already in use by the program.