Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
C++ help
Message
De
14/08/1997 09:37:13
 
 
À
13/08/1997 11:52:14
Edward Crawford
City Facilities Management
Glasgow, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00044460
Message ID:
00044628
Vues:
29
I haven't done much work with dlls, but I see one problem. From your code it appears that rtntime will be more than one character(string). In C++ creating a char* is like creating an array. So, when you do "return(*rntime)" you will only return the first character. For example,

rtntime = "hello";
return(*rtntime); This will return "h"

return(*(rtntime + 1)); This will return "e"

If you are only returning one character then disregard. This sould not cause a memory error unless rtntime is null. You might want to test for null before you return the value.


Hope this helps!

James Naftel

>
> char ConvertTime(void)
> {
> struct tm *newtime;
> time_t aclock;
> char* rtntime;
>
> aclock=8067157205;
>
> newtime = localtime(&aclock);
>
> rtntime = asctime(newtime);
>
> return(*rtntime);
>
> }
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform