//TEST.H
#ifndef dblink_H
#define dblink_H
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#undef EXPORT
#define EXPORT extern "C" __declspec (dllexport)
// declare your functions here
EXPORT int returnINT();
EXPORT char * ReturnChar();
EXPORT char * ParamTest(char * inputA);
EXPORT int Contains(char * cCheckString,char * cSearchString);
#endif // test_H
//TEST.CPP
EXPORT int returnINT()
{
return 99;
}
//works to send an character back...
//use :
//declare string ReturnChar in d:\dblink\debug\dblink.dll
//?ReturnChar()
EXPORT char * ReturnChar()
{
return "ddddddddd99";
}
//works to pass parameters to a function
//use :
// Cbuff='test'
// declare string ParamTest in dblink.dll STRING @
// ?ParamTest(@cbuff)
EXPORT char * ParamTest(char * inputA)
{
return inputA;
char *lpFileName = (char *) "123456.txt";
static int lnhandle ;
static int hTemplateFile=0;
HANDLE hFileRead = INVALID_HANDLE_VALUE;
hFileRead = CreateFile(lpFileName,
GENERIC_WRITE,
0,
0,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
0);
CloseHandle(&hFileRead);
}
void createtextfile()
{
char *lpFileName = (char *) "123456.txt";
static int lnhandle ;
static int hTemplateFile=0;
HANDLE hFileRead = INVALID_HANDLE_VALUE;
hFileRead = CreateFile(lpFileName,
GENERIC_WRITE,
0,
0,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
0);
CloseHandle(&hFileRead);
}