begin process at 2008 07 09 03:08:12
1 207 190 membres
36 nouveaux aujourd'hui
14 130 membres club

Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum.
Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

Sujet : communication avec pda [ Archives / Débutants ] (ducker88)

communication avec pda le 03/05/2006 14:56:15

ducker88
Bonjour,
Voila je cherche à recuperer des fichiers sur un pocket pc à l'aide d'une appli foxpro.
J'ai integré le code suivant dans mon appli :
DECLARE INTEGER CeRapiInit IN rapi

DECLARE INTEGER CeCopyFile IN rapi;
    STRING  lpExistingFileName,;
    STRING  lpNewFileName,;
    INTEGER bFailIfExists
CeRapiInit()
CeCopyFile("c:\temp\test.txt", "\temp\test.txt", 1)
Mais cela ne marche pas. Sur internet j'ai trouvé

Parameters:
lpExistingFileName
[in] Long pointer to a null-terminated string that specifies the name of an existing file.

lpNewFileName
[in] Long pointer to a null-terminated string that specifies the name of the new file.

bFailIfExists
[in] Boolean value that specifies how this operation is to proceed if a file of the same name as that indicated by lpNewFileName already exists.

Mais tous cela ne m'aide pas beaucoup. Quelqu'un a t'il deja fait cela ?

Merci
duck88

Re : communication avec pda le 03/05/2006 19:04:24

Mike Gagnon
Membre Club
Un peu plus complexe que ca ce genre de communication. Les chemins (de et à ) doivent traduit en Unicode avec STRCONV FUNCTION ToUnicode(cStr) RETURN STRCONV(cStr+CHR(0), 5)

Re : communication avec pda le 04/05/2006 08:54:47

ducker88
J'ai fait ce que tu m'a dis :

DECLARE INTEGER CeRapiInit IN rapi

DECLARE INTEGER CeCopyFile IN rapi;

STRING lpExistingFileName,;

STRING lpNewFileName,;

INTEGER bFailIfExists

&& on utilise la librairie RAPI.dll

mon_chemin = "c:\temp2\allsortie.txt"

ma_destination = "\Temp\allsortie.txt"

monchemin2 = STRCONV(mon_chemin+CHR(0), 5)

madestination2 = STRCONV(ma_destination+CHR(0), 5)

toto = CeRapiInit()

MESSAGEBOX(toto)

toto1 = CeCopyFile(monchemin2, madestination2, 1)

MESSAGEBOX(toto1)


Mais aucun resultat. toto et toto1 renvoient 0.
Une solution ?

duck88

Re : communication avec pda le 04/05/2006 12:57:58

Mike Gagnon
Membre Club
toto = CeRapiInit() La lgne ci-haut doit surement te donner un erreur, a moins que tu ai la classe CeRapiInit(), que ne semble pas etre le cas. Si c'est le cas, enleve la ligne. FUNCTION CopyFile(cSourceName, cTargetName) As Boolean IF CeCopyFile(m.ToUnicode(cSourceName),; ToUnicode(m.cTargetName), 1) = 0 RETURN .F. ENDIF RETURN .T.


Classé sous : string, integer, in, that, lpnewfilename

Participer à cet échange

Pub



Appels d'offres

CalendriCode

Juillet 2008
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

VS Express FR Gratuit !

VS Express en français et 100% gratuit !

Téléchargements

Logiciels à télécharger sur le même thème :

Boutique

Boutique de goodies CodeS-SourceS