I am creating DLL using VC++ - Console application..
I am writing it for crating a new file... I am using Createfile function for this. but facing below error...
error C2733: second C linkage of overloaded function 'CreateFileW' not allowed
Below is my .CPP file from the project..
#include "stdafx.h"
#define DLL extern "C" __declspec(dllexport)
/*
//file handle
HANDLE hFile;
//something to contain the number of bytes read
DWORD dwNumWritten;
//a boolean test variable, to test for success of reads
BOOL bTest;
//a buffer… can actually be of any type
DWORD dwBuffer[256];
hFile = CreateFile("D:\\myfile.txt", GENERIC_WRITE, FILE_SHARE_WRITE,
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
*/
DLL int CreateFile(char *path)
{ [COLOR="Red"]facing error at this line[/COLOR]
int i;
HANDLE hPort = CreateFile(TEXT("COM1"), GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
return i;
}