Ajouter un commentaire

hajer

et mon second échec (espérons que ce soit le dernier... :x )
voila donc j'ai à priori mis toutes les fonctions nécessaires pour un simple envoi de fax.

voici le code

#include <stdio.h> 
#include <windows.h> 
#include <winfax.h> 
#include <winbase.h>
#include <stdlib.h>

#pragma comment(lib, "winfax.lib") 
#pragma comment(lib, "kernel32.lib")

int main(){ 	
	PFAX_JOB_PARAM JobParams=NULL;
	HANDLE hFax=NULL;
	LPDWORD FaxJobId=NULL;	
	JobParams->SizeOfStruct=sizeof(FAX_JOB_PARAM);
	JobParams->RecipientNumber="22222222222";//juste un essai
	JobParams->RecipientName="mon binome";
	JobParams->Tsid=NULL;
	JobParams->SenderName="moi";
	JobParams->SenderCompany="INSAT";//ma fac
	JobParams->SenderDept=NULL;
	JobParams->BillingCode=NULL;
	JobParams->DeliveryReportType=DRT_NONE;
	JobParams->DeliveryReportAddress=NULL;
	JobParams->DocumentName="first step";
	JobParams->CallHandle=NULL;
	JobParams->Reserved[3]=0;
	printf("\nhaloooo"); 
	if (!FaxConnectFaxServer(NULL, &hFax)){ 
		printf( "\no no, non connecté"); 
		return 1;
	}  
	else printf("\nconnected to the local fax server");
	FaxCompleteJobParams(&JobParams,NULL);
	if (!FaxSendDocumentA(hFax,"c:\test_fax1.txt",JobParams,NULL,FaxJobId)){
		printf("\no no, not sent , %ld \n",GetLastError());
		return 1;
	}
	else printf("\nc bonnn pour l'envoi coooll!!!");
	printf("finiiiii!!!");
	FaxClose(hFax); 
	return 0; 
}

et voici ce qui s'affiche lors de la comilation :
:shock: :shock: :shock:

------ Build started: Project: Fax, Configuration: Debug Win32 ------
Compiling...
Fax.c
c:\program files\microsoft platform sdk for windows xp sp2\include\specstrings.h(334) : warning C4005: '__reserved' : macro redefinition
        c:\program files\microsoft visual studio 9.0\vc\include\sal.h(1956) : see previous definition of '__reserved'
c:\program files\microsoft platform sdk for windows xp sp2\include\specstrings.h(341) : warning C4005: '__checkReturn' : macro redefinition
        c:\program files\microsoft visual studio 9.0\vc\include\sal.h(1957) : see previous definition of '__checkReturn'
c:\program files\microsoft platform sdk for windows xp sp2\include\specstrings.h(344) : warning C4005: '__typefix' : macro redefinition
        c:\program files\microsoft visual studio 9.0\vc\include\sal.h(1958) : see previous definition of '__typefix'
c:\program files\microsoft platform sdk for windows xp sp2\include\specstrings.h(349) : warning C4005: '__override' : macro redefinition
        c:\program files\microsoft visual studio 9.0\vc\include\sal.h(1959) : see previous definition of '__override'
c:\program files\microsoft platform sdk for windows xp sp2\include\specstrings.h(350) : warning C4005: '__fallthrough' : macro redefinition
        c:\program files\microsoft visual studio 9.0\vc\include\sal.h(1968) : see previous definition of '__fallthrough'
c:\program files\microsoft platform sdk for windows xp sp2\include\specstrings.h(351) : warning C4005: '__callback' : macro redefinition
        c:\program files\microsoft visual studio 9.0\vc\include\sal.h(1960) : see previous definition of '__callback'
c:\program files\microsoft platform sdk for windows xp sp2\include\specstrings.h(352) : warning C4005: '__in' : macro redefinition
        c:\program files\microsoft visual studio 9.0\vc\include\sal.h(1753) : see previous definition of '__in'
c:\program files\microsoft platform sdk for windows xp sp2\include\specstrings.h(353) : warning C4005: '__out' : macro redefinition
        c:\program files\microsoft visual studio 9.0\vc\include\sal.h(1762) : see previous definition of '__out'
c:\program files\microsoft platform sdk for windows xp sp2\include\specstrings.h(354) : warning C4005: '__inout' : macro redefinition
        c:\program files\microsoft visual studio 9.0\vc\include\sal.h(1781) : see previous definition of '__inout'
c:\program files\microsoft platform sdk for windows xp sp2\include\specstrings.h(356) : warning C4005: '__out_ecount' : macro redefinition
        c:\program files\microsoft visual studio 9.0\vc\include\sal.h(1763) : see previous definition of '__out_ecount'
c:\program files\microsoft platform sdk for windows xp sp2\include\specstrings.h(357) : warning C4005: '__in_ecount' : macro redefinition
        c:\program files\microsoft visual studio 9.0\vc\include\sal.h(1754) : see previous definition of '__in_ecount'
c:\program files\microsoft platform sdk for windows xp sp2\include\specstrings.h(358) : warning C4005: '__inout_ecount' : macro redefinition
        c:\program files\microsoft visual studio 9.0\vc\include\sal.h(1782) : see previous definition of '__inout_ecount'
c:\program files\microsoft platform sdk for windows xp sp2\include\specstrings.h(359) : warning C4005: '__out_bcount' : macro redefinition
        c:\program files\microsoft visual studio 9.0\vc\include\sal.h(1764) : see previous definition of '__out_bcount'
c:\program files\microsoft platform sdk for windows xp sp2\include\specstrings.h(360) : warning C4005: '__in_bcount' : macro redefinition
        c:\program files\microsoft visual studio 9.0\vc\include\sal.h(1755) : see previous definition of '__in_bcount'
c:\program files\microsoft platform sdk for windows xp sp2\include\specstrings.h(361) : warning C4005: '__inout_bcount' : macro redefinition
        c:\program files\microsoft visual studio 9.0\vc\include\sal.h(1783) : see previous definition of '__inout_bcount'
c:\documents and settings\jo\mes documents\insat-gl3\mini_projet\faxing_windows_api\fax.c(25) : warning C4047: '=' : 'HCALL' differs in levels of indirection from 'void *'
Build log was saved at "file://C:\Documents and Settings\jo\Mes documents\INSAT-GL3\mini_projet\faxing_windows_api\Debug\BuildLog.htm"
Fax - 0 error(s), 16 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

:shock: :shock: :shock: :shock: :shock:

le problème avec ces warning c'est que ca concerne les fichiers include fournis par la sdk, donc c'est pas ma faute s'il ya des redéfinitions (je peux pas y toucher...)
et pour ce warning (je pense que le problème vient de lui) "warning C4047: '=' : 'HCALL' differs in levels of indirection from 'void *' "
j'ai rien compris, je ne sais meme pas quelle genre de variables va contenir HCALL, et le pire dans tout ça, c'est que dans la MSDN, voici ce qu'on dit de la variable CallHandle de type HCALL : "CallHandle : Reserved, and should be NULL."
C'est ce que j'ai mis, mais selon ce warning, ce n'est pas la bonne valeur à mettre ici!!

sinon quand j'exécute, je reçoit la fameuse fenêtre d'erreur de windows " Fax.exe a rencontré un problème et doit fermer. Nous vous prions de nous excuser pour le désagrément encouru."

est - ce qu'il manquerait une fonction??

Filtered HTML

Plain text

CAPTCHA
Cette question permet de vérifier que vous n'êtes pas un robot spammeur :-)
 III  FFFF   SSS   V     V  W     W 
I F S V V W W
I FFF SSS V V W W W
I F S V V W W W
III F SSSS V W W