Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VC++ DLL -Continue
Message
De
07/09/2000 03:41:08
 
 
À
25/08/2000 00:33:09
Information générale
Forum:
Visual C++
Catégorie:
Autre
Divers
Thread ID:
00409097
Message ID:
00413349
Vues:
30
Not sure if this helps but my dll's always look like this..


Here is an example.

//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);
}
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform