#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <stdio.h>
#pragma warning ( disable : 4996 )
using namespace std;
ofstream ofile;
char dlldirectory[320];
char *GetDirectoryFile(char *filename)
{
static char path[320];
strcpy(path, dlldirectory);
strcat(path, filename);
return path;
}
void __cdecl Writelog(const char *fmt, ...)
{
if (ofile != NULL)
{
if (!fmt) { return; }
va_list va_alist;
char logbuf[256] = { 0 };
va_start(va_alist, fmt);
_vsnprintf(logbuf + strlen(logbuf), sizeof(logbuf)-strlen(logbuf), fmt, va_alist);
va_end(va_alist);
ofile << logbuf << endl;
}
}
void logging(HMODULE hDll){
DisableThreadLibraryCalls(hDll);
GetModuleFileName(hDll, dlldirectory, 512);
for (int i = strlen(dlldirectory); i > 0; i--) { if (dlldirectory[i] == '\\') { dlldirectory[i + 1] = 0; break; } }
ofile.open(GetDirectoryFile("pongping88.txt"), ios::app);
}
Error 1 error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'std::ofstream' (or there is no acceptable conversion) C:\Users\User\documents\visual studio 2013\Projects\Addy Logger\Addy Logger\Log.cpp 24 1 Addy Logger
2 IntelliSense: no operator "!=" matches these operands
operand types are: std::ofstream != int c:\Users\User\Documents\Visual Studio 2013\Projects\Addy Logger\Addy Logger\Log.cpp 24 12 Addy Logger
if (ofile )
{
}
Error 1 error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. c:\Users\ANGEL\Desktop\Loggger\Log.cpp 17 1 Logger
Error 2 error C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. c:\Users\ANGEL\Desktop\Loggger\Log.cpp 18 1 Logger
char *GetDirectoryFile(char *filename)
{
static char path[320];
strcpy(path, dlldirectory);
strcat(path, filename);
return path;
}
fstream;
fstream; after the includeschar *GetDirectoryFile(char *filename)
{
static char path[260];
GetFullPathName(filename, 260, path, NULL);
return path;
}
project properties -> C/C++ -> General -> Warning Level