#include #include "logtext.h" #define APPNAME "MyApplication" /* Use this to store the log file in a sub folder 'Logs': #define APPNAME "Logs\\MyApplication" Don't forget to adjust logtext.ini accordingly by changing the section name: [Logs\MyApplication] Here are some of the other examples the example logtext.ini is configured for: #define APPNAME "MaxSizeExample" #define APPNAME "MaxLinesExample" #define APPNAME "WeeklyLogging" */ int main (int argc, char *argv[], char *envp[]) { /* Use this for standard DLL search: if (!LoadAndInitializeLogText (NULL)) Use this to search for the DLL in the current directory: */ if (!LoadAndInitializeLogText (".\\logtext.dll")) { /* Look at http://msdn2.microsoft.com/en-us/library/ms682586.aspx to see where 'logtext.dll' should be located. */ fputs ("Error loading 'logtext.dll'.\n" "\nCheck\n" "http://msdn2.microsoft.com/en-us/library/ms682586.aspx" "\nto see where it should be located.\n", stderr); return 1; } (lpLogTextExQ) (APPNAME, "This is our text to log", NULL); (lpLogTextExQ) (APPNAME, "That's the second event to log", NULL); (lpLogTextExQ) (APPNAME, "That's the third event to log", NULL); (lpLogTextExQ) (APPNAME, "Here's some binary data:", NULL); (lpLogTextExQ) (APPNAME, "\1\2\3\4\5\6\7ABCDEFGHI", NULL); (lpLogTextExQ) (APPNAME, "Finished.", NULL); (lpLogTextExQ) (APPNAME, "", NULL); /* Store an empty line. */ return 0; }