Logtext - Documentation
Home - Download - Documentation - Forum - Bug Report - Contact - License Agreement - External Links
 
 
Example program on how to use the DLL logtext.dll - logtextexample
 
This example shows how to implement and call the library from an application.
 
 
 
 

logtext.c

Go to the documentation of this file.
00001 /*
00002         File: logtext.c
00003         This file belongs to logtext.h.
00004         http://www.logtext.de
00005 */
00006 
00007 /* MS compiler */
00008 #ifdef _MFC_VER
00009 /*
00010         If you receive an error C1853 here you have to disable
00011         'Use Precomiled Header' for logtext.c.
00012         See http://support.microsoft.com/kb/126717 for more details.
00013 */
00014 #include "stdafx.h"
00015 #endif
00016 
00017 #include "logtext.h"
00018 
00019 LPLOGTEXT               lpLogText                       = NULL;
00020 LPLOGTEXTEX             lpLogTextEx                     = NULL;
00021 LPLOGTEXTEXQ    lpLogTextExQ            = NULL;
00022 LPSLOGTEXT              lpsLogText                      = NULL;
00023 LPSLOGTEXTEX    lpsLogTextEx            = NULL;
00024 LPSLOGTEXTEXQ   lpsLogTextExQ           = NULL;
00025 HMODULE                 hLogTextDLL                     = NULL;
00026 
00027 int     LoadAndInitializeLogText (char *chLogTextPath)
00028 {       /* Loads the DLL and initializes the function pointers. */
00029         if ((chLogTextPath == NULL) || (strlen (chLogTextPath) == 0))
00030         {
00031                 hLogTextDLL = LoadLibrary ("logtext.dll");
00032                 if (!hLogTextDLL)
00033                         return 0;
00034         }
00035         hLogTextDLL = LoadLibrary (chLogTextPath);
00036         if (!hLogTextDLL)
00037                         return 0;
00038         lpLogText               = (LPLOGTEXT)           GetProcAddress (hLogTextDLL, "LogText");
00039         lpLogTextEx             = (LPLOGTEXTEX)         GetProcAddress (hLogTextDLL, "LogTextEx");
00040         lpLogTextExQ    = (LPLOGTEXTEXQ)        GetProcAddress (hLogTextDLL, "LogTextExQ");
00041         lpsLogText              = (LPSLOGTEXT)          GetProcAddress (hLogTextDLL, "sLogText");
00042         lpsLogTextEx    = (LPSLOGTEXTEX)        GetProcAddress (hLogTextDLL, "sLogTextEx");
00043         lpsLogTextExQ   = (LPSLOGTEXTEXQ)       GetProcAddress (hLogTextDLL, "sLogTextExQ");
00044         if (lpLogText && lpLogTextEx && lpLogTextExQ &&
00045                 lpsLogText && lpsLogTextEx && lpsLogTextExQ)
00046                 return 1;
00047         else
00048                 return 0;
00049 }
 
 
 
 

Home - Download - Documentation - Forum - Bug Report - Contact - License Agreement - External Links