Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
C++ help
Message
De
13/08/1997 11:52:14
Edward Crawford
City Facilities Management
Glasgow, Royaume Uni
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
C++ help
Divers
Thread ID:
00044460
Message ID:
00044460
Vues:
63
I wrote a small dll that calls the localtime() function in Visual C++ 5.0. When I call this function,ConvertTime(), I get a memory error. The dll works fine because I can call the test() function. I am a Foxpro programmer, not a C++ programer, and I can't figure out what I am doing wrong. Could someone help? Here is
the code:

.cpp file

//////////////////////////////////////////////////
// timeconv.cpp
//
////////////////////////////////////////////////

#include
#include
#include


//////////////////
//
// Entry point of DLL
////////////////////////////

BOOL WINAPI DllEntryPoint(HINSTANCE hDLL, DWORD dwReason,
LPVOID Reserved)

{

switch(dwReason)
{

case DLL_PROCESS_ATTACH:
{

break;
}

case DLL_PROCESS_DETACH:
{

break;
}
}

return TRUE;
}

///////////////////////////////////////
//
// ConvertTime()
//
///////////////////////////////////////

char ConvertTime(void)
{
struct tm *newtime;
time_t aclock;
char* rtntime;

aclock=8067157205;

newtime = localtime(&aclock);

rtntime = asctime(newtime);

return(*rtntime);

}


/////////////////////////////////////
//
// test()
////////////////////////////////////

int rtn ;

char test(void)
{
rtn = 6;
return (rtn);
}


Here is the .def file

;;;;;;;;;;;;;;;;;;;;;;
;
; timeconv.def
;
;;;;;;;;;;;;;;;;;;;;;;;;;

LIBRARY timeconv
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD SINGLE

EXPORTS
ConvertTime
test


Thanks

Ed

Thanks, Ed
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform