Yannick
Nombre de messages : 8610 Age : 52 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: Kgf multi dll Ven 7 Oct 2016 - 19:44 | |
| J' ai un petit souci. Les fonctions de cards.dll ne fonctionne pas lorsque l' on passe par kgf. - Code:
-
variables() constantes() labels() init() gui() end ' ------------------------------------------------------------------------------ sub variables() dim no% dim hdc% dim c% ' systeme dim etatlog% dim param_banque% dim banque% dim hnddll2% dim res% dim carte%(5) end_sub ' ------------------------------------------------------------------------------ sub constantes() dim_local i% ' dossier source dim path$ : path$=dir_current$ if right$(path$,1)="" : path$=left$(path$,len(path$)-1) : end_if path$=path$+"" ' adresse des fichiers dll dim kgf$ : kgf$ = "C:\KGF\KGF.dll" dim card$ : card$ = path$+"cards.dll" ' objets panoramic dim mm% : no%=no%+1 : mm%=no% dim sm%(9) : for i%=1 to 9 : no%=no%+1 : sm%(i%)=no% : next i% dim pict% : no%=no%+1 : pict%=no% dim alph%(3): for i%=1 to 3 : no%=no%+1 : alph%(i%)=no% : next i% dim spn% : no%=no%+1 : spn%=no% dim btn%(3) : for i%=1 to 3 : no%=no%+1 : btn%(i%)=no% : next i% end_sub ' ------------------------------------------------------------------------------ sub labels() label clic,change,close end_sub ' ------------------------------------------------------------------------------ sub init() dll_on kgf$ hnddll2% = dll_call1("LoadDLL",adr(card$)) end_sub ' ------------------------------------------------------------------------------ sub gui() height 0,350 width 0,600 top 0,(screen_y-height(0))/2 left 0,(screen_x-width(0))/2 font_name 0,"arial" caption 0,"Poker" on_close 0,close main_menu mm% sub_menu sm%(1) : parent sm%(1),mm% : caption sm%(1),"Jeu" sub_menu sm%(9) : parent sm%(9),mm% : caption sm%(9),"Paramètres" sub_menu sm%(2) : parent sm%(2),mm% : caption sm%(2),"A Propos" sub_menu sm%(3) : parent sm%(3),mm% : caption sm%(3),"Aide" sub_menu sm%(4) : parent sm%(4),sm%(1) : caption sm%(4),"Nouveau" : on_click sm%(4),clic sub_menu sm%(5) : parent sm%(5),sm%(1) : caption sm%(5),"-" sub_menu sm%(6) : parent sm%(6),sm%(1) : caption sm%(6),"Quitter" sub_menu sm%(7) : parent sm%(7),sm%(3) : caption sm%(7),"*.chm" sub_menu sm%(8) : parent sm%(8),sm%(3) : caption sm%(8),"Vocale"
picture pict% full_space pict% hdc%=handle_canvas(pict%) alpha alph%(1) top alph%(1),10 left alph%(1),5 caption alph%(1),"€" font_size alph%(1),14 alpha alph%(2) top alph%(2),10 left alph%(2),25 caption alph%(2),"" font_size alph%(2),14 alpha alph%(3) top alph%(3),10 left alph%(3),105 caption alph%(3),"Mise : " font_size alph%(3),14 spin spn% top spn%,10 left spn%,160 width spn%,80 font_size spn%,10 font_bold spn% min spn%,1 max spn%,1000 position spn%,1 c%= int(width(pict%)/2) button btn%(1) top btn%(1),height(pict%)-50 left btn%(1),c%-(width(btn%(1))+2) caption btn%(1),"Changer" font_bold btn%(1) cursor_point btn%(1) button btn%(2) top btn%(2),height(pict%)-50 left btn%(2),c%+2 caption btn%(2),"Jouer" font_bold btn%(2) cursor_point btn%(2) end_sub ' ------------------------------------------------------------------------------ clic: if number_click = sm%(4) banque% = param_banque% : caption alph%(2),str$(banque%) TirageCarteDepart() return end_if if number_click = sm%(6) return end_if if number_click = sm%(7) return end_if
if number_click = sm%(8) return end_if if number_click = spn% return end_if if number_click = btn%(1) return end_if if number_click = btn%(2) return end_if return ' ------------------------------------------------------------------------------ change: return ' ------------------------------------------------------------------------------ close: res% = dll_call1("UnLoadDLL",hnddll2%) return ' ------------------------------------------------------------------------------ sub TirageCarteDepart() dim_local i%,dif%,x%,res%,dll$,fonction$,h%,w%
for i%=1 to 5 carte%(i%)= -1 next i%
for i%=1 to 5 repeat carte%(i%)=int(rnd(51)) while x%<>5 x%=x%+1 if carte%(i%)<>carte%(x%) : dif%=dif%+1 : end_if end_while until dif%=4 next i% fonction$ = "cdtInit" res% = dll_call2("TargetDLL",hnddll2%,adr(fonction$)) if res%=1 res% = dll_call2("CallDLL2",adr(w%),adr(h%)) else message "fonction "+fonction$+"introuvable" end_if fonction$ = "cdtDraw" res% = dll_call2("TargetDLL",hnddll2%,adr(fonction$)) if res%=1 res% = dll_call6("CallDLL6",hdc%,10,70,carte%(1),0,0) res% = dll_call6("CallDLL6",hdc%,100,70,carte%(2),0,0) res% = dll_call6("CallDLL6",hdc%,190,70,carte%(3),0,0) res% = dll_call6("CallDLL6",hdc%,280,70,carte%(4),0,0) res% = dll_call6("CallDLL6",hdc%,370,70,carte%(5),0,0) else message "fonction "+fonction$+"introuvable" end_if fonction$ = "cdtTerm" res% = dll_call2("TargetDLL",hnddll2%,adr(fonction$)) if res%=1 res% = dll_call0("CallDLL0") else message "fonction "+fonction$+"introuvable" end_if end_sub | |
|