topic stringlengths 1 63 | text stringlengths 1 577k ⌀ |
|---|---|
errsysw.prg | Harvey,
The best solution is to use picture clauses on the GETs so they cannot enter data that is too large. It is much better to not allow the "bad" data to be entered in the first place, rather the tell the user they did something "wrong" later. Users don't like to be scolded by machines.
Is there some reason that you cannot use picture clauses or limit the fieldsize of the data entry field?
Regards,
James |
errsysw.prg | I use pict clauses on all gets. They may enter a 10,000,000 in one part of the program then in another part of the program multiple by 100 an calc is too large for the data base. James best would be to trap the error when it occurs and let them know and fix it. My users love when I scold them. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
errsysw.prg | Harvey,
OK, well you can easily check the result of the calculation to see if the result is too large then take whatever action you wish. Alternately you could limit the multipler depending on the input number. It is hard to make an educated suggestion without knowing exactly what is happening in your code (and the theory behind it).
Below is some sample code which uses a temporary error trapping routine during a portion of your code. You could adapt this to your needs. It may be more difficult to do this than the above since you are in a different part of your code (the save routine).
Regards,
James
[code=fw:2yjbd8ho]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Local</span> oError, bOldError<br /><br /><span style="color: #B900B9;">// .... your code</span><br /><br />lRetVal := .T.<br />bOldError := ErrorBlock<span style="color: #000000;">(</span> <span style="color: #000000;">{</span>|oErr| <span style="color: #00C800;">Break</span><span style="color: #000000;">(</span> oErr <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br />Begin Sequence<br /> dbUseArea<span style="color: #000000;">(</span> lNewArea, cDriver, cDbfFile, cAlias, ! lExclu, lReadOnly <span style="color: #000000;">)</span><br /><br />Recover Using oError <span style="color: #B900B9;">// this error object is created automatically by the error handler</span><br /> NetError<span style="color: #000000;">(</span>.T.<span style="color: #000000;">)</span><br /> lRetVal := .F.<br /> <span style="color: #00C800;">If</span> oError:<span style="color: #000000;">osCode</span> == <span style="color: #000000;">2</span> <span style="color: #B900B9;">// file not found</span><br /> <span style="color: #B900B9;">// you handle it as you feel appropiate</span><br /> <span style="color: #00C800;">endif</span><br /><br />End Sequence<br /><br />ErrorBlock<span style="color: #000000;">(</span> bOldError <span style="color: #000000;">)</span> <span style="color: #B900B9;">// very important to restore original error handler!</span></div>[/code:2yjbd8ho] |
errsysw.prg | Thanks james I'll give it s try. I'll let you know if it works. |
errsysw.prg | It would be simpler than using an errorblock, to just do something like this:
[code=fw:koy5hfp4]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> len<span style="color: #000000;">(</span> nTotal <span style="color: #000000;">)</span> > len<span style="color: #000000;">(</span> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->total <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// do whatever to fix length</span><br /><span style="color: #00C800;">enddo</span><br /><br />replace <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->total with nTotal</div>[/code:koy5hfp4]
Regards,
James |
errsysw.prg | Whoops, the above would only work with character fields. A generic one for numeric fields would be more complex. Perhaps you only need this since your maximum is 99,999,999.
[code=fw:2qlwllk8]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> nTotal > <span style="color: #000000;">99999999</span><br /> <span style="color: #B900B9;">// do whatever to fix length</span><br /><span style="color: #00C800;">enddo</span><br /><br />replace <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->total with nTotal</div>[/code:2qlwllk8]
Regards,
James |
errsysw_prg send mail and port 110 | HI,
I use errsysw_prg. Sending mail withaut SSL (as an error occurs in the application) does not work as it is by the provider of port 110 is required. Is there a way to sending mail server does not require an answer? Or the need to port 110?
Sory for may Englesh..
Regards,
Miloš Tajkov
FWHX 12.08
xHarbout bild 1.2.1 |
errsysw_prg send mail and port 110 | Miloš,
Could you provide an example of what you are doing ? thanks |
errsysw_prg send mail and port 110 | program error:
[img:ugbwhryd]http://www.intersped.co.rs/aplication%20error.jpg[/img:ugbwhryd]
when I press Send errorlog:
[img:ugbwhryd]http://www.intersped.co.rs/error.jpg[/img:ugbwhryd]
program waits for a reply that did not receive, because it blocked port 110 with the provider. I just need to send mail without reading it. There is a way to change that or to enable change port for reading?
Regards,
Miloš |
errsysw_prg send mail and port 110 | Miloš,
Please post here the source code that you use to send the email |
errsysw_prg send mail and port 110 | functuon SendEmail() from errsysw_.prg:
[code=fw:1r0hvmfm]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">//-------------------------------------------------------------------------------</span><br /><br /> <span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> SendEmail <span style="color: #000000;">(</span>cSubject, cBody, cMsg, oWnd, cImgFile<span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oInit, oMail, aSet, i, lOk := .f.<br /> <span style="color: #00C800;">LOCAL</span> lReceipt := .f.<br /> <span style="color: #00C800;">LOCAL</span> lAuth := .f.<br /> <span style="color: #00C800;">LOCAL</span> cFrom<br /> <span style="color: #00C800;">LOCAL</span> aAttach<br /> <span style="color: #00C800;">LOCAL</span> nPort := <span style="color: #000000;">25</span> <span style="color: #B900B9;">// 587 (smtp-submission)</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> cMsg := <span style="color: #00C800;">nil</span> <span style="color: #B900B9;">//HTML Email</span><br /><br /> aSet := ReadIni <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> cFrom := TRIM <span style="color: #000000;">(</span>aSet<span style="color: #000000;">[</span>E_USER<span style="color: #000000;">]</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">" <"</span>+TRIM <span style="color: #000000;">(</span>aSet<span style="color: #000000;">[</span>E_FROM<span style="color: #000000;">]</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">">"</span><br /> <span style="color: #00C800;">FOR</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> Len <span style="color: #000000;">(</span>aSet<span style="color: #000000;">)</span><br /> lOk := !Empty <span style="color: #000000;">(</span>aSet<span style="color: #000000;">[</span>i<span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//? aSet[i]</span><br /> <span style="color: #00C800;">NEXT</span><br /><br /><span style="color: #B900B9;">// ? cFrom + CRLF+;</span><br /><span style="color: #B900B9;">// aSet [E_LOGIN] + CRLF+;</span><br /><span style="color: #B900B9;">// aSet [E_PASS] + CRLF+;</span><br /><span style="color: #B900B9;">// aSet [E_SMTP] + CRLF+;</span><br /><span style="color: #B900B9;">// aSet[E_TO] + CRLF//+;</span><br /><br /><br /> <span style="color: #00C800;">IF</span> ! lOk<br /> MsgAlert <span style="color: #000000;">(</span> aLang<span style="color: #000000;">[</span>emailALERT1<span style="color: #000000;">]</span>, aLang<span style="color: #000000;">[</span>emailALERT2<span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span><span style="color: #00C800;">nil</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> FErase <span style="color: #000000;">(</span><span style="color: #ff0000;">"Smtp.log"</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// delete old logfile</span><br /> <span style="color: #00C800;">if</span> file<span style="color: #000000;">(</span> cImgFile <span style="color: #000000;">)</span><br /> aAttach := <span style="color: #000000;">{</span> cErrorPath+<span style="color: #ff0000;">"error.log"</span>, cImgFile <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> aAttach := <span style="color: #000000;">{</span> cErrorPath+<span style="color: #ff0000;">"error.log"</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">endif</span><br /><br /> oInit := TSmtp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> aSet <span style="color: #000000;">[</span>E_SMTP<span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> oMail := TSmtp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> aSet <span style="color: #000000;">[</span>E_SMTP<span style="color: #000000;">]</span>, nPort, lAuth, aSet <span style="color: #000000;">[</span>E_LOGIN<span style="color: #000000;">]</span>, aSet <span style="color: #000000;">[</span>E_PASS<span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// [jlalin], IBTC</span><br /> oMail:<span style="color: #000000;">cReplyTo</span> := aSet<span style="color: #000000;">[</span>E_FROM<span style="color: #000000;">]</span> <span style="color: #B900B9;">//aSet [E_REPLYTO] //cReplyTo</span><br /> oMail:<span style="color: #000000;">nGMT</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">// 8 = Pacific Standard Time (GMT -08:00) - Adjust this to your own Time Zone!</span><br /> <span style="color: #B900B9;">//oMail:lTxtAsAttach := .F. // uncomment to force txt, log and htm files as inline as opposed to attachement</span><br /> oMail:<span style="color: #000000;">nDelay</span> := <span style="color: #000000;">2</span><br /> oMail:<span style="color: #000000;">oSocket</span>:<span style="color: #000000;">lDebug</span> := .T. <span style="color: #B900B9;">// uncomment to create log file</span><br /> oMail:<span style="color: #000000;">oSocket</span>:<span style="color: #000000;">cLogFile</span> := <span style="color: #ff0000;">"smtp.log"</span><br /> oMail:<span style="color: #000000;">bConnecting</span> := <span style="color: #000000;">{</span>||MsgRun<span style="color: #000000;">(</span> aLang<span style="color: #000000;">[</span>emailCONNECTING1<span style="color: #000000;">]</span> + aSet <span style="color: #000000;">[</span>E_SMTP<span style="color: #000000;">]</span> + <span style="color: #ff0000;">" ("</span> + oMail:<span style="color: #000000;">cIPServer</span> + <span style="color: #ff0000;">") "</span>+ aLang<span style="color: #000000;">[</span>emailCONNECTING2<span style="color: #000000;">]</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oMail:<span style="color: #000000;">bConnected</span> := <span style="color: #000000;">{</span>||MsgRun <span style="color: #000000;">(</span> aLang<span style="color: #000000;">[</span>emailCONNECTED<span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oMail:<span style="color: #000000;">SendMail</span><span style="color: #000000;">(</span> ;<br /> cFrom, ; <span style="color: #B900B9;">// from/de</span><br /> <span style="color: #000000;">{</span> aSet<span style="color: #000000;">[</span>E_TO<span style="color: #000000;">]</span> <span style="color: #000000;">}</span>, ; <span style="color: #B900B9;">// to/para (arreglo) - I use cSender here also because it's an "autotest". Actually you would type a different address here</span><br /> cBody,; <span style="color: #B900B9;">// Body/Mensaje</span><br /> cSubject,; <span style="color: #B900B9;">// Subject/Asunto</span><br /> aAttach, ; <span style="color: #B900B9;">// Array of filenames to attach/Arreglo de nombres de archivos a agregar</span><br /> <span style="color: #000000;">{</span> <span style="color: #000000;">}</span>, ; <span style="color: #B900B9;">// aCC</span><br /> <span style="color: #000000;">{</span> <span style="color: #000000;">}</span>, ; <span style="color: #B900B9;">// aBCC</span><br /> lReceipt, ; <span style="color: #B900B9;">// Return Receipt/acuse de recibo</span><br /> cMsg <span style="color: #000000;">)</span> <span style="color: #B900B9;">// msg in HTML format/mensaje en HTML</span><br /><br /> oInit:<span style="color: #000000;">end</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">(</span><span style="color: #00C800;">nil</span><span style="color: #000000;">)</span><br /><br /> </div>[/code:1r0hvmfm]
and email.ini:
[code=fw:1r0hvmfm]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #000000;">[</span>Email<span style="color: #000000;">]</span><br />User=<br />Login=mtajkov@intersped.co.rs<br />Pass=********<br />Pop-Host=<span style="color: #0000ff;">mail</span>.intersped.co.rs<br />Smpt-Host=<span style="color: #0000ff;">mail</span>.intersped.co.rs<br />Leasedline=.F.<br />Autosave=.T.<br />Maildelete=.T.<br />ReplyTo=<br />MailTo=milos.tajkov@smartprint.co.rs<br /> </div>[/code:1r0hvmfm]
Regards,
Miloš |
errsysw_prg send mail and port 110 | Please use this function to send the emails:
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?p=114169#p114169">viewtopic.php?p=114169#p114169</a><!-- l --> |
errsysw_prg send mail and port 110 | Hi,
I tried all the examples but without success <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> . Now I'm trying to gmail account. This account works with microsoft outlook.
[code=fw:2ukph8b8]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> PosMail<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">local</span> lRet := .f.<br /><span style="color: #00C800;">local</span> oCfg, oError<br /><br /><span style="color: #00C800;">local</span> cServ := <span style="color: #ff0000;">"smtp.gmail.com"</span> <br /><span style="color: #00C800;">local</span> nPort := <span style="color: #ff0000;">"465"</span><br /><span style="color: #00C800;">local</span> lAut := .t.<br /><span style="color: #00C800;">local</span> lSSL := .t.<br /><span style="color: #00C800;">local</span> cPass := <span style="color: #ff0000;">"*******"</span><br /><span style="color: #00C800;">local</span> cTo := <span style="color: #ff0000;">"milos.tajkov@smartprint.co.rs"</span><br /><span style="color: #00C800;">local</span> cCC := <span style="color: #ff0000;">"mtajkov@intersped.co.rs"</span><br /><span style="color: #00C800;">local</span> cBCC := <span style="color: #ff0000;">"mtajkov@intersped.co.rs"</span><br /><br /><br />cUser := Alltrim<span style="color: #000000;">(</span><span style="color: #ff0000;">"mtajkov@gmail.com"</span><span style="color: #000000;">)</span> <br />cRemt := Alltrim<span style="color: #000000;">(</span><span style="color: #ff0000;">"mtajkov@gmail.com"</span><span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">TRY</span><br />oCfg := CREATEOBJECT<span style="color: #000000;">(</span> <span style="color: #ff0000;">"CDO.Configuration"</span> <span style="color: #000000;">)</span><br />WITH OBJECT oCfg:<span style="color: #000000;">Fields</span><br />:<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpserver"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := cServ<br />:<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpserverport"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := val<span style="color: #000000;">(</span>nPort<span style="color: #000000;">)</span><br />:<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendusing"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">2</span><br />:<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := lAut<br />:<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/smtpusessl"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := lSSL<br />:<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendusername"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := cUser<br />:<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"http://schemas.microsoft.com/cdo/configuration/sendpassword"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := cPass<br />:<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />END WITH<br />lRet := .t.<br />CATCH oError<br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Nao Foi possível Enviar o e-Mail!"</span> +CRLF+ ;<br /><span style="color: #ff0000;">"Error: "</span> + Transform<span style="color: #000000;">(</span>oError:<span style="color: #000000;">GenCode</span>, <span style="color: #00C800;">nil</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">";"</span> +CRLF+ ;<br /><span style="color: #ff0000;">"SubC: "</span> + Transform<span style="color: #000000;">(</span>oError:<span style="color: #000000;">SubCode</span>, <span style="color: #00C800;">nil</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">";"</span> +CRLF+ ;<br /><span style="color: #ff0000;">"OSCode: "</span> + Transform<span style="color: #000000;">(</span>oError:<span style="color: #000000;">OsCode</span>, <span style="color: #00C800;">nil</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">";"</span> +CRLF+ ;<br /><span style="color: #ff0000;">"SubSystem: "</span> + Transform<span style="color: #000000;">(</span>oError:<span style="color: #000000;">SubSystem</span>, <span style="color: #00C800;">nil</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">";"</span> +CRLF+ ;<br /><span style="color: #ff0000;">"Mensaje: "</span> + oError:<span style="color: #000000;">Description</span>, <span style="color: #ff0000;">"Atençao"</span> <span style="color: #000000;">)</span><br />END<br /><br /><span style="color: #B900B9;">////////////////////////</span><br /><br />*cTo := Destinatarios<span style="color: #000000;">(</span> cTo <span style="color: #000000;">)</span> <span style="color: #B900B9;">//--> PARA</span><br />*cCC := Destinatarios<span style="color: #000000;">(</span> cCC <span style="color: #000000;">)</span> <span style="color: #B900B9;">//--> COM COPIA</span><br />*cBCC := Destinatarios<span style="color: #000000;">(</span> cBCC <span style="color: #000000;">)</span> <span style="color: #B900B9;">//--> COM COPIA OCULTA</span><br /><br /><span style="color: #00C800;">TRY</span><br />oMsg := CREATEOBJECT <span style="color: #000000;">(</span> <span style="color: #ff0000;">"CDO.Message"</span> <span style="color: #000000;">)</span><br />WITH OBJECT oMsg<br />:<span style="color: #000000;">Configuration</span> = oCfg<br />:<span style="color: #0000ff;">From</span> = cFrom<br />:<span style="color: #0000ff;">To</span> = cTo<br />:<span style="color: #000000;">CC</span> = cCC<br />:<span style="color: #000000;">BCC</span> = cBCC<br /><br />:<span style="color: #0000ff;">Subject</span> = cSubject<br />:<span style="color: #000000;">TextBody</span> = cMsg<br /><span style="color: #00C800;">For</span> x := <span style="color: #000000;">1</span> <span style="color: #0000ff;">To</span> Len<span style="color: #000000;">(</span> cAttach <span style="color: #000000;">)</span><br /><span style="color: #00C800;">if</span> cAttach<span style="color: #000000;">[</span>x<span style="color: #000000;">]</span> <> <span style="color: #00C800;">NIL</span><br />:<span style="color: #000000;">AddAttachment</span><span style="color: #000000;">(</span>cAttach<span style="color: #000000;">[</span>x<span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">Next</span><br /><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Saljem"</span><span style="color: #000000;">)</span><br />:<span style="color: #000000;">Send</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />END WITH<br />lRet := .t.<br /><br /><br />CATCH<br />lRet := .f.<br />END</div>[/code:2ukph8b8]
Do you maybe someone knows what's the problem?
Regards,
Miloš |
es posible crear ... ? (SOLUCIONADO mas o menos) | Hola a todos.
Es posible crear un objeto imagen (con un determinado tamaño ), sin recurso o fichero ?
vamos, un objeto imagen virtual.
Gracias
Jesús Marín
FWH 6.12 |
es posible crear ... ? (SOLUCIONADO mas o menos) | Si, Windows proporciona la capacidad de hacerlo
Que necesitas hacer luego con ese objeto imagen ? |
es posible crear ... ? (SOLUCIONADO mas o menos) | Buenos días Antonio.
Dentro de ese objeto imagen, quiero colocar otros objetos (imágenes, xbrowse, ….)
El tamaño sería variable, por lo que necesito poder cambiarlo en ejecución.
Por ejemplo, en un mantenimiento de artículos quiero poner artículos relacionados ( de la misma familia, artículos similares, variantes de color).
La imagen puede contener docenas de artículos relacionados y por tanto la imagen contenedora (que ya he implementado como moverme por ella ), contiene los datos.
[url=https://ibb.co/R2RqRzt:132q50xt][img:132q50xt]https://i.ibb.co/G7zqzcG/INFINITA-ANTONIO1.jpg[/img:132q50xt][/url:132q50xt]
[url=https://ibb.co/C8P9Rpn:132q50xt][img:132q50xt]https://i.ibb.co/GpHMzfV/INFINITA-ANTONIO2.jpg[/img:132q50xt][/url:132q50xt] |
es posible crear ... ? (SOLUCIONADO mas o menos) | Buenas a todos.
No he creado la imagen virtual (seguiré investigando), pero voy avanzando con este nuevo control.
Ya lo puedo redimensionar en tiempo de ejecución.
Básicamente es ir haciendo zoom a la imagen de base. Esto cambia el tamaño. Obviamente no puede utilizarse para una imagen tipo plantilla, pero si para imágenes planas.
Os iré contando como voy avanzando, pero me parece que puede quedar muy bien.
El código para redimensionar es este :
[code=fw:111g27c6]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">METHOD</span> ResizeInf<span style="color: #000000;">(</span> nHeight<span style="color: #000000;">)</span><br /><br /><br /><span style="color: #00C800;">LOCAL</span> nZoom:=<span style="color: #000000;">0</span><br /><span style="color: #00C800;">LOCAL</span> N:=<span style="color: #000000;">1</span><br /><br /><span style="color: #B900B9;">// POSICIONA LA IMAGEN ARRIBA</span><br /><br /><span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nX</span><<span style="color: #000000;">0</span><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> .T.<br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nX</span>>=<span style="color: #000000;">0</span> ; EXIT ; <span style="color: #00C800;">ENDIF</span><br /> ::<span style="color: #000000;">ScrollDown</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDDO</span><br /><span style="color: #00C800;">ENDIF</span><br />::<span style="color: #000000;">oNewScroll</span>:<span style="color: #000000;">nTop</span>:=<span style="color: #000000;">1</span><br />::<span style="color: #000000;">oNewScroll</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br />::<span style="color: #000000;">Zoom</span><span style="color: #000000;">(</span><span style="color: #000000;">1</span><span style="color: #000000;">)</span><br />::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />nZoom:=<span style="color: #000000;">(</span>nHeight/::<span style="color: #000000;">nHeight</span><span style="color: #000000;">)</span><br />::<span style="color: #000000;">Zoom</span><span style="color: #000000;">(</span>nZoom<span style="color: #000000;">)</span><br />::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// RECALCULAR TAMAÑO SCROLL </span><br />::<span style="color: #000000;">nNewScrollDiferencial</span> := ::<span style="color: #000000;">nHeight</span>/<span style="color: #000000;">(</span>::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">nHeight</span><span style="color: #000000;">)</span><br />::<span style="color: #000000;">oNewScroll</span>:<span style="color: #000000;">nHeight</span>:= <span style="color: #000000;">(</span>::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">nHeight</span>/::<span style="color: #000000;">nNewScrollDiferencial</span><span style="color: #000000;">)</span><br />::<span style="color: #000000;">oNewScroll</span>:<span style="color: #000000;">nHeight</span>:=::<span style="color: #000000;">oNewScroll</span>:<span style="color: #000000;">nHeight</span><span style="color: #000000;">+5</span><br />::<span style="color: #000000;">oNewScroll</span>:<span style="color: #000000;">nTop</span>:=<span style="color: #000000;">1</span><br />::<span style="color: #000000;">oNewScroll</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span><span style="color: #00C800;">NIL</span><span style="color: #000000;">)</span><br /><br /><br /> </div>[/code:111g27c6]
Y como una imagen vale mas que mil palabras
OBJETO REDIMENSIONADO AL TAMAÑO (ALTURA) NECESARIO
[url=https://imgbb.com/:111g27c6][img:111g27c6]https://i.ibb.co/NCDk8VH/infinita-antonio3.jpg[/img:111g27c6][/url:111g27c6] |
es una broma no? | Hola :
Yo creo que sera una broma para novatos como yo que probamos ejemplos del FWH\Samples sin mirar el codigo.
en el ejemplo XbrwEdit.prg esta este codigo.
[code=fw:2957dpx2]<div class="fw" id="{CB}" style="font-family: monospace;"><br />USE Customer <br />ZAP<br /><span style="color: #B900B9;">/*..........*/</span><br /> </div>[/code:2957dpx2]
Me he cargado todos los datos de la base de datos customer. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Supongo que lo modificaran ustedes, no?, pero lo podrian dejar para que no ejecutaramos codigo sin antes mirarlo <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->
Un abrazo a todos.
Jose. |
es una broma no? | Había algo, una utilidad, para deshacer el zap, porque el zap simplemente es una marca en la cabecera de la .dbf |
es una broma no? | No Paco no pasa nada tengo FWH en el portátil. Lo cogeré de allí. El código de este ejemplo no no entiendo de ninguna manera, gracias por el interés.
Jose.
Enviado desde mi POCOPHONE F1 mediante Tapatalk |
es una broma no? | Debe haber sido alguna prueba y se ha olvidado quitarlo
gracias por el aviso <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
es una broma no? | Con razon <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
[img:1bed431d]https://media.giphy.com/media/E7iIfUlWHBmh2/giphy.gif[/img:1bed431d]
[code=fw:1bed431d]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span> <br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"XBrowse.ch"</span> <br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /><br /> <span style="color: #00C800;">local</span> oWnd, oBrw, oCol <br /><br /> USE Customer <br /> ZAP<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <br /> <br /> @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"Customer"</span> <br /> <br /> oBrw:<span style="color: #000000;">lFastEdit</span> = .T. <br /> <br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || Customer->First <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"First"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, Customer->First := xVal,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || Customer->Last <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"Last"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, <span style="color: #000000;">(</span> Customer->Last := xVal, DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> <br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <br /> oWnd:<span style="color: #000000;">oClient</span> = oBrw <br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:1bed431d] |
es una broma no? | Jaja. [emoji1]
Enviado desde mi Lenovo TB-J606F mediante Tapatalk |
es una broma no? | Recuerdo una función de una lib que comprobaba si el ordenador estaba encendido o no....
[code=fw:2h53f5hr]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> IsComputerOn<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> .t.<br /> </div>[/code:2h53f5hr]
El código se entiende no? <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: --> |
es una broma no? | Recuerdo aquel técnico que a una chica rubia le preguntó por teléfono si su teclado era inhalámbrico. Respondió que no lo sabía. "Pues entonces, coge el teclado, levántate y anda 5 metros hacia atrás. ¿ Sigues teniendo el teclado en las manos ?"
¿ Que por qué era chica y rubia ? No lo sé. No soy técnico en la química de perfiles genéticos. Sólo me estoy estudiando la química del napalm |
es una broma no? | Hola Paco.
Lo de la funcion lo entiendo hasta yo . <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Yo empece a trabajar hace muchos años en un banco, imaginate que las operatorias eran una aplicacion y la base de datos otra o sea tu cargabas o abonabas en una cuenta
y en realidad no sabias de quien era. Bueno confiabas en haberla tecleado bien. Tambien conoci oficinas muy pequeñas que trabajaban offline, si, los reintegros eran sin saber el saldo.
luego con un modem, por supuesto de 14400 bps, pasaban las operaciones y se actualizaban saldos en procesos batch que duraban toda la noche y a veces hasta entrado el dia.
Resumiendo el jefe de la seccion de informatica, (que por supuesto era el que sabia menos) , siempre cuando llamabas para comentar algun problema y te cogia el el telefono te comentaba
¿Tienes el ordenador en marcha?, encima se vanagloriaba que muchas veces arreglaba el problema. <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Un abrazo a todos.
Jose. |
escanear documento... | Hola.
Necesito escanear documentos desde una aplicacion. al querer compilar una de los sources que baje "QScanner2" me pide un eztwain.h alguien la tiene?
que otra opcion tengo para escanear?
gracias.
Gustavo. |
escanear documento... | Te copio el codigo
[code=fw:2mxwaiar]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// EZTWAIN.H - interface to Easy TWAIN library</span><br /><span style="color: #B900B9;">// Copyright (C) 1999-2001 by Dosadi. All Rights Reserved.</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------<br />Licensing Terms - EZTWAIN 2.70<br /><br />This is a legal agreement between you (or your employer if you are an<br />employee), and Dosadi (a company in Washington State, U.S.A.)<br />By using this EZTWAIN code ('EZTWAIN'), you and Dosadi agree as follows:<br /><br /> 1. EZTWAIN is and shall remain the property of Dosadi.<br /><br /> 2. Dosadi grants you a nonexclusive, world-wide, royalty-free<br /> license to use this code to create Windows applications for personal,<br /> educational, or not-for-profit use.<br /><br /> 3. You agree to redistribute EZTWAIN to others only as an integral<br /> component of a software or software/hardware system, and then<br /> only to other members of an educational or not-for-profit organization<br /> to which you belong.<br /><br /> 4. You agree to indemnify and hold Dosadi, its owners, officers and employees<br /> harmless from any liabilities arising out of your use of EZTWAIN.<br /><br /> 5. You may modify EZTWAIN. Any such modified EZTWAIN is subject to this<br /> agreement just as the original is.<br /><br /> 6. Dosadi reserves all rights not specifically granted in this agreement.<br /><br /> 7. EZTWAIN is provided "as is", and Dosadi makes no warranty of any kind<br /> regarding EZTWAIN.<br /><br /> 8. Where this agreement is in conflict with applicable law, it shall be<br /> construed as having been written to conform to such law while<br /> while giving priority to the rights of Dosadi.<br /><br />---------------------------------------------------------------------*/</span><br /><br /><span style="color: #B900B9;">// Download from: www.dosadi.com</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// Support contact: support@dosadi.com</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// To license the EZTWAIN code for commercial use within your company</span><br /><span style="color: #B900B9;">// or in a product, send e-mail to:</span><br /><span style="color: #B900B9;">// <!-- e --><a href="mailto:sales@dosadi.com">sales@dosadi.com</a><!-- e --></span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// >>> Maintenance history is at the end of eztwain.c <<<</span><br /><br /><br />#ifndef EZTWAIN_H<br /><span style="color: #00D7D7;">#define</span> EZTWAIN_H<br /><br />#ifndef _WINDOWS_<br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"windows.h"</span><br />#endif<br /><br />#ifdef __cplusplus<br />extern <span style="color: #ff0000;">"C"</span> <span style="color: #000000;">{</span> <span style="color: #B900B9;">/* Assume C declarations for C++ */</span><br />#endif <span style="color: #B900B9;">/* __cplusplus */</span><br /><br />#ifndef EZTAPI<br /> #ifdef _WIN32<br /> <span style="color: #00D7D7;">#define</span> EZTAPI WINAPI<br /> #else<br /> <span style="color: #00D7D7;">#define</span> EZTAPI FAR PASCAL<br /> #endif<br />#endif<br /><br /><span style="color: #B900B9;">//--------- Test Call</span><br /><br />HANDLE EZTAPI TWAIN_Testing123<span style="color: #000000;">(</span>LPCSTR pz, int n, HANDLE h, double d, unsigned u<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Displays a dialog box with the parameter values in it. Use this to</span><br /><span style="color: #B900B9;">// test that you can call EZTWAIN and pass parameters correctly.</span><br /><span style="color: #B900B9;">// It returns the value of the HANDLE h parameter.</span><br /><br /><span style="color: #B900B9;">//--------- Top-Level Calls</span><br /><br />HANDLE EZTAPI TWAIN_Acquire<span style="color: #000000;">(</span>HWND hwndApp<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Acquires a single image, from the currently selected Data Source, using</span><br /><span style="color: #B900B9;">// EZTWAIN's preferred transfer mode. *Currently the preferred mode is NATIVE*</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// The minimal use of EZTWAIN.DLL is to call this function with a 0 argument.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// The return value is a handle to global memory containing a DIB - </span><br /><span style="color: #B900B9;">// a Device-Independent Bitmap. Numerous EZTWAIN DIB_xxx functions can</span><br /><span style="color: #B900B9;">// be used to examine, modify, and save these DIB images. Remember to</span><br /><span style="color: #B900B9;">// use TWAIN_FreeNative to free each DIB when you are done with it!</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// Normally only one image is acquired per call: All Acquire functions shut</span><br /><span style="color: #B900B9;">// down TWAIN before returning. Use TWAIN_SetMultiTransfer to change this.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// By default, the default data source (DS) is opened, displays its dialog,</span><br /><span style="color: #B900B9;">// and determines all the parameters of the acquisition and transfer.</span><br /><span style="color: #B900B9;">// If you want to (try to) hide the DS dialog, see TWAIN_SetHideUI.</span><br /><span style="color: #B900B9;">// To set acquisition parameters, you need to do something like this:</span><br /><span style="color: #B900B9;">// TWAIN_OpenDefaultSource() -or- TWAIN_OpenSource(sourceName)</span><br /><span style="color: #B900B9;">// TWAIN_Set* - one or more capability-setting functions</span><br /><span style="color: #B900B9;">// hdib = TWAIN_Acquire(hwnd)</span><br /><span style="color: #B900B9;">// if (hdib) { ... process image, TWAIN_FreeNative(hdib); }</span><br /><br />void EZTAPI TWAIN_FreeNative<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Release the memory allocated to a DIB, as returned by</span><br /><span style="color: #B900B9;">// TWAIN_AcquireNative. (If you are coding in C or C++, this is just a call</span><br /><span style="color: #B900B9;">// to GlobalFree.)</span><br /><span style="color: #B900B9;">// If you use TWAIN_AcquireNative and don't free the returned image handle,</span><br /><span style="color: #B900B9;">// it stays around taking up Windows (virtual) memory until your application</span><br /><span style="color: #B900B9;">// terminates.</span><br /><br />int EZTAPI TWAIN_SelectImageSource<span style="color: #000000;">(</span>HWND hwnd<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// This is the routine to call when the user chooses the "Select Source..."</span><br /><span style="color: #B900B9;">// menu command from your application's File menu.</span><br /><span style="color: #B900B9;">// In the standard implementation of "Select Source...", your application</span><br /><span style="color: #B900B9;">// doesn't need to do anything except make this one call.</span><br /><span style="color: #B900B9;">// Note: If only one TWAIN device is installed on a system, it is selected</span><br /><span style="color: #B900B9;">// automatically, so there is no need for the user to do Select Source.</span><br /><span style="color: #B900B9;">// You should not require your users to do Select Source before Acquire.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// This function posts the Source Manager's Select Source dialog box.</span><br /><span style="color: #B900B9;">// It returns after the user either OK's or CANCEL's that dialog.</span><br /><span style="color: #B900B9;">// A return of 1 indicates OK, 0 indicates one of the following:</span><br /><span style="color: #B900B9;">// a) The user cancelled the dialog</span><br /><span style="color: #B900B9;">// b) The Source Manager found no data sources installed</span><br /><span style="color: #B900B9;">// c) There was a failure before the Select Source dialog could be posted</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// If you want to be meticulous, disable your "Acquire" and "Select Source"</span><br /><span style="color: #B900B9;">// menu items or buttons if TWAIN_IsAvailable() returns 0 - see below.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// To enumerate the available data sources, see:</span><br /><span style="color: #B900B9;">// TWAIN_GetSourceList and TWAIN_GetNextSourceName</span><br /><br />HANDLE EZTAPI TWAIN_AcquireNative<span style="color: #000000;">(</span>HWND hwndApp, unsigned wPixTypes<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Acquires a single image, from the currently selected Data Source, using</span><br /><span style="color: #B900B9;">// Native Transfer Mode. It waits until the source closes (if it's modal) or</span><br /><span style="color: #B900B9;">// forces the source closed if not. The return value is a handle to the</span><br /><span style="color: #B900B9;">// acquired image. Only one image can be acquired per call.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// The return value is a handle to global memory containing a DIB - </span><br /><span style="color: #B900B9;">// a Device-Independent Bitmap. Numerous EZTWAIN functions can</span><br /><span style="color: #B900B9;">// be used to examine, modify, and save these DIBs. Remember to</span><br /><span style="color: #B900B9;">// use TWAIN_FreeNative to free each DIB when you are done with it,</span><br /><span style="color: #B900B9;">// these things eat up a lot of memory.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// For the 2nd parameter, you can OR or add together the following</span><br /><span style="color: #B900B9;">// masks to indicate what kind(s) of image you prefer to receive.</span><br /><span style="color: #B900B9;">// Caution: Some TWAIN devices will ignore your preference here.</span><br /><span style="color: #B900B9;">// -- If you care, check the parameters of the DIB.</span><br /><br /><span style="color: #00D7D7;">#define</span> TWAIN_BW 0x0001 <span style="color: #B900B9;">// 1-bit per pixel, B&W</span><br /><span style="color: #00D7D7;">#define</span> TWAIN_GRAY 0x0002 <span style="color: #B900B9;">// 1,4, or 8-bit grayscale</span><br /><span style="color: #00D7D7;">#define</span> TWAIN_RGB 0x0004 <span style="color: #B900B9;">// 24-bit RGB color</span><br /><span style="color: #00D7D7;">#define</span> TWAIN_PALETTE 0x0008 <span style="color: #B900B9;">// 1,4, or 8-bit palette</span><br /><br /><span style="color: #00D7D7;">#define</span> TWAIN_ANYTYPE 0x0000 <span style="color: #B900B9;">// any of the above (use by itself)</span><br /><br />int EZTAPI TWAIN_AcquireToClipboard<span style="color: #000000;">(</span>HWND hwndApp, unsigned wPixTypes<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Like AcquireNative, but puts the resulting image, if any, into the</span><br /><span style="color: #B900B9;">// system clipboard as a CF_DIB item. If this call fails, the clipboard is</span><br /><span style="color: #B900B9;">// either empty or retains its previous content.</span><br /><span style="color: #B900B9;">// Returns TRUE (1) for success, FALSE (0) for failure.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// Useful for environments like Visual Basic where it is hard to make direct</span><br /><span style="color: #B900B9;">// use of a DIB handle. In fact, TWAIN_AcquireToClipboard uses</span><br /><span style="color: #B900B9;">// TWAIN_AcquireNative for all the hard work.</span><br /><br />HANDLE EZTAPI TWAIN_AcquireMemory<span style="color: #000000;">(</span>HWND hwnd<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Like TWAIN_Acquire, but always specifies a 'memory mode' transfer.</span><br /><br />typedef BOOL <span style="color: #000000;">(</span>WINAPI *MEMXFERCALLBACK<span style="color: #000000;">)</span><span style="color: #000000;">(</span>LPVOID <span style="color: #00C800;">data</span><span style="color: #000000;">)</span>;<br /><br />BOOL EZTAPI TWAIN_AcquireMemoryCallback<span style="color: #000000;">(</span>HWND hwnd, MEMXFERCALLBACK cb, LPVOID <span style="color: #00C800;">data</span><span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Like TWAIN_AcquireMemory, but you provide a call-back function.</span><br /><span style="color: #B900B9;">// The call-back is called when the transfer is ready, and is responsible for</span><br /><span style="color: #B900B9;">// setting up the transfer, transferring the data, and doing clean-up.</span><br /><span style="color: #B900B9;">// See the function MemoryXferHandler in EZTWAIN.C for an example.</span><br /><br />int EZTAPI TWAIN_AcquireToFilename<span style="color: #000000;">(</span>HWND hwndApp, LPCSTR pszFile<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Acquire an image and write it to a file using the current Save Format,</span><br /><span style="color: #B900B9;">// (See TWAIN_SetSaveFormat) which by default is BMP. </span><br /><span style="color: #B900B9;">// If pszFile is NULL or an empty string, the user is prompted for</span><br /><span style="color: #B900B9;">// the file name *and format* in a standard Save File dialog,</span><br /><span style="color: #B900B9;">// See also TWAIN_AcquireFile below.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// Return values:</span><br /><span style="color: #B900B9;">// 0 success.</span><br /><span style="color: #B900B9;">// -1 the Acquire failed.</span><br /><span style="color: #B900B9;">// -2 file open error (invalid path or name, or access denied)</span><br /><span style="color: #B900B9;">// -3 invalid DIB, or image incompatible with file format, or...</span><br /><span style="color: #B900B9;">// -4 writing failed, possibly output device is full.</span><br /><span style="color: #B900B9;">// -10 user cancelled File Save dialog</span><br /><br />int EZTAPI TWAIN_AcquireFile<span style="color: #000000;">(</span>HWND hwndApp, int nFF, LPCSTR pszFile<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Acquire an image directly to a file, using the given format and filepath.</span><br /><span style="color: #B900B9;">// * Unlike AcquireToFilename, this function uses TWAIN File Transfer Mode.</span><br /><span style="color: #B900B9;">// * The image is written to disk by the Data Source, not by EZTWAIN.</span><br /><span style="color: #B900B9;">// * Warning: This mode is -not- supported by all TWAIN devices.</span><br /><span style="color: #B900B9;">// </span><br /><span style="color: #B900B9;">// Use TWAIN_SupportsFileXfer to see if the open DS supports File Transfer.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// You can use TWAIN_Get(ICAP_IMAGEFILEFORMAT) to get an enumeration of</span><br /><span style="color: #B900B9;">// the available file formats, and CONTAINER_ContainsValue to check for</span><br /><span style="color: #B900B9;">// a particular format you are interested in.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// nFF can be any file format supported by the DS, see the TWFF_* constants</span><br /><span style="color: #B900B9;">// in twain.h for the list of allowed formats. A compliant DS should</span><br /><span style="color: #B900B9;">// at least support TWFF_BMP, but as usual there are no guarantees.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// If pszFile is NULL or an empty string, the user is prompted for</span><br /><span style="color: #B900B9;">// the file name in a standard Save File dialog.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// Return values (N.B. A Boolean, not an error code like AcquireToFilename!)</span><br /><span style="color: #B900B9;">// TRUE(1) for success</span><br /><span style="color: #B900B9;">// FALSE(0) for failure - use GetResultCode/GetConditionCode for details.</span><br /><span style="color: #B900B9;">// If the user cancels the Save File dialog, the result code is TWRC_CANCEL</span><br /><br /><br /><span style="color: #B900B9;">//--------- Basic TWAIN Inquiries</span><br /><br />int EZTAPI TWAIN_IsAvailable<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Call this function any time to find out if TWAIN is installed on the</span><br /><span style="color: #B900B9;">// system. It takes a little time on the first call, after that it's fast,</span><br /><span style="color: #B900B9;">// just testing a flag. It returns 1 if the TWAIN Source Manager is</span><br /><span style="color: #B900B9;">// installed & can be loaded, 0 otherwise. </span><br /><br /><br />int EZTAPI TWAIN_EasyVersion<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Returns the version number of EZTWAIN.DLL, multiplied by 100.</span><br /><span style="color: #B900B9;">// So e.g. version 2.01 will return 201 from this call.</span><br /><br />int EZTAPI TWAIN_State<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Returns the TWAIN Protocol State per the spec.</span><br /><span style="color: #00D7D7;">#define</span> TWAIN_PRESESSION <span style="color: #000000;">1</span> <span style="color: #B900B9;">// source manager not loaded</span><br /><span style="color: #00D7D7;">#define</span> TWAIN_SM_LOADED <span style="color: #000000;">2</span> <span style="color: #B900B9;">// source manager loaded</span><br /><span style="color: #00D7D7;">#define</span> TWAIN_SM_OPEN <span style="color: #000000;">3</span> <span style="color: #B900B9;">// source manager open</span><br /><span style="color: #00D7D7;">#define</span> TWAIN_SOURCE_OPEN <span style="color: #000000;">4</span> <span style="color: #B900B9;">// source open but not enabled</span><br /><span style="color: #00D7D7;">#define</span> TWAIN_SOURCE_ENABLED <span style="color: #000000;">5</span> <span style="color: #B900B9;">// source enabled to acquire</span><br /><span style="color: #00D7D7;">#define</span> TWAIN_TRANSFER_READY <span style="color: #000000;">6</span> <span style="color: #B900B9;">// image ready to transfer</span><br /><span style="color: #00D7D7;">#define</span> TWAIN_TRANSFERRING <span style="color: #000000;">7</span> <span style="color: #B900B9;">// image in transit</span><br /><br />char* EZTAPI TWAIN_SourceName<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Returns a pointer to the name of the currently or last opened source.</span><br /><span style="color: #B900B9;">// Note: Even on NT or other Unicode-enabled platform, this is still</span><br /><span style="color: #B900B9;">// a pointer to an 8-bit ASCII string.</span><br /><br />void EZTAPI TWAIN_GetSourceName<span style="color: #000000;">(</span>LPSTR pzName<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Like TWAIN_SourceName, but copies current/last source name into pzName.</span><br /><span style="color: #B900B9;">// Please allocate enough space - 256 char at least.</span><br /><br /><br /><span style="color: #B900B9;">//--------- DIB handling utilities ---------</span><br /><br />void EZTAPI DIB_SetResolution<span style="color: #000000;">(</span>HANDLE hdib, double xdpi, double ydpi<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Sets the horizontal and vertical resolution of the DIB.</span><br />double EZTAPI DIB_XResolution<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Horizontal (x) resolution of DIB, in DPI (dots per inch)</span><br />double EZTAPI DIB_YResolution<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Vertical (y) resolution of DIB, in DPI (dots per inch)</span><br />int EZTAPI DIB_Depth<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Depth of DIB, in bits i.e. bits per pixel.</span><br />int EZTAPI DIB_Width<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Width of DIB, in pixels (columns)</span><br />int EZTAPI DIB_Height<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Height of DIB, in lines (rows)</span><br />size_t EZTAPI DIB_RowBytes<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Number of bytes needed to store one row of the DIB.</span><br />int EZTAPI DIB_ColorCount<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Number of colors in color table of DIB</span><br /><br />BITMAPINFOHEADER* EZTAPI DIB_Lock<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Lock the given DIB handle and return a pointer to the header structure.</span><br /><span style="color: #B900B9;">// Technically, increments the lock count of hdib and returns its address.</span><br />void EZTAPI DIB_Unlock<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Unlock the given DIB handle (decrement the lock count.)</span><br /><span style="color: #B900B9;">// When the number of Unlocks = the number of Locks, any pointers</span><br /><span style="color: #B900B9;">// into the DIB should be presumed invalid.</span><br /><br />void EZTAPI DIB_ReadRow<span style="color: #000000;">(</span>HANDLE hdib, int nRow, BYTE* prow<span style="color: #000000;">)</span>;<br />void EZTAPI DIB_ReadRowRGB<span style="color: #000000;">(</span>HANDLE hdib, int nRow, BYTE* prow<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Read row n of the given DIB into buffer at prow.</span><br /><span style="color: #B900B9;">// Caller is responsible for ensuring buffer is large enough.</span><br /><span style="color: #B900B9;">// Row 0 is the *top* row of the image, as it would be displayed.</span><br /><span style="color: #B900B9;">// The first variant reads the data as-is from the DIB, including</span><br /><span style="color: #B900B9;">// BGR pixels from 24-bit DIBs, or packed 1-bit, 4-bit or 8-bit.</span><br /><span style="color: #B900B9;">// The RGB variant unpacks every DIB pixel into 3-byte RGB pixels.</span><br /><br />void EZTAPI DIB_WriteRow<span style="color: #000000;">(</span>HANDLE hdib, int r, const BYTE* pdata<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Write data from buffer into row r of the given DIB.</span><br /><span style="color: #B900B9;">// Caller is responsible for ensuring buffer and row exist, etc.</span><br />void EZTAPI DIB_WriteRowChannel<span style="color: #000000;">(</span>HANDLE hdib, int r, const BYTE* pdata, int nChannel<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Write data from buffer into one color channel of row r of the given DIB.</span><br /><span style="color: #B900B9;">// Channels are: 0=Red, 1=Green, 2=Blue. If the DIB depth < 24, acts like WriteRow.</span><br /><br />HANDLE EZTAPI DIB_Allocate<span style="color: #000000;">(</span>int nDepth, int nWidth, int nHeight<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Create a DIB with the given dimensions. Resolution is set to 0. A default</span><br /><span style="color: #B900B9;">// color table is provided if depth <= 8.</span><br /><span style="color: #B900B9;">// The image data is uninitialized i.e. garbage.</span><br /><br />void EZTAPI DIB_Free<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Release the storage of the DIB.</span><br /><br />HANDLE EZTAPI DIB_Copy<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Create and return a byte-for-byte copy of a DIB.</span><br /><br />void EZTAPI DIB_SetGrayColorTable<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Fill the DIB's color table with a gray ramp - so color 0 is black, and</span><br /><span style="color: #B900B9;">// the last color (largest pixel value) is white. No effect if depth > 8.</span><br />void EZTAPI DIB_SetColorTableRGB<span style="color: #000000;">(</span>HANDLE hdib, int i, int R, int G, int B<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Set the ith entry in the DIB's color table to the specified color.</span><br /><span style="color: #B900B9;">// R G and B range from 0 to 255.</span><br /><br />int EZTAPI DIB_ColorTableR<span style="color: #000000;">(</span>HANDLE hdib, int i<span style="color: #000000;">)</span>;<br />int EZTAPI DIB_ColorTableG<span style="color: #000000;">(</span>HANDLE hdib, int i<span style="color: #000000;">)</span>;<br />int EZTAPI DIB_ColorTableB<span style="color: #000000;">(</span>HANDLE hdib, int i<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return the R,G, or B component of the ith color table entry of a DIB.</span><br /><span style="color: #B900B9;">// If i < 0 or >= DIB_ColorCount(hdib), returns 0.</span><br /><br />void EZTAPI DIB_SwapRedBlue<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// For 24-bit DIB only, exchange R and B components of each pixel.</span><br /><br />HPALETTE EZTAPI DIB_CreatePalette<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Create and return a logical palette to be used for drawing the DIB.</span><br /><span style="color: #B900B9;">// For 1, 4, and 8-bit DIBs the palette contains the DIB color table.</span><br /><span style="color: #B900B9;">// For 24-bit DIBs, a default halftone palette is returned.</span><br /><br />void EZTAPI DIB_SetColorCount<span style="color: #000000;">(</span>HANDLE hdib, int n<span style="color: #000000;">)</span>;<br /><br /><br />void EZTAPI DIB_DrawToDC<span style="color: #000000;">(</span>HANDLE hdib, <span style="color: #B900B9;">// DIB handle</span><br /> HDC hDC, <span style="color: #B900B9;">// destination device context</span><br /> int dx, int dy,<span style="color: #B900B9;">// destination (x,y)</span><br /> int w, int h, <span style="color: #B900B9;">// width and height</span><br /> int sx, int sy <span style="color: #B900B9;">// source (x,y) in DIB</span><br /> <span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Draws DIB on a device context.</span><br /><span style="color: #B900B9;">// You should call CreateDibPalette, select that palette</span><br /><span style="color: #B900B9;">// into the DC, and do a RealizePalette(hDC) first.</span><br /><br />int EZTAPI DIB_PutOnClipboard<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Place DIB on the clipboard (format CF_DIB)</span><br /><span style="color: #B900B9;">// ** IMPORTANT ** After this call, the clipboard owns the</span><br /><span style="color: #B900B9;">// DIB and you do not - you should erase your copy of the handle</span><br /><span style="color: #B900B9;">// and do not attempt any subsequent operations on it.</span><br /><span style="color: #B900B9;">// Treat this call just as you would a call to DIB_Free.</span><br /><span style="color: #B900B9;">// Returns 1 = success, 0 = failure.</span><br /><br />HANDLE EZTAPI DIB_GetFromClipboard<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><br />int EZTAPI DIB_WriteToBmp<span style="color: #000000;">(</span>HANDLE hdib, LPCSTR pszFile<span style="color: #000000;">)</span>;<br />int EZTAPI DIB_WriteToBmpFile<span style="color: #000000;">(</span>HANDLE hdib, HFILE fh<span style="color: #000000;">)</span>;<br />int EZTAPI DIB_WriteToJpeg<span style="color: #000000;">(</span>HANDLE hdib, LPCSTR pszFile<span style="color: #000000;">)</span>;<br /><br />HANDLE EZTAPI DIB_LoadFromFilename<span style="color: #000000;">(</span>LPCSTR pszFile<span style="color: #000000;">)</span>;<br /><br /><span style="color: #B900B9;">//--- OBSOLETE: The following functions are for backward compatibility only:</span><br />int EZTAPI TWAIN_DibDepth<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_DibWidth<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_DibHeight<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_DibNumColors<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br />long EZTAPI TWAIN_DibRowBytes<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br />void EZTAPI TWAIN_DibReadRow<span style="color: #000000;">(</span>HANDLE hdib, int nRow, BYTE* prow<span style="color: #000000;">)</span>;<br />HPALETTE EZTAPI TWAIN_CreateDibPalette<span style="color: #000000;">(</span>HANDLE hdib<span style="color: #000000;">)</span>;<br />void EZTAPI TWAIN_DrawDibToDC<span style="color: #000000;">(</span>HDC hDC,int dx,int dy,int w,int h,HANDLE hdib,int sx, int sy<span style="color: #000000;">)</span>;<br /><br /><span style="color: #B900B9;">//--------- File Read/Write</span><br /><br /><span style="color: #B900B9;">//---- File Formats</span><br /><span style="color: #00D7D7;">#define</span> TWFF_BMP <span style="color: #000000;">2</span><br /><span style="color: #00D7D7;">#define</span> TWFF_JFIF <span style="color: #000000;">4</span><br /><br />int EZTAPI TWAIN_IsJpegAvailable<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return TRUE (1) if JPEG/JFIF image files can be read and written.</span><br /><span style="color: #B900B9;">// Returns 0 if JPEG support has not been installed.</span><br /><br />int EZTAPI TWAIN_SetSaveFormat<span style="color: #000000;">(</span>int nFF<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Select the file format for subsequent calls to WriteNativeToFilename</span><br /><span style="color: #B900B9;">// Displays a warning message if the format is not available.</span><br /><span style="color: #B900B9;">// Returns TRUE (1) if ok, FALSE (0) if format is invalid or not available.</span><br /><span style="color: #B900B9;">// nFF type ext notes</span><br /><span style="color: #B900B9;">// 2 BMP .bmp uncompressed by default</span><br /><span style="color: #B900B9;">// 4 JFIF .jpg JPEG File Interchange Format 1.02</span><br /><br />int EZTAPI TWAIN_GetSaveFormat<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return the currently selected save format.</span><br /><br />void EZTAPI TWAIN_SetJpegQuality<span style="color: #000000;">(</span>int nQ<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_GetJpegQuality<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Set the 'quality' of subsequently saved JPEG/JFIF image files.</span><br /><span style="color: #B900B9;">// nQ = 100 is maximum quality & minimum compression.</span><br /><span style="color: #B900B9;">// nQ = 75 is 'good' quality, the default.</span><br /><span style="color: #B900B9;">// nQ = 1 is minimum quality & maximum compression.</span><br /> <br />int EZTAPI TWAIN_WriteNativeToFilename<span style="color: #000000;">(</span>HANDLE hdib, LPCSTR pszFile<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Writes a DIB handle to a file using the current save format.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// hdib = DIB handle, as returned by TWAIN_AcquireNative</span><br /><span style="color: #B900B9;">// pszFile = far pointer to NUL-terminated filename</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// If pszFile is NULL or points to a null string, the user is</span><br /><span style="color: #B900B9;">// prompted for the filename *and format* with a standard Windows</span><br /><span style="color: #B900B9;">// file-save dialog.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// Return values:</span><br /><span style="color: #B900B9;">// 0 success</span><br /><span style="color: #B900B9;">// -1 user cancelled File Save dialog</span><br /><span style="color: #B900B9;">// -2 file open error (invalid path or name, or access denied)</span><br /><span style="color: #B900B9;">// -3 image is invalid, or cannot be written in this format.</span><br /><span style="color: #B900B9;">// -4 writing data failed, possibly output device is full</span><br /><br /><br />HANDLE EZTAPI TWAIN_LoadNativeFromFilename<span style="color: #000000;">(</span>LPCSTR pszFile<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Load a .BMP file (or JPEG) and return a DIB handle.</span><br /><span style="color: #B900B9;">// Accepts a filename (including path & extension).</span><br /><span style="color: #B900B9;">// If pszFile is NULL or points to a null string, the user is</span><br /><span style="color: #B900B9;">// prompted to choose a file with a standard File Open dialog.</span><br /><span style="color: #B900B9;">// Returns a DIB handle if successful, otherwise NULL.</span><br /><br />HANDLE EZTAPI TWAIN_LoadNativeFromFile<span style="color: #000000;">(</span>HFILE fh<span style="color: #000000;">)</span>;<br /><br /><br /><span style="color: #B900B9;">//--------- Global Options</span><br /><br />void EZTAPI TWAIN_SetMultiTransfer<span style="color: #000000;">(</span>int fYes<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_GetMultiTransfer<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// This function controls the 'multiple transfers' flag.</span><br /><span style="color: #B900B9;">// If this flag is non-zero: After an Acquire, the Data Source</span><br /><span style="color: #B900B9;">// is not closed, but is left open to allow additional images</span><br /><span style="color: #B900B9;">// to be acquired in the same session. The programmer may</span><br /><span style="color: #B900B9;">// need to close the Data Source after all images have been</span><br /><span style="color: #B900B9;">// transferred, for example by calling</span><br /><span style="color: #B900B9;">// TWAIN_CloseSource or</span><br /><span style="color: #B900B9;">// TWAIN_UnloadSourceManager</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// In multi-transfer mode, you can check for the availability of</span><br /><span style="color: #B900B9;">// more images by calling TWAIN_State. A state of 6 (TWAIN_TRANSFER_READY)</span><br /><span style="color: #B900B9;">// means that the Data Source knows it has at least one more image.</span><br /><span style="color: #B900B9;">// A state of 5 (TWAIN_SOURCE_ENABLED) means that the user has not</span><br /><span style="color: #B900B9;">// closed the Data Source, so it might be able to acquire another image.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// See also: TWAIN_UserClosedSource()</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// If you try to acquire and the Data Source can't do it, the acquire</span><br /><span style="color: #B900B9;">// function will return an error indication.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// By default, this feature is set to FALSE (0).</span><br /><br />void EZTAPI TWAIN_SetHideUI<span style="color: #000000;">(</span>int fHide<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_GetHideUI<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// These functions control the 'hide source user interface' flag.</span><br /><span style="color: #B900B9;">// This flag is cleared initially, but if you set it non-zero, then when</span><br /><span style="color: #B900B9;">// a source is enabled it will be asked to hide its user interface.</span><br /><span style="color: #B900B9;">// Note that this is only a request - some sources will ignore it!</span><br /><span style="color: #B900B9;">// This affects AcquireNative, AcquireToClipboard, and EnableSource.</span><br /><span style="color: #B900B9;">// If the user interface is hidden, you will probably want to set at least</span><br /><span style="color: #B900B9;">// some of the basic acquisition parameters yourself - see</span><br /><span style="color: #B900B9;">// SetCurrentUnits, SetCurrentPixelType, SetBitDepth and</span><br /><span style="color: #B900B9;">// SetCurrentResolution below.</span><br /><span style="color: #B900B9;">// See also: HasControllableUI</span><br /><br />void EZTAPI TWAIN_DisableParent<span style="color: #000000;">(</span>int fYes<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Disable the parent window during _Acquire...</span><br /><span style="color: #B900B9;">// (The parent window is the window you pass to the Acquire function.</span><br /><span style="color: #B900B9;">// Typically this is your main application window or dialog.)</span><br /><span style="color: #B900B9;">// By default this setting is TRUE - the parent</span><br /><span style="color: #B900B9;">// window, if you provide it, is disabled during an Acquire.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// Note 1: If you set this to FALSE, your window can receive user input while</span><br /><span style="color: #B900B9;">// an Acquire is in progress, and your code must be prepared for this.</span><br /><span style="color: #B900B9;">// Note 2: Some TWAIN data sources will disable the parent window on their</span><br /><span style="color: #B900B9;">// own, and EZTWAIN cannot prevent this.</span><br /><br />int EZTAPI TWAIN_GetDisableParent<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// return current setting of 'disable parent' flag.</span><br /><br /><span style="color: #B900B9;">//--------- Application Registration</span><br /><br />void EZTAPI TWAIN_RegisterApp<span style="color: #000000;">(</span><br /> int nMajorNum, <span style="color: #B900B9;">// major and incremental revision of application.</span><br /> int nMinorNum, <span style="color: #B900B9;">// e.g. version 4.5: nMajorNum = 4, nMinorNum = 5</span><br /> int nLanguage, <span style="color: #B900B9;">// (human) language (use TWLG_xxx from TWAIN.H)</span><br /> int nCountry, <span style="color: #B900B9;">// country (use TWCY_xxx from TWAIN.H)</span><br /> LPCSTR lpszVersion, <span style="color: #B900B9;">// version info string e.g. "1.0b3 Beta release"</span><br /> LPCSTR lpszMfg, <span style="color: #B900B9;">// name of mfg/developer e.g. "Crazbat Software"</span><br /> LPCSTR lpszFamily, <span style="color: #B900B9;">// product family e.g. "BitStomper"</span><br /> LPCSTR lpszProduct<span style="color: #000000;">)</span>; <span style="color: #B900B9;">// specific product e.g. "BitStomper Deluxe Pro"</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// TWAIN_RegisterApp can be called *AS THE FIRST CALL*, to register the</span><br /><span style="color: #B900B9;">// application. If this function is not called, the application is given a</span><br /><span style="color: #B900B9;">// 'generic' registration by EZTWAIN.</span><br /><span style="color: #B900B9;">// Registration only provides this information to the Source Manager and any</span><br /><span style="color: #B900B9;">// sources you may open - it is used for debugging, and (frankly) by some</span><br /><span style="color: #B900B9;">// sources to give special treatment to certain applications.</span><br /><br />void EZTAPI TWAIN_SetAppTitle<span style="color: #000000;">(</span>LPCSTR lpszTitle<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// The short form.</span><br /><span style="color: #B900B9;">// Sets the product name as far as TWAIN is concerned, and also the</span><br /><span style="color: #B900B9;">// title of any dialog boxes / error boxes that are displayed by EZTWAIN.</span><br /><br /><span style="color: #B900B9;">//--------- Error Analysis and Reporting ------------------------------------</span><br /><br />unsigned EZTAPI TWAIN_GetResultCode<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return the result code (TWRC_xxx) from the last triplet sent to TWAIN</span><br /><br />unsigned EZTAPI TWAIN_GetConditionCode<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return the condition code from the last triplet sent to TWAIN.</span><br /><span style="color: #B900B9;">// (To be precise, from the last call to TWAIN_DS below)</span><br /><span style="color: #B900B9;">// If a source is NOT open, return the condition code of the source manager.</span><br /><br />int EZTAPI TWAIN_UserClosedSource<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return TRUE (1) if during the last acquire the user asked</span><br /><span style="color: #B900B9;">// the DataSource to close. 0 otherwise of course.</span><br /><span style="color: #B900B9;">// This flag is cleared each time you start any kind of acquire,</span><br /><span style="color: #B900B9;">// or just call ModalEventLoop, and it is set if EZTWAIN receives a</span><br /><span style="color: #B900B9;">// MSG_XFERREADY message through TWAIN.</span><br /><br />void EZTAPI TWAIN_ErrorBox<span style="color: #000000;">(</span>LPCSTR pzMsg<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Post an error message dialog with an OK button,</span><br /><span style="color: #B900B9;">// and the title 'TWAIN Error'.</span><br /><span style="color: #B900B9;">// pszMsg points to a null-terminated message string.</span><br /><span style="color: #B900B9;">// If messages are suppressed (see below) this function does nothing.</span><br /><br />int EZTAPI TWAIN_SuppressErrorMessages<span style="color: #000000;">(</span>int nSuppress<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Enable or disable EZTWAIN error messages to the user.</span><br /><span style="color: #B900B9;">// When nSuppress = 0, error messages are displayed.</span><br /><span style="color: #B900B9;">// When nSuppress <> 0, error messages are suppressed.</span><br /><span style="color: #B900B9;">// By default, error messages are displayed.</span><br /><span style="color: #B900B9;">// Note that EZTWAIN cannot prevent messages from TWAIN or DSs.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// Return the previous state of the flag.</span><br /><br />void EZTAPI TWAIN_ReportLastError<span style="color: #000000;">(</span>LPCSTR pzMsg<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Like TWAIN_ErrorBox, but if some details are available from</span><br /><span style="color: #B900B9;">// TWAIN about the last failure, they are included in the message box.</span><br /><br />typedef enum <span style="color: #000000;">{</span><br /> EZTEC_NONE,<br /> EZTEC_START_TRIPLET_ERRS,<br /> EZTEC_CAP_GET, <span style="color: #B900B9;">// MSG_GET triplet on a capability failed</span><br /> EZTEC_CAP_SET, <span style="color: #B900B9;">// MSG_SET triplet on capability failed</span><br /> EZTEC_DSM_FAILURE, <span style="color: #B900B9;">// TWAIN DSM returned TWRC_FAILURE</span><br /> EZTEC_DS_FAILURE, <span style="color: #B900B9;">// source returned TWRC_FAILURE</span><br /> EZTEC_XFER_FAILURE, <span style="color: #B900B9;">// image transfer failed</span><br /> EZTEC_END_TRIPLET_ERRS,<br /> EZTEC_OPEN_DSM, <span style="color: #B900B9;">// opening DSM failed</span><br /> EZTEC_OPEN_DEFAULT_DS,<br /> EZTEC_NOT_STATE_4, <span style="color: #B900B9;">// operation invoked in wrong state</span><br /> EZTEC_NULL_HCON, <span style="color: #B900B9;">// MSG_GET returned a null container handle</span><br /> EZTEC_BAD_HCON, <span style="color: #B900B9;">// MSG_GET returned an invalid/unlockable container handle</span><br /> EZTEC_BAD_CONTYPE, <span style="color: #B900B9;">// returned container ConType is not valid.</span><br /> EZTEC_BAD_ITEMTYPE, <span style="color: #B900B9;">// returned container ItemType is not valid.</span><br /> EZTEC_CAP_GET_EMPTY, <span style="color: #B900B9;">// returned container has 0 items.</span><br /> EZTEC_CAP_SET_EMPTY, <span style="color: #B900B9;">// trying to restrict a cap to empty set</span><br /> EZTEC_INVALID_HWND, <span style="color: #B900B9;">// function passed an invalid window handle</span><br /> EZTEC_PROXY_WINDOW, <span style="color: #B900B9;">// internal proxy window create failed (unlikely!)</span><br /> EZTEC_USER_CANCEL, <span style="color: #B900B9;">// user cancelled operation</span><br /> EZTEC_RESOLUTION, <span style="color: #B900B9;">// Set failed for Resolution</span><br /><span style="color: #000000;">}</span> EZTWAIN_ERROR_CODE;<br /><br /><br />int EZTAPI TWAIN_LastErrorCode<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return the last internal EZTWAIN error code.</span><br /><br />void EZTAPI TWAIN_ClearError<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Set the EZTWAIN internal error code to EZTEC_NONE</span><br /><br /><br /><span style="color: #B900B9;">//--------- TWAIN State Control ------------------------------------</span><br /><br />int EZTAPI TWAIN_LoadSourceManager<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Finds and loads the Data Source Manager, TWAIN.DLL.</span><br /><span style="color: #B900B9;">// If Source Manager is already loaded, does nothing and returns TRUE.</span><br /><span style="color: #B900B9;">// This can fail if TWAIN.DLL is not installed (in the right place), or</span><br /><span style="color: #B900B9;">// if the library cannot load for some reason (insufficient memory?) or</span><br /><span style="color: #B900B9;">// if TWAIN.DLL has been corrupted.</span><br /><br />int EZTAPI TWAIN_OpenSourceManager<span style="color: #000000;">(</span>HWND hwnd<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Opens the Data Source Manager, if not already open.</span><br /><span style="color: #B900B9;">// If the Source Manager is already open, does nothing and returns TRUE.</span><br /><span style="color: #B900B9;">// This call will fail if the Source Manager is not loaded.</span><br /><br />int EZTAPI TWAIN_OpenDefaultSource<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// This opens the source selected in the Select Source dialog.</span><br /><span style="color: #B900B9;">// If some source is already open, does nothing and returns TRUE.</span><br /><span style="color: #B900B9;">// Will load and open the Source Manager if needed.</span><br /><span style="color: #B900B9;">// If this call returns TRUE, TWAIN is in STATE 4 (TWAIN_SOURCE_OPEN)</span><br /><br /><span style="color: #B900B9;">// These two functions allow you to enumerate the available data sources:</span><br />int EZTAPI TWAIN_GetSourceList<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Fetches the list of sources into memory, so they can be returned</span><br /><span style="color: #B900B9;">// one by one by TWAIN_GetNextSourceName, below.</span><br /><span style="color: #B900B9;">// Returns TRUE (1) if successful, FALSE (0) otherwise.</span><br /><br />int EZTAPI TWAIN_GetNextSourceName<span style="color: #000000;">(</span>LPSTR pzName<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Copies the next source name in the list into pzName.</span><br /><span style="color: #B900B9;">// Returns TRUE (1) if successful, FALSE (0) if there are no more.</span><br /><br />int EZTAPI TWAIN_GetDefaultSourceName<span style="color: #000000;">(</span>LPSTR pzName<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Copies the name of the TWAIN default source into pzName.</span><br /><span style="color: #B900B9;">// Normally returns TRUE (1) but will return FALSE (0) if:</span><br /><span style="color: #B900B9;">// - the TWAIN Source Manager cannot be loaded & initialized or</span><br /><span style="color: #B900B9;">// - there is no current default source (e.g. no sources are installed)</span><br /><br />int EZTAPI TWAIN_OpenSource<span style="color: #000000;">(</span>LPCSTR pzName<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Opens the source with the given name.</span><br /><span style="color: #B900B9;">// If that source is already open, does nothing and returns TRUE</span><br /><span style="color: #B900B9;">// If another source is open, closes it and attempts to open the specified source.</span><br /><span style="color: #B900B9;">// Will load and open the Source Manager if needed.</span><br /><br />int EZTAPI TWAIN_EnableSource<span style="color: #000000;">(</span>HWND hwnd<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Enables the open Data Source. This posts the source's user interface</span><br /><span style="color: #B900B9;">// and allows image acquisition to begin. If the source is already enabled,</span><br /><span style="color: #B900B9;">// this call does nothing and returns TRUE.</span><br /><br />int EZTAPI TWAIN_DisableSource<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Disables the open Data Source, if any.</span><br /><span style="color: #B900B9;">// This closes the source's user interface.</span><br /><span style="color: #B900B9;">// If there is not an enabled source, does nothing and returns TRUE.</span><br /><br />int EZTAPI TWAIN_CloseSource<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Closes the open Data Source, if any.</span><br /><span style="color: #B900B9;">// If the source is enabled, disables it first.</span><br /><span style="color: #B900B9;">// If there is not an open source, does nothing and returns TRUE.</span><br /><br />int EZTAPI TWAIN_CloseSourceManager<span style="color: #000000;">(</span>HWND hwnd<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Closes the Data Source Manager, if it is open.</span><br /><span style="color: #B900B9;">// If a source is open, disables and closes it as needed.</span><br /><span style="color: #B900B9;">// If the Source Manager is not open, does nothing and returns TRUE.</span><br /><br />int EZTAPI TWAIN_UnloadSourceManager<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Unloads the Data Source Manager i.e. TWAIN.DLL - releasing</span><br /><span style="color: #B900B9;">// any associated memory or resources.</span><br /><span style="color: #B900B9;">// If necessary, it will abort transfers, close the open source</span><br /><span style="color: #B900B9;">// if any, and close the Source Manager.</span><br /><span style="color: #B900B9;">// If successful, it returns 1 (TRUE)</span><br /><br /><br />int EZTAPI TWAIN_MessageHook<span style="color: #000000;">(</span>LPMSG lpmsg<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// This function detects Windows messages that should be routed</span><br /><span style="color: #B900B9;">// to an enabled Data Source, and picks them off. In a full TWAIN</span><br /><span style="color: #B900B9;">// app, TWAIN_MessageHook is called inside the main GetMessage loop.</span><br /><span style="color: #B900B9;">// The skeleton code looks like this: </span><br /><span style="color: #B900B9;">// MSG msg;</span><br /><span style="color: #B900B9;">// while (GetMessage((LPMSG)&msg, NULL, 0, 0)) {</span><br /><span style="color: #B900B9;">// if (!TWAIN_MessageHook ((LPMSG)&msg)) {</span><br /><span style="color: #B900B9;">// TranslateMessage ((LPMSG)&msg);</span><br /><span style="color: #B900B9;">// DispatchMessage ((LPMSG)&msg);</span><br /><span style="color: #B900B9;">// }</span><br /><span style="color: #B900B9;">// } // while</span><br /><br /><br />HANDLE EZTAPI TWAIN_WaitForNativeXfer<span style="color: #000000;">(</span>HWND hwnd<span style="color: #000000;">)</span>;<br /><br />int EZTAPI TWAIN_IsTransferReady<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><br />void EZTAPI TWAIN_ModalEventLoop<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Process messages until termination, source disable, or image transfer.</span><br /><br /><br />int EZTAPI TWAIN_EndXfer<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><br />int EZTAPI TWAIN_AbortAllPendingXfers<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><br /><span style="color: #B900B9;">//--------- High-level Capability Negotiation Functions --------</span><br /><span style="color: #B900B9;">// These functions should only be called in State 4 (TWAIN_SOURCE_OPEN)</span><br /><br />int EZTAPI TWAIN_NegotiateXferCount<span style="color: #000000;">(</span>int nXfers<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Negotiate with open Source the number of images application will accept.</span><br /><span style="color: #B900B9;">// nXfers = -1 means any number</span><br /><span style="color: #B900B9;">// Returns: 1 for success, 0 for failure.</span><br /><br />int EZTAPI TWAIN_NegotiatePixelTypes<span style="color: #000000;">(</span>unsigned wPixTypes<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Negotiate with the source to restrict pixel types that can be acquired.</span><br /><span style="color: #B900B9;">// This tries to restrict the source to a *set* of pixel types.</span><br /><span style="color: #B900B9;">// Returns: 1 for success, 0 for failure.</span><br /><span style="color: #B900B9;">// See TWAIN_AcquireNative for some mask constants.</span><br /><span style="color: #B900B9;">// A parameter of 0 (TWAIN_ANYTYPE) causes no negotiation & no restriction.</span><br /><span style="color: #B900B9;">// You should not assume that the source will honor your restrictions, even</span><br /><span style="color: #B900B9;">// if this call succeeds!</span><br /><br /><span style="color: #B900B9;">//----- Unit of Measure</span><br /><span style="color: #B900B9;">// TWAIN unit codes (from twain.h)</span><br /><span style="color: #00D7D7;">#define</span> TWUN_INCHES <span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> TWUN_CENTIMETERS <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> TWUN_PICAS <span style="color: #000000;">2</span><br /><span style="color: #00D7D7;">#define</span> TWUN_POINTS <span style="color: #000000;">3</span><br /><span style="color: #00D7D7;">#define</span> TWUN_TWIPS <span style="color: #000000;">4</span><br /><span style="color: #00D7D7;">#define</span> TWUN_PIXELS <span style="color: #000000;">5</span><br /><br />int EZTAPI TWAIN_GetCurrentUnits<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return the current unit of measure: inches, cm, pixels, etc.</span><br /><span style="color: #B900B9;">// Many TWAIN parameters such as resolution are set and returned</span><br /><span style="color: #B900B9;">// in the current unit of measure.</span><br /><span style="color: #B900B9;">// There is no error return - in case of error it returns 0 (TWUN_INCHES)</span><br /><br />int EZTAPI TWAIN_SetCurrentUnits<span style="color: #000000;">(</span>int nUnits<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Set the current unit of measure for the source.</span><br /><span style="color: #B900B9;">// Common unit codes are given above.</span><br /><span style="color: #B900B9;">// 1. Most sources do not support all units, some support *only* inches!</span><br /><span style="color: #B900B9;">// 2. If you want to get or set resolution in DPI, make sure the current</span><br /><span style="color: #B900B9;">// units are inches, or you might get Dots-Per-Centimeter!</span><br /><span style="color: #B900B9;">// 3. Similarly for ImageLayout, see below.</span><br /><br />int EZTAPI TWAIN_GetBitDepth<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Get the current bitdepth, which can depend on the current PixelType.</span><br /><span style="color: #B900B9;">// Bit depth is per color channel e.g. 24-bit RGB has bit depth 8.</span><br /><span style="color: #B900B9;">// If anything goes wrong, this function returns 0.</span><br /><br />int EZTAPI TWAIN_SetBitDepth<span style="color: #000000;">(</span>int nBits<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// (Try to) set the current bitdepth (for the current pixel type).</span><br /><span style="color: #B900B9;">// Note: You should set a PixelType, then set the bitdepth for that type.</span><br /><br /><span style="color: #B900B9;">//------- TWAIN Pixel Types (from twain.h)</span><br /><span style="color: #00D7D7;">#define</span> TWPT_BW <span style="color: #000000;">0</span> <span style="color: #B900B9;">/* Black and White */</span><br /><span style="color: #00D7D7;">#define</span> TWPT_GRAY <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> TWPT_RGB <span style="color: #000000;">2</span><br /><span style="color: #00D7D7;">#define</span> TWPT_PALETTE <span style="color: #000000;">3</span><br /><br />int EZTAPI TWAIN_GetPixelType<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Ask the source for the current pixel type.</span><br /><span style="color: #B900B9;">// If anything goes wrong (it shouldn't), this function returns 0 (TWPT_BW).</span><br /><br />int EZTAPI TWAIN_SetCurrentPixelType<span style="color: #000000;">(</span>int nPixType<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Try to set the current pixel type for acquisition.</span><br /><span style="color: #B900B9;">// The source may select this pixel type, but don't assume it will.</span><br /><br />double EZTAPI TWAIN_GetCurrentResolution<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Ask the source for the current (horizontal) resolution.</span><br /><span style="color: #B900B9;">// Resolution is in dots per current unit! (See TWAIN_GetCurrentUnits above)</span><br /><span style="color: #B900B9;">// If anything goes wrong (it shouldn't) this function returns 0.0</span><br /><br />double EZTAPI TWAIN_GetYResolution<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Returns the current vertical resolution, in dots per *current unit*.</span><br /><span style="color: #B900B9;">// In the event of failure, returns 0.0.</span><br /><br />int EZTAPI TWAIN_SetCurrentResolution<span style="color: #000000;">(</span>double dRes<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Try to set the current resolution (in both x & y).</span><br /><span style="color: #B900B9;">// Resolution is in dots per current unit! (See TWAIN_GetCurrentUnits above)</span><br /><span style="color: #B900B9;">// Note: The source may select this resolution, but don't assume it will.</span><br />int EZTAPI TWAIN_SetXResolution<span style="color: #000000;">(</span>double dxRes<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_SetYResolution<span style="color: #000000;">(</span>double dyRes<span style="color: #000000;">)</span>;<br /><br />int EZTAPI TWAIN_SetContrast<span style="color: #000000;">(</span>double dCon<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Try to set the current contrast for acquisition.</span><br /><span style="color: #B900B9;">// The TWAIN standard *says* that the range for this cap is -1000 ... +1000</span><br /><br />int EZTAPI TWAIN_SetBrightness<span style="color: #000000;">(</span>double dBri<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Try to set the current brightness for acquisition.</span><br /><span style="color: #B900B9;">// The TWAIN standard *says* that the range for this cap is -1000 ... +1000</span><br /><br />int EZTAPI TWAIN_SetThreshold<span style="color: #000000;">(</span>double dThresh<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Try to set the threshold for black and white scanning.</span><br /><span style="color: #B900B9;">// Should only affect 1-bit scans i.e. PixelType == TWPT_BW.</span><br /><span style="color: #B900B9;">// The TWAIN default threshold value is 128.</span><br /><span style="color: #B900B9;">// After staring at the TWAIN 1.6 spec for a while, I imagine that it implies</span><br /><span style="color: #B900B9;">// that for 8-bit samples, values >= nThresh are thresholded to 1, others to 0.</span><br /><br />double EZTAPI TWAIN_GetCurrentThreshold<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Try to get and return the current value (MSG_GETCURRENT) of the</span><br /><span style="color: #B900B9;">// ICAP_THRESHOLD capability. If this fails for any reason, it</span><br /><span style="color: #B900B9;">// will return -1. *VERSIONS BEFORE 2.65 RETURNED 128.0*</span><br /><br />int EZTAPI TWAIN_SetXferMech<span style="color: #000000;">(</span>int mech<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_XferMech<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Try to set or get the transfer mode - one of the following:</span><br /><span style="color: #00D7D7;">#define</span> XFERMECH_NATIVE <span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> XFERMECH_FILE <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> XFERMECH_MEMORY <span style="color: #000000;">2</span><br /><span style="color: #B900B9;">// You should not need to set this mode directly - using</span><br /><span style="color: #B900B9;">// TWAIN_Acquire, TWAIN_AcquireNative and TWAIN_AcquireFile will set</span><br /><span style="color: #B900B9;">// the appropriate transfer mode for you.</span><br /><br />int EZTAPI TWAIN_SupportsFileXfer<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Returns TRUE(1) if the open DS claims to support file transfer mode (XFERMECH_FILE)</span><br /><span style="color: #B900B9;">// This mode is optional. If TRUE, you can use AcquireFile.</span><br /><br />int EZTAPI TWAIN_SetPaperSize<span style="color: #000000;">(</span>int nPaper<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// See TWSS_* in TWAIN.H </span><br /><span style="color: #00D7D7;">#define</span> PAPER_A4LETTER <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> PAPER_B5LETTER <span style="color: #000000;">2</span><br /><span style="color: #00D7D7;">#define</span> PAPER_USLETTER <span style="color: #000000;">3</span><br /><span style="color: #00D7D7;">#define</span> PAPER_USLEGAL <span style="color: #000000;">4</span><br /><span style="color: #00D7D7;">#define</span> PAPER_A5 <span style="color: #000000;">5</span><br /><span style="color: #00D7D7;">#define</span> PAPER_B4 <span style="color: #000000;">6</span><br /><span style="color: #00D7D7;">#define</span> PAPER_B6 <span style="color: #000000;">7</span><br /><span style="color: #00D7D7;">#define</span> PAPER_USLEDGER <span style="color: #000000;">9</span><br /><span style="color: #00D7D7;">#define</span> PAPER_USEXECUTIVE <span style="color: #000000;">10</span><br /><span style="color: #00D7D7;">#define</span> PAPER_A3 <span style="color: #000000;">11</span><br /><span style="color: #00D7D7;">#define</span> PAPER_B3 <span style="color: #000000;">12</span><br /><span style="color: #00D7D7;">#define</span> PAPER_A6 <span style="color: #000000;">13</span><br /><span style="color: #00D7D7;">#define</span> PAPER_C4 <span style="color: #000000;">14</span><br /><span style="color: #00D7D7;">#define</span> PAPER_C5 <span style="color: #000000;">15</span><br /><span style="color: #00D7D7;">#define</span> PAPER_C6 <span style="color: #000000;">16</span><br /><br /><span style="color: #B900B9;">//-------- Document Feeder -------</span><br /><br />BOOL EZTAPI TWAIN_HasFeeder<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return TRUE(1) if the source indicates it has a document feeder.</span><br /><span style="color: #B900B9;">// Note: A FALSE(0) is returned if the source does not handle this inquiry.</span><br /><br />BOOL EZTAPI TWAIN_IsFeederSelected<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return TRUE(1) if the document feeder is selected.</span><br /><br />int EZTAPI TWAIN_SelectFeeder<span style="color: #000000;">(</span>int fYes<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// (Try to) select or deselect the document feeder.</span><br /><span style="color: #B900B9;">// Return TRUE(1) if successful, FALSE(0) otherwise.</span><br /><br />BOOL EZTAPI TWAIN_IsAutoFeedOn<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return TRUE(1) if automatic feeding is enabled, otherwise FALSE(0).</span><br /><span style="color: #B900B9;">// Make sure the feeder is selected before calling this function.</span><br /><br />int EZTAPI TWAIN_SetAutoFeed<span style="color: #000000;">(</span>int fYes<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// (Try to) turn on/off automatic feeding thru the feeder.</span><br /><span style="color: #B900B9;">// Return TRUE(1) if successful, FALSE(0) otherwise.</span><br /><span style="color: #B900B9;">// This function selects the feeder, so to start scanning</span><br /><span style="color: #B900B9;">// pages from an ADF, just do: TWAIN_SetAutoFeed(TRUE).</span><br /><br />BOOL EZTAPI TWAIN_IsFeederLoaded<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return TRUE(1) if there are documents in the feeder.</span><br /><span style="color: #B900B9;">// Make sure the feeder is selected before calling this function.</span><br /><br /><span style="color: #B900B9;">//-------- Duplex Scanning -------</span><br /><br />int EZTAPI TWAIN_GetDuplexSupport<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Query the device for duplex scanning support.</span><br /><span style="color: #B900B9;">// Return values:</span><br /><span style="color: #B900B9;">// 0 = no support (or error, or query not recognized)</span><br /><span style="color: #B900B9;">// 1 = 1-pass duplex</span><br /><span style="color: #B900B9;">// 2 = 2-pass duplex</span><br /><br />int EZTAPI TWAIN_EnableDuplex<span style="color: #000000;">(</span>int fYes<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Enable (fYes=1) or disable (fYes=0) duplex scanning.</span><br /><span style="color: #B900B9;">// Returns TRUE(1) if successful, FALSE(0) otherwise.</span><br /><br />BOOL EZTAPI TWAIN_IsDuplexEnabled<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Returns TRUE(1) if the device supports duplex scanning</span><br /><span style="color: #B900B9;">// and duplex scanning is enabled. FALSE(0) otherwise.</span><br /><br /><span style="color: #B900B9;">//--------- Other 'exotic' capabilities --------</span><br /><br />int EZTAPI TWAIN_HasControllableUI<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return 1 if source claims UI can be hidden (see SetHideUI above)</span><br /><span style="color: #B900B9;">// Return 0 if source says UI *cannot* be hidden</span><br /><span style="color: #B900B9;">// Return -1 if source (pre TWAIN 1.6) cannot answer the question.</span><br /><br />int EZTAPI TWAIN_SetIndicators<span style="color: #000000;">(</span>BOOL bVisible<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Tell the source to show (hide) progress indicators during acquisition.</span><br /><br />int EZTAPI TWAIN_Compression<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_SetCompression<span style="color: #000000;">(</span>int compression<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Set/Return compression style for transferred data</span><br /><br />BOOL EZTAPI TWAIN_Tiled<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_SetTiled<span style="color: #000000;">(</span>BOOL bTiled<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Set/Return whether source does memory xfer via strips or tiles.</span><br /><span style="color: #B900B9;">// bTiled = TRUE if it uses tiles for transfer.</span><br /><br />int EZTAPI TWAIN_PlanarChunky<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_SetPlanarChunky<span style="color: #000000;">(</span>int shape<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Set/Return current pixel shape (TWPC_CHUNKY or TWPC_PLANAR), or -1.</span><br /><br /><span style="color: #00D7D7;">#define</span> CHUNKY_PIXELS <span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> PLANAR_PIXELS <span style="color: #000000;">1</span><br /><br />int EZTAPI TWAIN_PixelFlavor<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_SetPixelFlavor<span style="color: #000000;">(</span>int flavor<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Set/Return pixel 'flavor' - whether 0 is black or white:</span><br /><br /><span style="color: #00D7D7;">#define</span> CHOCOLATE_PIXELS <span style="color: #000000;">0</span> <span style="color: #B900B9;">// zero pixel represents darkest shade</span><br /><span style="color: #00D7D7;">#define</span> VANILLA_PIXELS <span style="color: #000000;">1</span> <span style="color: #B900B9;">// zero pixel represents lightest shade</span><br /><br /><br />int EZTAPI TWAIN_SetLightPath<span style="color: #000000;">(</span>BOOL bTransmissive<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Tries to select transparent or reflective media on the open source.</span><br /><span style="color: #B900B9;">// A parameter of TRUE(1) means transparent, FALSE(0) means reflective.</span><br /><span style="color: #B900B9;">// A return of TRUE(1) implies success, FALSE(0) means that</span><br /><span style="color: #B900B9;">// the data source refused the request.</span><br /><br />int EZTAPI TWAIN_SetAutoBright<span style="color: #000000;">(</span>BOOL bOn<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_SetGamma<span style="color: #000000;">(</span>double dGamma<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_SetShadow<span style="color: #000000;">(</span>double d<span style="color: #000000;">)</span>; <span style="color: #B900B9;">// 0..255</span><br />int EZTAPI TWAIN_SetHighlight<span style="color: #000000;">(</span>double d<span style="color: #000000;">)</span>; <span style="color: #B900B9;">// 0..255</span><br /><br /><span style="color: #B900B9;">//--------- Image Layout (Region of Interest) --------</span><br /><br />int EZTAPI TWAIN_SetImageLayout<span style="color: #000000;">(</span>double L, double T, double R, double B<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Specify the area to scan, sometimes called the ROI (Region of Interest)</span><br /><span style="color: #B900B9;">// This call is only valid in State 4.</span><br /><span style="color: #B900B9;">// L, T, R, B = distance to left, top, right, and bottom edge of</span><br /><span style="color: #B900B9;">// area to scan, measured in the current unit of measure,</span><br /><span style="color: #B900B9;">// from the top-left corner of the 'original page' (TWAIN 1.6 8-22)</span><br /><br />int EZTAPI TWAIN_GetImageLayout<span style="color: #000000;">(</span>double *L, double *T, double *R, double *B<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_GetDefaultImageLayout<span style="color: #000000;">(</span>double *L, double *T, double *R, double *B<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Get the current or default (power-on) area to scan.</span><br /><span style="color: #B900B9;">// This call is valid in States 4-6.</span><br /><span style="color: #B900B9;">// 1 = success, 0 = failure. Supposedly the returned values (see above)</span><br /><span style="color: #B900B9;">// are in the current unit of measure (ICAP_UNITS), but I observe that</span><br /><span style="color: #B900B9;">// many DS's ignore ICAP_UNITS when dealing with Image Layout.</span><br /><br />int EZTAPI TWAIN_ResetImageLayout<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Reset the area to scan to the default (power-on) settings.</span><br /><span style="color: #B900B9;">// This call is only valid in State 4.</span><br /><span style="color: #B900B9;">// 1 = success, 0 = failure.</span><br /><br /><span style="color: #B900B9;">//--------- Fun With Containers --------</span><br /><br /><span style="color: #B900B9;">// Capability values are passed thru the TWAIN API in blocks of</span><br /><span style="color: #B900B9;">// global memory called 'containers'. EZTWAIN represents these</span><br /><span style="color: #B900B9;">// containers with a handle (an integer) called HCONTAINER.</span><br /><span style="color: #B900B9;">// The following functions provide reasonably comprehensive access</span><br /><span style="color: #B900B9;">// to the contents of containers. See also TWAIN_Get, TWAIN_Set.</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// There are four shapes of containers, which I call 'formats'.</span><br /><span style="color: #B900B9;">// Depending on its format, a container holds some 'items' - these</span><br /><span style="color: #B900B9;">// are simple data values, all the same type in a given container.</span><br /><br /><span style="color: #B900B9;">// Container formats, same codes as in TWAIN.H</span><br /><span style="color: #00D7D7;">#define</span> CONTAINER_ARRAY <span style="color: #000000;">3</span><br /><span style="color: #00D7D7;">#define</span> CONTAINER_ENUMERATION <span style="color: #000000;">4</span><br /><span style="color: #00D7D7;">#define</span> CONTAINER_ONEVALUE <span style="color: #000000;">5</span><br /><span style="color: #00D7D7;">#define</span> CONTAINER_RANGE <span style="color: #000000;">6</span><br /><br />typedef DWORD HCONTAINER;<br /><span style="color: #B900B9;">// If you are coding in VB or similar, this is a 32-bit integer.</span><br /><br />void EZTAPI CONTAINER_Free<span style="color: #000000;">(</span>HCONTAINER hcon<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Free the memory and resources of a capability container.</span><br /><br />HCONTAINER EZTAPI CONTAINER_Copy<span style="color: #000000;">(</span>HCONTAINER hcon<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Create an exact copy of the container.</span><br /><br />int EZTAPI CONTAINER_Format<span style="color: #000000;">(</span>HCONTAINER hcon<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return the 'format' of this container: CONTAINER_ONEVALUE, etc.</span><br /><br />int EZTAPI CONTAINER_ItemType<span style="color: #000000;">(</span>HCONTAINER hcon<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return the item type (what exact kind of values are in the container.)</span><br /><span style="color: #B900B9;">// See the TWTY_* definitions in TWAIN.H</span><br /><br />int EZTAPI CONTAINER_ItemCount<span style="color: #000000;">(</span>HCONTAINER hcon<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return the number of values in the container.</span><br /><span style="color: #B900B9;">// For a ONEVALUE, return 1.</span><br /><br />double EZTAPI CONTAINER_FloatValue<span style="color: #000000;">(</span>HCONTAINER hcon, int n<span style="color: #000000;">)</span>;<br />int EZTAPI CONTAINER_IntValue<span style="color: #000000;">(</span>HCONTAINER hcon, int n<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return the value of the nth item in the container.</span><br /><span style="color: #B900B9;">// n is forced into the range 0 to ItemCount(hcon)-1. </span><br /><br />BYTE* EZTAPI CONTAINER_ValuePtr<span style="color: #000000;">(</span>HCONTAINER hcon, int n<span style="color: #000000;">)</span>;<br /><br />int EZTAPI CONTAINER_ContainsValue<span style="color: #000000;">(</span>HCONTAINER hcon, double d<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return 1 (TRUE) if the value d is one of the items in the container.</span><br />int EZTAPI CONTAINER_FindValue<span style="color: #000000;">(</span>HCONTAINER hcon, double d<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return the index of the value d in the container, or -1 if not found.</span><br /><br />double EZTAPI CONTAINER_CurrentValue<span style="color: #000000;">(</span>HCONTAINER hcon<span style="color: #000000;">)</span>;<br />double EZTAPI CONTAINER_DefaultValue<span style="color: #000000;">(</span>HCONTAINER hcon<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return the container's current or power-up (default) value.</span><br /><span style="color: #B900B9;">// Array containers do not have these and will return -1.0.</span><br /><span style="color: #B900B9;">// OneValue containers always return their (one) value.</span><br /><br />int EZTAPI CONTAINER_DefaultIndex<span style="color: #000000;">(</span>HCONTAINER hcon<span style="color: #000000;">)</span>;<br />int EZTAPI CONTAINER_CurrentIndex<span style="color: #000000;">(</span>HCONTAINER hcon<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return the index of the Default or Current value, in an Enumeration.</span><br /><span style="color: #B900B9;">// Return -1 if the container is not an Enumeration.</span><br /><br />double EZTAPI CONTAINER_MinValue<span style="color: #000000;">(</span>HCONTAINER hcon<span style="color: #000000;">)</span>;<br />double EZTAPI CONTAINER_MaxValue<span style="color: #000000;">(</span>HCONTAINER hcon<span style="color: #000000;">)</span>;<br />double EZTAPI CONTAINER_StepSize<span style="color: #000000;">(</span>HCONTAINER hcon<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return the three parameters that define a Range container.</span><br /><span style="color: #B900B9;">// Returns -1.0 if the container is not a Range.</span><br /><br /><span style="color: #B900B9;">// The following four functions create containers from scratch:</span><br /><span style="color: #B900B9;">// nItemType is one of the TWTY_* item types from TWAIN.H</span><br /><span style="color: #B900B9;">// nItems is the number of items, in an array or enumeration.</span><br /><span style="color: #B900B9;">// dMin, dMax, dStep are the beginning, ending, and step value of a range.</span><br />HCONTAINER EZTAPI CONTAINER_OneValue<span style="color: #000000;">(</span>int nItemType, double dVal<span style="color: #000000;">)</span>;<br />HCONTAINER EZTAPI CONTAINER_Range<span style="color: #000000;">(</span>int nItemType, double dMin, double dMax, double dStep<span style="color: #000000;">)</span>;<br />HCONTAINER EZTAPI CONTAINER_Array<span style="color: #000000;">(</span>int nItemType, int nItems<span style="color: #000000;">)</span>;<br />HCONTAINER EZTAPI CONTAINER_Enumeration<span style="color: #000000;">(</span>int nItemType, int nItems<span style="color: #000000;">)</span>;<br /><br />int EZTAPI CONTAINER_SetItem<span style="color: #000000;">(</span>HCONTAINER hcon, int n, double dVal<span style="color: #000000;">)</span>;<br />int EZTAPI CONTAINER_SetItemString<span style="color: #000000;">(</span>HCONTAINER hcon, int n, LPCTSTR pzVal<span style="color: #000000;">)</span>;<br />int EZTAPI CONTAINER_SetItemFrame<span style="color: #000000;">(</span>HCONTAINER hcon, int n, double l, double t, double r, double b<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Set the nth item of the container to dVal or pzText, or frame(l,t,r,b).</span><br /><span style="color: #B900B9;">// NOTE: A OneValue is treated as an array with 1 element. </span><br /><span style="color: #B900B9;">// Return 1 (TRUE) if successful. 0 (FALSE) for failure:</span><br /><span style="color: #B900B9;">// The container is not an array, enumeration, or onevalue</span><br /><span style="color: #B900B9;">// n < 0 or n >= CONTAINER_ItemCount(hcon)</span><br /><span style="color: #B900B9;">// the value cannot be represented in this container's ItemType. </span><br /><br />int EZTAPI CONTAINER_SelectDefaultValue<span style="color: #000000;">(</span>HCONTAINER hcon, double dVal<span style="color: #000000;">)</span>;<br />int EZTAPI CONTAINER_SelectDefaultItem<span style="color: #000000;">(</span>HCONTAINER hcon, int n<span style="color: #000000;">)</span>;<br />int EZTAPI CONTAINER_SelectCurrentValue<span style="color: #000000;">(</span>HCONTAINER hcon, double dVal<span style="color: #000000;">)</span>;<br />int EZTAPI CONTAINER_SelectCurrentItem<span style="color: #000000;">(</span>HCONTAINER hcon, int n<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Select the current or default value within an enumeration or range,</span><br /><span style="color: #B900B9;">// by specifying either the value, or its index.</span><br /><span style="color: #B900B9;">// Returns 1 (TRUE) if successful, 0 (FALSE) otherwise.</span><br /><span style="color: #B900B9;">// This will fail if:</span><br /><span style="color: #B900B9;">// The container is not an enumeration or range.</span><br /><span style="color: #B900B9;">// dVal is not one of the values in the container</span><br /><span style="color: #B900B9;">// n < 0 or n >= CONTAINER_ItemCount(hcon)</span><br /><br />int EZTAPI CONTAINER_DeleteItem<span style="color: #000000;">(</span>HCONTAINER hcon, int n<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Delete the nth item from an Array or Enumeration container.</span><br /><span style="color: #B900B9;">// Returns 1 (TRUE) for success, 0 (FALSE) otherwise. Failure causes:</span><br /><span style="color: #B900B9;">// invalid container handle</span><br /><span style="color: #B900B9;">// container is not an array or enumeration</span><br /><span style="color: #B900B9;">// n < 0 or n >= ItemCount(hcon)</span><br /><br />int EZTAPI CONTAINER_InsertItem<span style="color: #000000;">(</span>HCONTAINER hcon, int n, double dVal<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Insert an item with value dVal into the container at position n.</span><br /><span style="color: #B900B9;">// If n = -1, the item is inserted at the end of the container.</span><br /><br /><span style="color: #B900B9;">//--------- Low-level Capability Negotiation Functions --------</span><br /><span style="color: #B900B9;">// Setting a capability is valid only in State 4 (TWAIN_SOURCE_OPEN)</span><br /><span style="color: #B900B9;">// Getting a capability is valid in State 4 or any higher state.</span><br /> <br />HCONTAINER EZTAPI TWAIN_Get<span style="color: #000000;">(</span>unsigned uCap<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Issue a DAT_CAPABILITY/MSG_GET to the open source.</span><br /><span style="color: #B900B9;">// Return a capability 'container' - the 'MSG_GET' value of the capability.</span><br /><span style="color: #B900B9;">// Use CONTAINER_* functions to examine and modify the container object.</span><br /><span style="color: #B900B9;">// Use CONTAINER_Free to release it when you are done with it.</span><br /><span style="color: #B900B9;">// A return value of 0 indicates failure: Call GetConditionCode</span><br /><span style="color: #B900B9;">// or ReportLastError above.</span><br /><br />HCONTAINER EZTAPI TWAIN_GetDefault<span style="color: #000000;">(</span>unsigned uCap<span style="color: #000000;">)</span>;<br />HCONTAINER EZTAPI TWAIN_GetCurrent<span style="color: #000000;">(</span>unsigned uCap<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Issue a DAT_CAPABILITY/MSG_GETDEFAULT or MSG_GETCURRENT. See Get above.</span><br /><br />int EZTAPI TWAIN_Set<span style="color: #000000;">(</span>unsigned uCap, HCONTAINER hcon<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Issue a DAT_CAPABILITY/MSG_SET to the open source,</span><br /><span style="color: #B900B9;">// using the specified capability and container.</span><br /><span style="color: #B900B9;">// Return value as for TWAIN_DS</span><br /><br />int EZTAPI TWAIN_Reset<span style="color: #000000;">(</span>unsigned uCap<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Issue a MSG_RESET on the specified capability.</span><br /><span style="color: #B900B9;">// State must be 4. Returns 1 (TRUE) if successful, 0 (FALSE) otherwise.</span><br /><br />BOOL EZTAPI TWAIN_GetCapBool<span style="color: #000000;">(</span>unsigned cap, BOOL bDefault<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Issue a DAT_CAPABILITY/MSG_GETCURRENT on the specified capability,</span><br /><span style="color: #B900B9;">// assuming the value type is TW_BOOL.</span><br /><span style="color: #B900B9;">// If successful, return the returned value. Otherwise return bDefault.</span><br /><span style="color: #B900B9;">// This is only valid in State 4 (TWAIN_SOURCE_OPEN) or higher.</span><br /><br />double EZTAPI TWAIN_GetCapFix32<span style="color: #000000;">(</span>unsigned cap, double dDefault<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_GetCapUint16<span style="color: #000000;">(</span>unsigned cap, int nDefault<span style="color: #000000;">)</span>;<br /><br />int EZTAPI TWAIN_SetCapFix32<span style="color: #000000;">(</span>unsigned Cap, double dVal<span style="color: #000000;">)</span>;<br />int EZTAPI TWAIN_SetCapOneValue<span style="color: #000000;">(</span>unsigned Cap,<br /> unsigned ItemType,<br /> long ItemVal<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Do a DAT_CAPABILITY/MSG_SET, on capability 'Cap' (e.g. ICAP_PIXELTYPE,</span><br /><span style="color: #B900B9;">// CAP_AUTOFEED, etc.) using a TW_ONEVALUE container with the given item type</span><br /><span style="color: #B900B9;">// and value. Use SetCapFix32 for capabilities that take a FIX32 value,</span><br /><span style="color: #B900B9;">// use SetCapOneValue for the various ints and uints. These functions</span><br /><span style="color: #B900B9;">// do not support FRAME or STR items.</span><br /><span style="color: #B900B9;">// Return Value: TRUE (1) if successful, FALSE (0) otherwise.</span><br />int EZTAPI TWAIN_SetCapFix32R<span style="color: #000000;">(</span>unsigned Cap, int Numerator, int Denominator<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Just like TWAIN_SetCapFix32, but uses the value Numerator/Denominator</span><br /><span style="color: #B900B9;">// This is useful for languages that make it hard to pass double parameters.</span><br /><br />int EZTAPI TWAIN_GetCapCurrent<span style="color: #000000;">(</span>unsigned Cap,<br /> unsigned ItemType,<br /> void FAR *pVal<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Do a DAT_CAPABILITY/MSG_GETCURRENT on capability 'Cap'.</span><br /><span style="color: #B900B9;">// Copy the current value out of the returned container into *pVal.</span><br /><span style="color: #B900B9;">// If the operation fails (the source refuses the request), or if the</span><br /><span style="color: #B900B9;">// container is not a ONEVALUE or ENUMERATION, or if the item type of the</span><br /><span style="color: #B900B9;">// returned container is incompatible with the expected TWTY_ type in nType,</span><br /><span style="color: #B900B9;">// returns FALSE. If this function returns FALSE, *pVal is not touched.</span><br /><br />long EZTAPI TWAIN_ToFix32<span style="color: #000000;">(</span>double d<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Convert a floating-point value to a 32-bit TW_FIX32 value that can be passed</span><br /><span style="color: #B900B9;">// to e.g. TWAIN_SetCapOneValue</span><br />long EZTAPI TWAIN_ToFix32R<span style="color: #000000;">(</span>int Numerator, int Denominator<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Convert a rational number to a 32-bit TW_FIX32 value.</span><br /><span style="color: #B900B9;">// Returns a TW_FIX32 value that approximates Numerator/Denominator</span><br /><br />double EZTAPI TWAIN_Fix32ToFloat<span style="color: #000000;">(</span>long nfix<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Convert a TW_FIX32 value (as returned from some capability inquiries)</span><br /><span style="color: #B900B9;">// to a double (floating point) value.</span><br /><br /><span style="color: #B900B9;">//--------- Lowest-level functions for TWAIN protocol --------</span><br /><br /><br />int EZTAPI TWAIN_DS<span style="color: #000000;">(</span>unsigned long <span style="color: #0000ff;">DG</span>, unsigned DAT, unsigned MSG, void FAR *pData<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Pass the triplet (DG, DAT, MSG, pData) to the open data source if any.</span><br /><span style="color: #B900B9;">// Returns 1 (TRUE) if the result code is TWRC_SUCCESS, 0 (FALSE) otherwise.</span><br /><span style="color: #B900B9;">// The last result code can be retrieved with TWAIN_GetResultCode(), and the</span><br /><span style="color: #B900B9;">// corresponding condition code can be retrieved with TWAIN_GetConditionCode().</span><br /><span style="color: #B900B9;">// If no source is open this call will fail, result code TWRC_FAILURE,</span><br /><span style="color: #B900B9;">// condition code TWCC_NODS.</span><br /><br />int EZTAPI TWAIN_Mgr<span style="color: #000000;">(</span>unsigned long <span style="color: #0000ff;">DG</span>, unsigned DAT, unsigned MSG, void FAR *pData<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Pass a triplet to the Data Source Manager (DSM).</span><br /><span style="color: #B900B9;">// Returns 1 (TRUE) for success, 0 (FALSE) otherwise.</span><br /><span style="color: #B900B9;">// See GetResultCode, GetConditionCode, and ReportLastError functions</span><br /><span style="color: #B900B9;">// for diagnosing and reporting a TWAIN_Mgr failure.</span><br /><span style="color: #B900B9;">// If the Source Manager is not open, this call fails setting result code</span><br /><span style="color: #B900B9;">// TWRC_FAILURE, and condition code=TWCC_SEQERROR (triplet out of sequence).</span><br /><br /><br /><span style="color: #B900B9;">//--------- Dosadi Special --------</span><br /><br />char* EZTAPI TWAIN_BuildName<span style="color: #000000;">(</span>void<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Return a string describing the build of EZTWAIN e.g. "Beta1 Debug"</span><br /><br />void EZTAPI TWAIN_GetBuildName<span style="color: #000000;">(</span>LPSTR psName<span style="color: #000000;">)</span>;<br /><br />int EZTAPI TWAIN_GetSourceIdentity<span style="color: #000000;">(</span>LPVOID ptwid<span style="color: #000000;">)</span>;<br /><br />void EZTAPI TWAIN_LogFile<span style="color: #000000;">(</span>int fLog<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Turn logging to c:\eztwain.log on or off.</span><br /><span style="color: #B900B9;">// fLog = 0 close log file and turn off logging</span><br /><span style="color: #B900B9;">// fLog != 0 open log file (if not already) and start logging</span><br /><br />int EZTAPI TWAIN_SelfTest<span style="color: #000000;">(</span>unsigned f<span style="color: #000000;">)</span>;<br /><span style="color: #B900B9;">// Perform internal self-test.</span><br /><span style="color: #B900B9;">// f ignored for now</span><br /><span style="color: #B900B9;">// Return value:</span><br /><span style="color: #B900B9;">// 0 success</span><br /><span style="color: #B900B9;">// other internal test failed.</span><br /><br /><span style="color: #B900B9;">// For use only by direct-linked applications:</span><br />int EZTWAIN_Attach<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;<br />int EZTWAIN_Detach<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;<br /><br />#ifdef __cplusplus<br /><span style="color: #000000;">}</span><br />#endif<br /><br />#endif<br /><br /><span style="color: #B900B9;">// History: See end of file eztwain.c</span></div>[/code:2mxwaiar] |
escanear documento... | gracias! |
escape key | I need a code example of how to detect use of the escape key to close a window/dialog. I either need to be able to disable the escape key, or need to perform an action when escape is pressed (same action as exit key on my dialogs) which will release a logical lock.
Thanks in advance (again and again)
G |
escape key | To prevent the user from exiting by using the Esc key:
ACTIVATE DIALOG oDlg;
VALID !GETKEYSTATE( VK_ESCAPE )
Or something like this:
By having a variable like :
local lClose := .F.
DEFINE DIALOG.....
DEFINE BUTTON..........ACTION (Any_Action(), lClose := .T., oDlg:End())
Some more code here.................
ACTIVATE DIALOG..... VALID lClose
If you do not do lClose := .T. you can never close the dialog the normal way. oDlg:End() when lClose == .F. does nothing. |
escoger una fila del listbox | Buenas noches
estoy tratando de ontener el numero de la fila que doy doble click
estoy probando este codigo
[code=fw:2egqvimk]<div class="fw" id="{CB}" style="font-family: monospace;"> oSelf:<span style="color: #000000;">oLbx1</span>:<span style="color: #000000;">connect</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"itemDoubleClicked(QListWidgetItem*)"</span> , <span style="color: #000000;">{</span>|p,p1| <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span>valtype<span style="color: #000000;">(</span>p<span style="color: #000000;">)</span><span style="color: #000000;">)</span>, <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span>p1<span style="color: #000000;">)</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> </div>[/code:2egqvimk]
y me devuelve un objeto del tipo QListWidgetItem pero yo uiero que solo me devuelva el numero de la fila escogida es posible ?
gracias
Wilson |
escoger una fila del listbox | Wilson, prueba
[code=fw:kvsbgy9k]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> oObjList:<span style="color: #000000;">currentrow</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> </div>[/code:kvsbgy9k]
Tambien puedes probar
[code=fw:kvsbgy9k]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> oObjList:<span style="color: #000000;">row</span><span style="color: #000000;">(</span> oItem <span style="color: #000000;">)</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// en tu caso creo que el parametro oItem lo llamas p</span><br /> </div>[/code:kvsbgy9k]
Y, se me habia olvidado ponerte, por si lo necesitas
[code=fw:kvsbgy9k]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> oObjList:<span style="color: #000000;">currentItem</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #0000ff;">Text</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//oItem:Text()</span><br /><br /><span style="color: #B900B9;">// Por lo que, para lo que necesitas puedes usar en cualquier momento</span><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> oObjList:<span style="color: #000000;">row</span><span style="color: #000000;">(</span> oObjList:<span style="color: #000000;">currentItem</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /><br /> </div>[/code:kvsbgy9k] |
escoger una fila del listbox | Cristobal muchas gracias
funciona perfecto el primero los demas no los probé
saludos
Wilson |
escribir sobre imagen emf | Hola estoy tratando de imprir sobre un formato emf, siguiendo los pasos del ejemplo corel.prg , y en el preview me agranda mi imagen para hacerla encajar en un formato de hoja a4. Mi imagen es de 212mm x 204.6mm, intente hacer oPrn:setsize(212,204.6) pero no logro hacer que me respete el formato original.
Podrían orientarme al respecto. Gracias
. |
escribir sobre imagen emf | Hola, creo que tienes que crear un EMF tamño A4, es decir del tamaño del folio, aunque casi todo el dibujo esté en blanco. Yo hice un encabezado de informe tipo EMF con Corel Draw, y tuve que guardar el fichero entero tamaño folio, porque sino el encabezado salía gigantesco. El porqué no lo sé, a lo mejor hay solución, pero la desconozco.
Saludos |
escribir sobre imagen emf | Hola les cuento lo que hice para resolver la consulta anterior fue deformar la imagen (la alargue en el bmp + o menos un cm mas de largo)), y la puse en una imagen del largo de papel A4.
Ahora mi consulta es porque en una pc me imprime perfectamete según las coordenadas que le doy y puesto en otra pc no me las respeta. Leí los post sobre emf y no encontré una respuesta.
Eso lo necesito para hacer facturas pdf y me pareció que la mejor forma era utilizar una imagen en emf y escribir sobre ella. O en su defecto si me pueden ilustrar de como hacerlo. Hasta ahora imprimimos sobre papel y lo tendremos que hacer electrónicamente y necesito hacerlo para enviar las mismas por correo en formato pdf
Gracias |
escribir todo en minuscula | Hola amigos!!
Supongo que es una pregunta muy tonta.
Pero no sé como hacer para que un get convierta a minuscula todo el txto que escribo.
Es decir, lo mismo que hace PICTURE "@!" cuando le decimos que obligue a escribirlo a mayusculas, pero en este caso,
necesito que obligue a escribirlo todo en minuscula.
¿alguna idea?
<!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> |
escribir todo en minuscula | que lo escriba todo en mayuscula y luego lo conviertes a minusculas con lower(get), creo es asi el contrario de upper(), bueno espero te ayude
alejandro
venezuela |
escribir todo en minuscula | Hola
Tendria que crear un recurso Dialogo y en el EditBox para el Get poner Si en Minúscula y No en Mayúsculas
Saludos
Adhemar |
escribir todo en minuscula | Desde el editor de recurso!
Pues claro!! <!-- s:P --><img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz" /><!-- s:P -->
No se me habia ocurrido.
Graaaacias. <!-- s:mrgreen: --><img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green" /><!-- s:mrgreen: -->
funcionó perfectamente. |
esempio di stampa per i registratori di cassa | qualcuno ha un esempio di invio di una stampa per un registratore di cassa
io devo farlo per un modello di marca olivetti
grazie |
esempio per fare una foto ed inserirla nel campo get | avete un esempio per fare una foto con una webcam nel momento dell'inserimento del record e quindi salvarla in jpg e inserire il nome dela file esempio 0001.jpg nel get corrispondente?
Quale classe usare o meglio quale classe in xharbour funziona senza interuzioni ( ho visto che con capcature fatto tre o quattro foto mi dice che non c'è nessuna webcam installata)
grazie |
esempio per fare una foto ed inserirla nel campo get | fate finta che non vi ho scritto niente |
esempio per fare una foto ed inserirla nel campo get | Hai risolto o hai rinunciato?
EMG |
esempio per fare una foto ed inserirla nel campo get | Non ho risolto
1. ho linkato una funziona scatta_foto() ad un pulsante
2. nella funzione scatta_foto ho chiamato la tscan di carmona
la classe mi fa selezionare il source twain ma quando deve create la foto mi fa errore general failure Msg_opened
c'è qualcosa di funzionante in giro ?
devo far scattare una foto direttamente dal dialogo di inserimento : il cliente si siede davanti al computer e quindi l'operatore puo' fargli la foto quando inserisce il record
hai qualcosa di funzionante per caso ?
io ho acquistato una semplice webcam NOTE@acam ed ho installato i driver sul pc in win xp
da premettere che se uso la classe tvideo o tcapture dello stesso autore funziona egregiamente ma ma me inteessa fare una foto e non un video
saluti. |
esempio per fare una foto ed inserirla nel campo get | Non ne so niente, mi dispiace.
EMG |
esempio per fare una foto ed inserirla nel campo get | sui forum mi hanno risposto con questo prg ma a me non va
potresti provarlo tu per favore ( spero tu abbia una webcam) perchè a me fa errore
[code:2j6d5qlr]
#include "Fivewin.ch"
Static cWebCamDriver := "Microsoft WDM Image Capture"
Static _oWebcam_ := nil
************************************************************************
*
************************************************************************
Function WebCam(codart,xalias,ori)
Local oDlg_Cam, oImg,oWc,bton,oGet,cFich,lVale:=.F.,cFichero:=SPACE(254)
if codart=NIL
codart:="imap" + DTOS(date()) + strtran(time(),":")
end if
cFichero:="\" + codart + ".bmp"
cFich:= "\" + codart + ".bmp"
oWC:=tWebCamPhoto():New()
DEFINE DIALOG oDlg_Cam TITLE "Adquirir imagen del Producto via WebCam" FROM 0,0 TO 290,725 PIXEL
@ 5,180 IMAGE oImg OF oDlg_Cam SIZE 160,120 PIXEL ADJUST
@ 130,10 BUTTON "Capturar" OF oDlg_Cam SIZE 30,10 PIXEL ACTION oWc:Save(oImg,cFich)
@ 130,45 BUTTON "Aceptar" OF oDlg_Cam SIZE 30,10 PIXEL ACTION (oWc:Disconnect(),lVale:=.T.,oDlg_Cam:End())
@ 130,80 BUTTON "Cancelar" OF oDlg_Cam SIZE 30,10 PIXEL ACTION (oWc:Disconnect(),oDlg_Cam:End())
@ 132,180 SAY oSay PROMPT "Localizacion fichero " PIXEL
@ 130,230 GET oGet VAR cFich OF oDlg_Cam SIZE 110,10 PIXEL WHEN .F.
oImg:nProgress:=0
ACTIVATE DIALOG oDlg_Cam CENTER ON INIT;
(oWC:CreateWnd(oDlg_Cam,10,10,260,180),oWc:Connect())
if lVale
sele (xAlias)
replace (xalias)->foto with cFichero
&&ori:Refresh()
ori:setbmp(cFichero)
ori:refresh()
sysrefresh()
end if
return lVale
/**********************************************************
*
*
* Clase tWebCamPhoto (Sólo para FWH)
* Objetivo: Capturar fotos con una Webcam
*
* César E. Lozada, cesarlozada@hotmail.com
* Los Teques, Venezuela - 22/06/2003
*
*
***********************************************************/
#define WM_CAP_START WM_USER
#define WM_CAP_DRIVER_CONNECT WM_CAP_START + 10
#define WM_CAP_DRIVER_DISCONNECT WM_CAP_START + 11
#define WM_CAP_SET_PREVIEW WM_CAP_START + 50
#define WM_CAP_SET_PREVIEWRATE WM_CAP_START + 52
#define WM_CAP_SET_SCALE WM_CAP_START + 53
#define WM_CAP_EDIT_COPY WM_CAP_START + 30
#define WM_CAP_FILE_SAVEDIB WM_CAP_START + 25
#define WM_CAP_DLG_VIDEOFORMAT WM_CAP_START + 41
#define WM_CAP_DLG_VIDEOSOURCE WM_CAP_START + 42
#define WM_CAP_GET_STATUS WM_CAP_START + 54
*********************************************************
* EXIT Procedure WebcamDisconnect()
* Asegura la desconexión de la cámara.
*********************************************************
EXIT Procedure WebcamDisconnect()
if _oWebcam_<>nil
_oWebcam_:Disconnect()
_owebcam_:=nil
endif
return
****************************************************************************
CREATE CLASS tWebCamPhoto
DATA nFrameRate INIT 66 //Velocidad de actualización de la WebCam
DATA nJpgQuality INIT 75 //Calidad de los JPG
DATA hWnd //Handle de la centana de la imagen
DATA aDrivers //Drivers de captura disponibles
DATA nDriver //número del driver instalado + 1
DATA lConnected INIT .F. //¿Está conectada>
METHOD New(cDriver,lSelect) CONSTRUCTOR // Construye el objeto. cDriver es el nombre
// del driver a usar, recomendado guardar en ini.
// Si lSelect=.T. muestra la lista para escogerlo
METHOD CreateWnd(oWnd,nLeft,nTop,nWidth,nHeight,nStyle,cTitle)
// Crea la ventana para la cámara en oWnd.
METHOD Connect // Conecta la cámara
METHOD Disconnect // Desconecta la cámara
METHOD Clipboard(oImg) //Captura la imagen en clipboard. Opcionalmente
//actualiza a oImg con la imagen capturada
METHOD Save(oImg,cFile,nQuality) //Captura la imagen y guarda en archivo (BMP/JPG).
//Opcionalmente actualiza a oImg con la imagen capturada
METHOD Source() //Configura la fuente de la webcam
METHOD Format() //Configura el formato de la imagen
METHOD GetStatus() //Status de la imagen
METHOD Resize() //Redimensiona la ventana de la imagen
METHOD End() INLINE ::Disconnect() // Finaliza el objeto
ENDCLASS
*===========================================================================
METHOD New(cDriver,lSelect)
DEFAULT cDriver:=cWebCamDriver
DEFAULT lSelect:=.F.
::aDrivers:=WebCamList()
::nDriver:=aScan(::aDrivers,{|u| Upper(StrTran(cDriver,' '))==Upper(StrTran(u,' '))})
IF ::nDriver=0 .or. lSelect
::nDriver:=WebCamSelect(::nDriver,::aDrivers)
ENDIF
_oWebCam_:=Self
return Self
*===========================================================================
METHOD CreateWnd(oWnd,nTop,nLeft,nWidth,nHeight,nStyle,cTitle)
DEFAULT nTop:=0, nLeft:=0, nWidth:=160, nHeight:=120
DEFAULT nStyle:=nOr(WS_VISIBLE,WS_CHILD,WS_BORDER)
IF ::nDriver>0
::hWnd:=wCamCreaWnd(::aDrivers[::nDriver], nStyle,;
nLeft, nTop, nWidth, nHeight, oWnd:hWnd, 0)
ENDIF
return ::hWnd
*===========================================================================
METHOD Connect()
if ::hWnd<>nil
if SendMessage(::hWnd, WM_CAP_DRIVER_CONNECT, ::nDriver-1, 0)=1
cWebCamDriver:=::aDrivers[::nDriver]
SendMessage(::hWnd, WM_CAP_SET_SCALE, 1, 0)
SendMessage(::hWnd, WM_CAP_SET_PREVIEWRATE, ::nFrameRate, 0)
SendMessage(::hWnd, WM_CAP_SET_PREVIEW, 1, 0)
::lConnected:=.T.
::Resize()
else
::lConnected:=.F.
::hWnd:=nil
endif
endif
return ::lConnected
*===========================================================================
METHOD Disconnect
IF ::hWnd<>Nil .and. ::lConnected
if SendMessage(::hWnd, WM_CAP_DRIVER_DISCONNECT, 0, 0)=1
::lConnected:=.F.
_oWebCam_:=nil
endif
ENDIF
return nil
*===========================================================================
METHOD Clipboard(oImg)
Local lSucc:=.F.
if ::hWnd<>nil
lSucc:=(SendMessage(::hWnd, WM_CAP_EDIT_COPY, 0, 0)=1)
IF lSucc .and. oImg<>nil
oImg:LoadFromClipboard()
oImg:Refresh()
ENDIF
endif
return lSucc
*===========================================================================
METHOD Save(oImg,cFile,nQuality)
Local lSucc:=.F.
Local cFileExt:=Upper(cFileExt(cFile))
Local cFileName:=cFileNoExt(cFile)
Local cExec:='BMPtoJPG.EXE'
if ::hWnd<>nil
CursorWait()
IF (cFileExt=="JPG" .or. cFileExt=="JPEG")
IF ::Clipboard()
DEFAULT nQuality:=::nJpgQuality
::nJpgQuality:=Max(Min(Int(nQuality),100),10)
WaitRun(cExec+' -q'+LTrim(Str(::nJpgQuality,3,0))+' -c'+cFileName+' -o -s',0)
ENDIF
ELSEIF cFileExt=='BMP'
SendMessage(::hWnd, WM_CAP_FILE_SAVEDIB, 0, cFile)
ENDIF
CursorArrow()
SysRefresh()
IF !(lSucc:=File(cFile))
MsgAlert("No pudo crearse "+cFile,cdi:vTitulo)
ELSEIF oImg<>nil
oImg:LoadImage(nil,cFile)
oImg:Refresh()
ENDIF
endif
return lSucc
*===========================================================================
METHOD Source()
if ::hWnd<>nil .and. ::lConnected
SendMessage(::hWnd, WM_CAP_DLG_VIDEOSOURCE, 0, 0)
endif
return nil
*===========================================================================
METHOD Format()
if ::hWnd<>nil .and. ::lConnected
SendMessage(::hWnd, WM_CAP_DLG_VIDEOFORMAT, 0, 0)
::Resize()
endif
return nil
*===========================================================================
#include "Struct.ch"
METHOD GetStatus()
Local oPoint, oStatus, cBuffer
STRUCT oPoint
MEMBER X AS LONG
MEMBER Y AS LONG
ENDSTRUCT
STRUCT oStatus
MEMBER nWidth AS LONG // Width of the image
MEMBER nHeight AS LONG // Height of the image
MEMBER lLive AS LONG // Now Previewing video?
MEMBER lOverlay AS LONG // Now Overlaying video?
MEMBER lScale AS LONG // Scale image to client?
MEMBER oXYScroll AS STRING LEN 8 //AS POINTAPI // Scroll position
MEMBER lDefPalette AS LONG // Using default driver palette?
MEMBER lAudHardware AS LONG // Audio hardware present?
MEMBER lCapFile AS LONG // Does capture file exist?
MEMBER nCurVidFrm AS LONG // # of video frames cap'td
MEMBER nCurVidDropped AS LONG // # of video frames dropped
MEMBER nCurWavSamples AS LONG // # of wave samples cap'td
MEMBER nCurTimeEl AS LONG // Elapsed capture duration
MEMBER hPalCur AS LONG // Current palette in use
MEMBER lCapturing AS LONG // Capture in progress?
MEMBER nReturn AS LONG // Error value after any operation
MEMBER nVidAlloc AS LONG // Actual number of video buffers
MEMBER wAudAlloc AS LONG // Actual number of audio buffers
ENDSTRUCT
oPoint:x:=0; oPoint:y:=0
oStatus:oXYScroll:=oPoint:cBuffer
cBuffer:= oStatus:cBuffer
SendMessage(::hWnd, WM_CAP_GET_STATUS, Len(cBuffer), @cBuffer)
oStatus:cBuffer:= cBuffer
return oStatus
*===========================================================================
#define HWND_BOTTOM 1
#define SWP_NOMOVE 2
#define SWP_NOSIZE 1
#define SWP_NOZORDER 4
METHOD Resize()
Local oStatus
if ::hWnd<>nil .and. ::lConnected
SysRefresh()
oStatus := ::GetStatus()
SetWindowPos(::hWnd,HWND_BOTTOM,0,0,oStatus:nWidth,oStatus:nHeight,;
nOr(SWP_NOMOVE,SWP_NOZORDER ) )
SysRefresh()
endif
return nil
****************************************************************************
Function WebcamList()
Local aDrivers:={}, nDriver:=0
Local cName, cVersion, nLen:=255
DO WHILE .T.
cName:=space(nLen); cVersion:=space(nLen)
IF !wCamGetDrvDesc(nDriver, @cName, nLen, @cVersion, nLen)
EXIT
ENDIF
if chr(0)$cName
cName:=Left(cName,At(chr(0),cName)-1)
endif
if chr(0)$cVersion
cVersion:=Left(cVersion,At(chr(0),cVersion)-1)
endif
aAdd(aDrivers,cName)
nDriver++
ENDDO
return aDrivers
****************************************************************************
Function WebcamSelect(nDriver,aDrivers)
Local oDlg, oCbx
Local cDriver
Local lSelect:=.F.
DEFAULT nDriver:=0, aDrivers:=WebcamList()
IF Empty(aDrivers)
MsgAlert('No Webcams')
return 0
ELSE
cDriver:=aDrivers[Max(1,nDriver)]
DEFINE DIALOG oDlg FROM 0,0 to 6,40 TITLE "Seleccionar Webcam"
@ 0,0 COMBOBOX oCbx VAR cDriver OF oDlg ITEMS aDrivers;
SIZE 160,50 PIXEL
@ 1.5, 4 BUTTON "Seleccionar" OF oDlg SIZE 40,12;
ACTION (nDriver:=oCbx:nAt ,oDlg:End())
@ 1.5,16 BUTTON "Cancelar" OF oDlg SIZE 40,12;
ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED
ENDIF
return nDriver
****************************************************************************
Function WebCamVersion(nDriver)
Local cName, cVersion, nLen:=255
DEFAULT nDriver:=0
IF nDriver>0
cName:=space(nLen); cVersion:=space(nLen)
IF wCamGetDrvDesc(nDriver-1, @cName, nLen, @cVersion, nLen)
if chr(0)$cVersion
cVersion:=Left(cVersion,At(chr(0),cVersion)-1)
endif
ELSE
cVersion:=nil
ENDIF
ENDIF
return cVersion
****************************************************************************
DLL32 STATIC FUNCTION wCamGetDrvDesc;
(nDriver AS _INT,;
cName AS STRING,;
nName AS LONG,;
cVersion AS STRING,;
nVersion AS LONG) AS BOOL PASCAL;
FROM "capGetDriverDescriptionA" LIB "avicap32.dll"
************************************************************************
DLL32 STATIC FUNCTION wCamCreaWnd;
(cTitle AS STRING,;
nStyle AS LONG,;
x AS LONG, y AS LONG, nWidth AS LONG, nHeight AS LONG,;
hWndParent AS LONG, nID AS LONG) AS LONG PASCAL;
FROM "capCreateCaptureWindowA" LIB "avicap32.dll"
************************************************************************
[/code:2j6d5qlr] |
esempio per fare una foto ed inserirla nel campo get | No, non ho una webcam, mi dispiace.
EMG |
esempio per fare una foto ed inserirla nel campo get | non hai proprio modo di provare il codice ? |
esempio per fare una foto ed inserirla nel campo get | Senza webcam direi proprio di no.
EMG |
espacio entre lineas en COMBOBox | Hola.
Consulta, en un combobox duro y puro (no xbrowse) puedo darle un margen entre cada linea mas grande dle que tiene por defecto?
gracias. |
espacio entre lineas en COMBOBox | [code=fw:3biwrwcy]<div class="fw" id="{CB}" style="font-family: monospace;">@ r,c <span style="color: #0000ff;">COMBOBOX</span> .............. ITEMHEIGHT <nHeight></div>[/code:3biwrwcy] |
espacio entre lineas en COMBOBox | [quote="nageswaragunupudi":e7x8iyq6][code=fw:e7x8iyq6]<div class="fw" id="{CB}" style="font-family: monospace;">@ r,c <span style="color: #0000ff;">COMBOBOX</span> .............. ITEMHEIGHT <nHeight></div>[/code:e7x8iyq6][/quote:e7x8iyq6]
y ya que estamos para el listbox?
Grazie Mille |
espacio entre lineas en COMBOBox | as i can say you need enable Ownerdraw
[img:129mxwtt]https://i.postimg.cc/NF66p0GD/Combobox-Demo-Ownerdraw.jpg[/img:129mxwtt]
[code=fw:129mxwtt]<div class="fw" id="{CB}" style="font-family: monospace;"> oCombo_left := TComboBox<span style="color: #000000;">(</span><span style="color: #000000;">)</span> :<span style="color: #00C800;">new</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>,, acItem, <span style="color: #000000;">90</span>, <span style="color: #000000;">300</span>, oMain,,,, BFcolor, BGcolor, .T., oFontDefault,,,, .F., acBitmaps <span style="color: #000000;">)</span><br /> oCombo_left:<span style="color: #000000;">nDropWidth</span><span style="color: #000000;">(</span> <span style="color: #000000;">200</span> <span style="color: #000000;">)</span><br /> oCombo_left:<span style="color: #000000;">nItemHeight</span><span style="color: #000000;">(</span> <span style="color: #000000;">32</span> <span style="color: #000000;">)</span><br /> oCombo_left:<span style="color: #000000;">nSelectionHeight</span><span style="color: #000000;">(</span> <span style="color: #000000;">32</span> <span style="color: #000000;">)</span><br /> oCombo_left:<span style="color: #0000ff;">Select</span><span style="color: #000000;">(</span> DriveNumber<span style="color: #000000;">(</span> cStartLeft <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> oCombo_left:<span style="color: #000000;">bCloseUp</span> := <span style="color: #000000;">{</span> || Change2Drive<span style="color: #000000;">(</span> oCombo_left:<span style="color: #000000;">GetSelText</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCombo_left:<span style="color: #000000;">lIncSearch</span> := .T.<br /><br /> <span style="color: #B900B9;">// use Codeblock to call Method</span><br /> oCombo_left:<span style="color: #000000;">bOwnerDraw</span> := <span style="color: #000000;">{</span> | a, b, c, d | oExpl_Left:<span style="color: #000000;">DoMyComBo</span><span style="color: #000000;">(</span> a, b, c, d, @acItem, @acType, @acBitmaps, oCombo_left <span style="color: #000000;">)</span> <span style="color: #000000;">}</span></div>[/code:129mxwtt]
[code=fw:129mxwtt]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> DoMyComBo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> WinDir := GETENV<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Windir"</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> cPara := <span style="color: #ff0000;">""</span><br /><span style="color: #00C800;">LOCAL</span> cAlign := nOr<span style="color: #000000;">(</span> DT_LEFT, DT_NOPREFIX <span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> nIcoHandle := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">LOCAL</span> nSize := <span style="color: #000000;">32</span><br /><span style="color: #00C800;">LOCAL</span> ii, nCount, xPara<br /><span style="color: #00C800;">LOCAL</span> oSelf<br /><span style="color: #00C800;">LOCAL</span> nIdCtl<br /><span style="color: #00C800;">LOCAL</span> oStruc<br /><span style="color: #00C800;">LOCAL</span> nPointer<br /><span style="color: #00C800;">LOCAL</span> acItem, acType, cItemText, oObj<br /><span style="color: #00C800;">LOCAL</span> CtlType<br /><span style="color: #00C800;">LOCAL</span> CtlID<br /><span style="color: #00C800;">LOCAL</span> itemID<br /><span style="color: #00C800;">LOCAL</span> itemAction<br /><span style="color: #00C800;">LOCAL</span> itemState<br /><span style="color: #00C800;">LOCAL</span> hwndItem<br /><span style="color: #00C800;">LOCAL</span> hDC<br /><span style="color: #00C800;">LOCAL</span> aRect<br /><span style="color: #00C800;">LOCAL</span> nLeft<br /><span style="color: #00C800;">LOCAL</span> nTop<br /><span style="color: #00C800;">LOCAL</span> nRight<br /><span style="color: #00C800;">LOCAL</span> nBottom<br /><span style="color: #00C800;">LOCAL</span> itemData<br /><span style="color: #00C800;">LOCAL</span> cDLL<br /><span style="color: #00C800;">LOCAL</span> hModule<br /><span style="color: #00C800;">LOCAL</span> nResID<br /><span style="color: #00C800;">LOCAL</span> aBitmaps, hBitMap, acBitmaps<br /><span style="color: #00C800;">LOCAL</span> OldAt := - <span style="color: #000000;">1</span><br /><span style="color: #00C800;">LOCAL</span> BrushHiBack := CreateSolidBrush<span style="color: #000000;">(</span> BFcolor <span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> BrushSysColor := CreateSolidBrush<span style="color: #000000;">(</span> BGcolor <span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> aGrad := <span style="color: #000000;">{</span> ;<br /> <span style="color: #000000;">{</span> .<span style="color: #000000;">5</span>, BFcolor, BGcolor <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> .<span style="color: #000000;">6</span>, BGcolor, BFcolor <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> .<span style="color: #000000;">1</span>, BFcolor, BGcolor <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">}</span><br /><br /> nCount := PCOUNT<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">FOR</span> ii := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> nCount<br /> xPara := PValue<span style="color: #000000;">(</span> ii <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /> <span style="color: #00C800;">CASE</span> ii = <span style="color: #000000;">1</span><br /> oSelf := xPara<br /> <span style="color: #00C800;">CASE</span> ii = <span style="color: #000000;">2</span><br /> nIdCtl := xPara<br /> <span style="color: #00C800;">CASE</span> ii = <span style="color: #000000;">3</span><br /> oStruc := xPara<br /> <span style="color: #00C800;">CASE</span> ii = <span style="color: #000000;">4</span><br /> nPointer := xPara<br /> <span style="color: #00C800;">CASE</span> ii = <span style="color: #000000;">5</span><br /> acItem := xPara<br /> <span style="color: #00C800;">CASE</span> ii = <span style="color: #000000;">6</span><br /> acType := xPara<br /> <span style="color: #00C800;">CASE</span> ii = <span style="color: #000000;">7</span><br /> acBitmaps := xPara<br /> <span style="color: #00C800;">CASE</span> ii = <span style="color: #000000;">8</span><br /> oObj := xPara<br /> <span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">(</span> oObj <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> VALTYPE<span style="color: #000000;">(</span> oObj <span style="color: #000000;">)</span> = <span style="color: #ff0000;">"O"</span><br /> OldAt := oObj:<span style="color: #000000;">nAt</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDCASE</span><br /> <span style="color: #00C800;">NEXT</span><br /><br /> CtlType := oStruc:<span style="color: #000000;">CtlType</span><br /> CtlID := oStruc:<span style="color: #000000;">CtlID</span><br /> itemID := oStruc:<span style="color: #000000;">itemID</span><br /> itemAction := oStruc:<span style="color: #000000;">itemAction</span><br /> itemState := oStruc:<span style="color: #000000;">itemState</span><br /> hwndItem := oStruc:<span style="color: #000000;">hwndItem</span><br /> hDC := oStruc:<span style="color: #000000;">hDC</span><br /> aRect := oStruc:<span style="color: #000000;">aRect</span><br /> itemData := oStruc:<span style="color: #000000;">itemData</span><br /><br /> nTop := aRect<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /> nLeft := aRect<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span><br /> nBottom := aRect<span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span><br /> nRight := aRect<span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span><br /><br /> <span style="color: #00C800;">IF</span> CtlType = ODT_COMBOBOX .OR. CtlType = ODT_LISTBOX <span style="color: #B900B9;">// .AND. CtlID =</span><br /><br /> SetBkMode<span style="color: #000000;">(</span> hDC, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// TRANSPARENT =1 OPAQUE =2</span><br /><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /> <span style="color: #00C800;">CASE</span> itemAction = ODA_SELECT<br /> FillRect<span style="color: #000000;">(</span> hDC, aRect, BrushSysColor <span style="color: #000000;">)</span><br /> SetTextColor<span style="color: #000000;">(</span> hDC, BFcolor <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">CASE</span> itemAction = ODA_DRAWENTIRE<br /> <span style="color: #00C800;">IF</span> OldAt = itemID + <span style="color: #000000;">1</span> .AND. oObj:<span style="color: #000000;">IsOpen</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> OldAt = - <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">IF</span> BGColor = <span style="color: #000000;">256</span> * <span style="color: #000000;">256</span> * <span style="color: #000000;">256</span> - <span style="color: #000000;">1</span> <span style="color: #B900B9;">// 16777215</span><br /> <span style="color: #B900B9;">// Msginfo("white")</span><br /> FillRect<span style="color: #000000;">(</span> hDC, aRect, COLOR_MENUHILIGHT + <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> SetTextColor<span style="color: #000000;">(</span> hDC, GetSysColor<span style="color: #000000;">(</span> COLOR_MENU <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span><br /> GradientFill<span style="color: #000000;">(</span> hDC, aRect<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, aRect<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>, aRect<span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> - <span style="color: #000000;">1</span>, aRect<span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>, aGrad, .t. <span style="color: #000000;">)</span><br /> SetTextColor<span style="color: #000000;">(</span> hDC, BFcolor <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ELSE</span><br /> FillRect<span style="color: #000000;">(</span> hDC, aRect, BrushSysColor <span style="color: #000000;">)</span><br /> SetTextColor<span style="color: #000000;">(</span> hDC, BFcolor <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">CASE</span> itemAction = ODA_FOCUS<br /> <span style="color: #00C800;">IF</span> BGColor = <span style="color: #000000;">256</span> * <span style="color: #000000;">256</span> * <span style="color: #000000;">256</span> - <span style="color: #000000;">1</span> <span style="color: #B900B9;">// 16777215</span><br /> FillRect<span style="color: #000000;">(</span> hDC, aRect, COLOR_MENUHILIGHT + <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> SetTextColor<span style="color: #000000;">(</span> hDC, GetSysColor<span style="color: #000000;">(</span> COLOR_MENU <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span><br /> GradientFill<span style="color: #000000;">(</span> hDC, aRect<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, aRect<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>, aRect<span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> - <span style="color: #000000;">1</span>, aRect<span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>, aGrad, .t. <span style="color: #000000;">)</span><br /> SetTextColor<span style="color: #000000;">(</span> hDC, BFcolor <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">ENDCASE</span><br /><br /> <span style="color: #B900B9;">// use System Icon from DLL</span><br /> <span style="color: #00C800;">IF</span> lUse_IconEx = .T.<br /><br /> cDLL := WinDir + <span style="color: #ff0000;">"<span style="color: #000000;">\S</span>ystem32<span style="color: #000000;">\i</span>mageres.dll"</span><br /><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /> <span style="color: #00C800;">CASE</span> acType<span style="color: #000000;">[</span> itemID + <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = DRIVE_UNKNOWN<br /> nResID := <span style="color: #000000;">75</span><br /> <span style="color: #00C800;">CASE</span> acType<span style="color: #000000;">[</span> itemID + <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = DRIVE_NO_ROOT_DIR<br /> nResID := <span style="color: #000000;">32</span><br /><br /> <span style="color: #00C800;">CASE</span> acType<span style="color: #000000;">[</span> itemID + <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = DRIVE_REMOVABLE<br /> <span style="color: #00C800;">IF</span> <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span> acItem<span style="color: #000000;">[</span> itemID + <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> $ <span style="color: #ff0000;">"AB"</span><br /> nResID := <span style="color: #000000;">23</span><br /> <span style="color: #00C800;">ELSE</span><br /> cDLL := WinDir + <span style="color: #ff0000;">"<span style="color: #000000;">\S</span>ystem32<span style="color: #000000;">\D</span>DORes.dll"</span><br /> nResID := <span style="color: #000000;">2389</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">CASE</span> acType<span style="color: #000000;">[</span> itemID + <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = DRIVE_FIXED<br /> <span style="color: #00C800;">IF</span> <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span> acItem<span style="color: #000000;">[</span> itemID + <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> = <span style="color: #ff0000;">"C:"</span><br /> nResID := <span style="color: #000000;">36</span><br /> <span style="color: #00C800;">ELSE</span><br /> nResID := <span style="color: #000000;">32</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">CASE</span> acType<span style="color: #000000;">[</span> itemID + <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = DRIVE_REMOTE<br /> nResID := <span style="color: #000000;">33</span><br /> <span style="color: #00C800;">CASE</span> acType<span style="color: #000000;">[</span> itemID + <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = DRIVE_CDROM<br /> nResID := <span style="color: #000000;">30</span><br /> <span style="color: #00C800;">CASE</span> acType<span style="color: #000000;">[</span> itemID + <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = DRIVE_RAMDISK<br /> nResID := <span style="color: #000000;">34</span><br /><br /> <span style="color: #00C800;">ENDCASE</span><br /><br /> hModule := GetModuleHandle<span style="color: #000000;">(</span> cDLL <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> hModule == <span style="color: #000000;">0</span><br /> hModule := LoadLibrary<span style="color: #000000;">(</span> cDLL <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> nIcoHandle := LOADIMAGERESICON<span style="color: #000000;">(</span> hModule, nResID, <span style="color: #000000;">32</span> <span style="color: #000000;">)</span><br /><br /> DrawIconEx<span style="color: #000000;">(</span> hDC, ;<br /> nTop - <span style="color: #000000;">4</span>, ;<br /> nLeft, ;<br /> nIcoHandle, ;<br /> nSize, ;<br /> nSize, ;<br /> <span style="color: #000000;">0</span>, ; <span style="color: #B900B9;">// _In_ UINT istepIfAniCur,</span><br /> <span style="color: #000000;">0</span>, ; <span style="color: #B900B9;">// _In_opt_ HBRUSH hbrFlickerFreeDraw,</span><br /> nOr<span style="color: #000000;">(</span> DI_NORMAL <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// _In_ UINT diFlags</span><br /><br /> DestroyIcon<span style="color: #000000;">(</span> nIcoHandle <span style="color: #000000;">)</span><br /> FreeLibrary<span style="color: #000000;">(</span> hModule <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">ELSE</span> <span style="color: #B900B9;">// use Resource</span><br /><br /> aBitmaps := FW_ReadImage<span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span>, acBitmaps<span style="color: #000000;">[</span> itemID + <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, <span style="color: #000000;">{</span> nSize - <span style="color: #000000;">2</span>, nSize - <span style="color: #000000;">2</span> <span style="color: #000000;">}</span>, .F. <span style="color: #000000;">)</span><br /> hBitMap := aBitmaps<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /><br /> DrawBitmap<span style="color: #000000;">(</span> hDC, hBitMap, nTop + <span style="color: #000000;">3</span>, nLeft, nSize - <span style="color: #000000;">3</span>, nSize - <span style="color: #000000;">6</span> <span style="color: #000000;">)</span><br /><br /> PalBmpFree<span style="color: #000000;">(</span> aBitmaps <span style="color: #000000;">)</span><br /> DeleteObject<span style="color: #000000;">(</span> hBitMap <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> nLeft += <span style="color: #000000;">32</span> + <span style="color: #000000;">4</span><br /><br /> cItemText := acItem<span style="color: #000000;">[</span> itemID + <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /><br /> DrawText<span style="color: #000000;">(</span> hDC, ;<br /> cItemText, ;<br /> <span style="color: #000000;">{</span> nTop + <span style="color: #000000;">4</span>, nLeft, nBottom, nRight <span style="color: #000000;">}</span>, ;<br /> cAlign <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> DeleteObject<span style="color: #000000;">(</span> BrushHiBack <span style="color: #000000;">)</span><br /> DeleteObject<span style="color: #000000;">(</span> BrushSysColor <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> .T.<br /> </div>[/code:129mxwtt] |
espacio entre lineas en COMBOBox | [quote="goosfancito":1iia0rl6][quote="nageswaragunupudi":1iia0rl6][code=fw:1iia0rl6]<div class="fw" id="{CB}" style="font-family: monospace;">@ r,c <span style="color: #0000ff;">COMBOBOX</span> .............. ITEMHEIGHT <nHeight></div>[/code:1iia0rl6][/quote:1iia0rl6]
y ya que estamos para el listbox?
Grazie Mille[/quote:1iia0rl6]
You asked for combox, I answered for combobox.
Do you want for listbox? |
espacio entre lineas en COMBOBox | yes, in listbox too. gracias. |
esportare i dati di un xbrowse su excel | Ho provato ad utilizzare il metodo oBRW:toexcel() di xbrowse, ma ho notato che funziona solo se imposto tutte colonne di tipo "carattere".Se metto anche solo una colonna di tipo "numerico", ricevo questo errore in runtime:"Error Excel.Application:ACTIVESHEET:COLUMNS/0 S_OK: _STYLE" .Ho eseguito le mie prove con Excel 2007.E' normale sia così o si può risolvere?C'è un altro modo più funzionale per esportare i dati di un xbrowse su un foglio excel, in modo che venga correttamente mantenuto il tipo (carattere/numero/data) ?Grazie.MaxFWH 8.04 + XHARBOUR 1.1.0 |
esportare i dati di un xbrowse su excel | Potresti pilotare direttamente Excel via OLE.EMG |
esportare i dati di un xbrowse su excel | Ho provato la classe texcels ... ho modificato la riga 473da DEFAULT cFormat := "0"a DEFAULT cFormat := "#.##0,00"le celle di excel vengono definite correttamente 2 decimali e separatore di migliaia la trovi [url:2bz0iuxe]http://www.box.net/shared/lck9effuyn[/url:2bz0iuxe]CiaoStefano |
esportare i dati di un xbrowse su excel | A prima vista mi sembra ottima, la proverò senz'altro.Grazie per il suggerimento!ciao. |
estilo Windows 8 | Hola:
¿Sería posible que el menú, la ribbon bar, la msgbar, etc. soportaran el look windows 8?.
[url=http://imageshack.us/photo/my-images/13/windows8beta20110916165.png/:373d9u1y][img:373d9u1y]http://img13.imageshack.us/img13/8536/windows8beta20110916165.png[/img:373d9u1y][/url:373d9u1y]
Uploaded with [url=http://imageshack.us:373d9u1y]ImageShack.us[/url:373d9u1y]
Gracias. |
estilo Windows 8 | Lucas,
[quote:2ebnod4o]¿Sería posible que el menú, la ribbon bar, la msgbar, etc. soportaran el look windows 8?.[/quote:2ebnod4o]
Por favor intenta poner aqui un pantallazo de cada uno de esos elementos para que los veamos todos, gracias <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
estilo Windows 8 | Antonio,
Posteo el link de la iso de evaluación de Microsoft:
<!-- m --><a class="postlink" href="http://wdp.dlws.microsoft.com/WDPDL/9B8DFDFF736C5B1DBF956B89D8A9D4FD925DACD2/WindowsDeveloperPreview-32bit-English.iso">http://wdp.dlws.microsoft.com/WDPDL/9B8 ... nglish.iso</a><!-- m -->
Funciona con VMWare 8 y Virtual Box. |
esto es correcto?? | Hola a todos...
Vamos a ver.. Tengo dos tablas:
SELECT 0
USE (CURDIR()+"\temporal.dbf") new
temporal->( OrdSetFocus( "nomart+codart" ) )
INDEX ON codart+nomart TO temporal
Aliastemporal := Alias()
SELECT 0
USE (CURDIR()+"\precios.dbf") new
precios->(OrdSetFocus( "articulo+numero")) &&articulo es el codigo
INDEX ON articulo+numero TO precios
aliasPrecios:=ALIAS()
Entonces realizo una búsqueda sobre la tabla precios según un parámetro. Esta busqueda la realizo asi:
IF precios->(DbSeek(ALLTRIM(cod),.t.))
p:=precios->pvp
else
p:=0
endif
temporal->pvp:=p
Mi pregunta es bien sencilla:
precios->(DbSeek(ALLTRIM(cod),.t.)) ¿¿me posiciona en el registro de la tabla precios para el cual se cumpla la condicion de que sea igual a cod??. Porque supuestamente la tabla está indexada por el codigo (que es lo que representa la variable cod).. Pero me está devolviendo otro valor que no es el que le corresponde. Es como si los indices no estuvieran trabajando bien....
Hay que poner algun set?? He probado a poner el set softseek on (por probar) pero no hay ningún cambio...
Espero alguien me pueda aclarar esta duda..
Saludos y gracias.
Elías Torres. |
esto es correcto?? | Elías,
Prueba a hacer los INDEX ON ... antes de llamar a OrdSetFocus() |
esto es correcto?? | Hola Antonio...
Si pongo los index antes me da error.. ¿Como puedo hacer una búsqueda combinada?¿La puedo hacer con un seek?
Saludos.
Elías Torres. |
esto es correcto?? | Elías,
Del ejemplo samples\TestBrwS.prg:
USE ( CurDir() + "\Customer" ) VIA "DBFCDX"
INDEX ON Customer->Last TO ( CurDir() + "\LAST" )
Customer->( OrdSetFocus( "LAST" ) )
Customer->( DbGoTop() )
...
Customer->( DbSeek( cSearch, .t. ) ) |
esto es correcto?? | Veo que haces AllTrim En el seek, puede que ese sea el problema porque cuando indexas lo haces por el campo entero.
Cod=' 1'
En el indice tienes espacio+espacio+1
pero si buscas alltrim Cod, estas buscando 1 en la primera posicion.
No se si me explico. |
estoy adapntado mis app a MariaDB con FWH | Hola.
Veo que algunos usan RECORDSET, que diferencia existe con respecto al no uso de ello?
Alguien tiene un ejemplo del uso de como se plantea los select con maria db?
En mi APP hago esto con TDolphin
[code=fw:157519fl]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#define</span> CONTACTOS ;<br /><span style="color: #ff0000;">"SELECT "</span> + ;<br /><span style="color: #ff0000;">"a.id as c1, "</span> + ;<br /><span style="color: #ff0000;">"a.nombre as c2, "</span> + ;<br /><span style="color: #ff0000;">"a.domicilio as c3, "</span> + ;<br /><span style="color: #ff0000;">"a.telefono as c4, "</span> + ;<br /><span style="color: #ff0000;">"a.obs as c5 "</span> + ;<br /><span style="color: #ff0000;">"FROM tbcontactos a "</span> + ;<br /><span style="color: #ff0000;">"ORDER BY a.nombre"</span><br /><br /><span style="color: #0000ff;">DEFINE</span> QUERY ::<span style="color: #000000;">oQry</span> CONTACTOS<br /> </div>[/code:157519fl] |
estoy adapntado mis app a MariaDB con FWH | cSql := ;
"SELECT " + ;
"a.id as c1, " + ;
"a.nombre as c2, " + ;
"a.domicilio as c3, " + ;
"a.telefono as c4, " + ;
"a.obs as c5 " + ;
"FROM tbcontactos a " + ;
"ORDER BY a.nombre"
oQry := oCn:Query( cSql )
// OR
oRs := oCn:RowSet( cSql ) |
estructura de datos | Hola nuevamente a todos en el foro, Tengo un problema actualmente estoy trabajando en una aplicacion que tiene el siguiente segmento de programación. DEFINE STRUCT oServi STRUCT FIELD "nofactura" INIT 0 STRUCT FIELD "fecha" INIT Space(10) STRUCT FIELD "vendedor" INIT 0 STRUCT FIELD "marcav" INIT space(30) STRUCT FIELD "idplaca" INIT space(30) STRUCT FIELD "color" INIT space(30) STRUCT FIELD "obs" INIT space(100) STRUCT FIELD "agencia" INIT 0 STRUCT FIELD "serie" INIT space(2) END STRUCT Lo que me permite es trabajar una estructura de datos como si fuera una dbf por ejemplo oServicios := TMsTable():New( oDb, "ordenserv" ) cSql := "select no_factura,fecha,id_vendedor,marcav,id_placa,color,obs,id_agencia,serie from ordenserv where " cSql += "nit = '"+oBase:FieldGet(1)+"'" cSql += "order by fecha desc" if !oServicios:Open( cSql ) return( nil ) endif oServicios:GoTop:Read() While !oServicios:Eof() oServi:Blank() oServi:nofactura := oServicios:Fieldget(1) oServi:fecha := oServicios:Fieldget(2) oServi:vendedor := oServicios:Fieldget(3) oServi:marcav := oServicios:Fieldget(4) oServi:idplaca := oServicios:Fieldget(5) oServi:color := oServicios:Fieldget(6) oServi:obs := oServicios:Fieldget(7) oServi:agencia := oServicios:Fieldget( oServi:serie := oServicios:Fieldget(9) oServi:Insert() oServicios:Fetch() end oServi:GoTop() y siquiero modificar while !oServi:Eof() if oServi:noFactura = 12345 oServi:marcav := "Mazda" oServi:Save() endif oServi:Skip() End con esto lo que hago es llenra la estructura con una consulta, la cuestion es que quite varias librerias del archivo de compilacion hasta que encontre una libreria que es la que contiene esta clase para poder trabajar de esta forma, el problema es que no tengo los fuentes de esa libreria y necesito separar la aplicacion para otro segmento y no quiero compilar esta libreria. Alguien conoce esta forma de hacer estructuras? de antemano muy agradecidoAtentamente, Julio Ponce |
estructura de datos | Julio,xHarbour te proporciona soporte de estructuras, parecidas a las que usas. Aqui tienes un ejemplo:[code:2sm0muby]
#include "hbstruct.ch"
function Main()
local oServi
STRUCTURE oServi
MEMBER "nofactura" INIT 0
MEMBER "fecha" INIT Space(10)
MEMBER "vendedor" INIT 0
MEMBER "marcav" INIT space(30)
MEMBER "idplaca" INIT space(30)
MEMBER "color" INIT space(30)
MEMBER "obs" INIT space(100)
MEMBER "agencia" INIT 0
MEMBER "serie" INIT space(2)
ENDSTRUCTURE
MsgInfo( "ok" )
return nil
[/code:2sm0muby]
FWH tambien proporciona soporte de estructuras pero está orientado a construir estructuras para pasarlas como parámetros a funciones en C:
[code:2sm0muby]
#include "FiveWin.ch"
#include "struct.ch"
function Main()
local oStruct
STRUCT oRect
MEMBER nLeft AS LONG
MEMBER nTop AS LONG
MEMBER nRight AS LONG
MEMBER nBottom AS LONG
ENDSTRUCT
MsgInfo( oRect:ClassName() )
return nil
[/code:2sm0muby]De todas formas, como me comentastes, si necesitas que esas estructuras hagan más cosas, lo idóneo es que te construyas una Clase propia, salvo que encuentres los CH y PRGs que usabas. |
estructura de datos | Gracias solo con una consulta mas, me parece bien la idea de utilizar la estructura de xHarbour, pero como hago para insertar,modificar y recorrer la estructura.de Antemano muy agradecido[quote="Antonio Linares":12ordfym]Julio,
xHarbour te proporciona soporte de estructuras, parecidas a las que usas. Aqui tienes un ejemplo:
[code:12ordfym]
#include "hbstruct.ch"
function Main()
local oServi
STRUCTURE oServi
MEMBER "nofactura" INIT 0
MEMBER "fecha" INIT Space(10)
MEMBER "vendedor" INIT 0
MEMBER "marcav" INIT space(30)
MEMBER "idplaca" INIT space(30)
MEMBER "color" INIT space(30)
MEMBER "obs" INIT space(100)
MEMBER "agencia" INIT 0
MEMBER "serie" INIT space(2)
ENDSTRUCTURE
MsgInfo( "ok" )
return nil
[/code:12ordfym]
FWH tambien proporciona soporte de estructuras pero está orientado a construir estructuras para pasarlas como parámetros a funciones en C:
[code:12ordfym]
#include "FiveWin.ch"
#include "struct.ch"
function Main()
local oStruct
STRUCT oRect
MEMBER nLeft AS LONG
MEMBER nTop AS LONG
MEMBER nRight AS LONG
MEMBER nBottom AS LONG
ENDSTRUCT
MsgInfo( oRect:ClassName() )
return nil
[/code:12ordfym]
De todas formas, como me comentastes, si necesitas que esas estructuras hagan más cosas, lo idóneo es que te construyas una Clase propia, salvo que encuentres los CH y PRGs que usabas.[/quote:12ordfym] |
estructura de datos | Julio,Entiendo que cuando te refieres a "insertar,modificar y recorrer la estructura" de alguna forma tienes asociada esa estructura a una base de datos ó a un recordset de ADO, si ?Una estructura no tiene ninguna relación con una base de datos. Es una forma de organizar la información.Por eso te indico que lo idóneo es crearte la Clase que necesites en el caso de que no localices el código fuente que de la Clase que estás usando. Has podido encontrar "DEFINE STRUCT" en alguno de tus ficheros CH ? Tiene que estar ó no podrias compilarlo. Otra opción, como te indiqué, es que compiles con /p para que genere un fichero .ppo y dentro veamos en que se traduce ese comando. |
estructura de datos | Hola, esa clase de la que hablas se llama TArray, si gustas mandame un correo y te la hago llegar..Saludos |
estructura de datos | Hola no se quien sea el creador de esta clase, ni me acuerdo de donde la saque, asi que solo aclaro que no es mia..Saludos[url]<!-- m --><a class="postlink" href="http://www.4shared.com/file/64476829/2af9e5a5/TArray.html?dirPwdVerified=f7cf9d59">http://www.4shared.com/file/64476829/2a ... d=f7cf9d59</a><!-- m -->[/url] |
estructura de datos | With xHarbour you cann use HASH aDati := TAssociativeArray()aDati:c1 := "WWWW"aDati:c2 := "eeeeee" You cann simulate Scatter and gather of the record //-------------------------------------------------------------------------FUNCtion Scatter() Local aVars := {=>} LOcal nField := FCount() LOcal nX := 1 FOR nX := 1 TO nField aVars[FIELDNAME(nX)] := FieldGet(nX) NEXT RETURN aVarsFunction Gather(aVars) lOCAL Nx := 1 FOR Nx := 1 TO LEN(aVars) FieldPut(nX,aVArs[FIELDNAME(nX)] ) NEXT RETUrn TRUEMaurizio |
estructura de datos | Bueno, ya que ha aparecido, guardémosla bien para que no se pierda <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --><!-- w --><a class="postlink" href="http://www.fivetechsoft.com/files/utilities/tarray.rar">www.fivetechsoft.com/files/utilities/tarray.rar</a><!-- w --> |
estructura de datos | [quote:9stc1zo0]xHarbour te proporciona soporte de estructuras, parecidas a las que usas.[/quote:9stc1zo0]Olá Antonio. Added to Harbour (Adicionado ao Harbour ):2008-09-29 13:11 UTC-0300 Antonio Carlos Pantaglione<toninho@fwi.com.br> * contrib/xhb/common.mak * contrib/xhb/makefile + contrib/xhb/hbstruct.ch + contrib/xhb/hbstruct.prg + STRUCTURE / MEMBER / ENDSTRUCTURE supportRegards,Toninho. |
estructura de datos | Toninho,Bien! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->gracias, |
estructura de datos | Gracias Luis fernando,Esta clase tiene lo que necesito, y gracias tambien Antonio y por supuesto ya la tengo guardada para que no se pierda.Atentamente,Julio Rodrigo Ponce Hinestroza<!-- w --><a class="postlink" href="http://www.suproye.com">www.suproye.com</a><!-- w -->[quote="derpipu":t3jac34a]Hola no se quien sea el creador de esta clase, ni me acuerdo de donde la saque, asi que solo aclaro que no es mia..
Saludos
[url]
<!-- m --><a class="postlink" href="http://www.4shared.com/file/64476829/2af9e5a5/TArray.html?dirPwdVerified=f7cf9d59">http://www.4shared.com/file/64476829/2a ... d=f7cf9d59</a><!-- m -->
[/url][/quote:t3jac34a] |
estructura de datos | JPonce:Por ahí tambien existe una clase TPUblic(), Desconozco quien sea el autor aunque se mencionan varios nombres, OSCAR CHACON, RAY ISLAS, EDUARDO RIZZOLO, DANIEL ANDRADE, tal vez tambien te pueda servir.Saludos |
está marcada como crashed y debe ser reparada | buenas tardes.
Tengo un programa corriendo con mysql empotrado y resulta que se corto la electricidad (aparentemente)
y al abrir de nuevo el programa sale la leyenda
[quote:1hfe49ll]está marcada como crashed y debe ser reparada[/quote:1hfe49ll]
se lo puede reparar? de que forma se lo hace?
gracias. |
está marcada como crashed y debe ser reparada | prueba con esto:
[url:2p89r9wt]https://clouding.io/kb/error-mysql/[/url:2p89r9wt]
Saludos |
está marcada como crashed y debe ser reparada | el tema es que estoy como "empotrado" no tengo un servidor.
eso ya lo habia leido. |
está marcada como crashed y debe ser reparada | tengo una sola tabla con ese problema.
instale MARIADB y le tire esa tabla (tres archivos) a la carpeta DATA donde tengo una DB
ahora por lo menos veo los datos que es lo que me interesaba, al no tener DB relacionadas no tengo problemas,
ahora solo falta rescatar los datos y seguir depurando.
es un peligro.
Gracias. |
etiquetas a la evernote | Hola,
seguro que muchos de vosotros conoceis Evernote. Me gustaría saber si hay alguna manera con FWH de hacer algo parecido a las etiquetas de evernote web clipper, es decir que pueda escribir en un campo de texto y al dar intro que aparezca la etiqueta remarcada y con una x para poder borrarla. Algo como lo que muestro en la imagen.
[img:yor806t5]http://alanit.com/wordpress/wp-content/uploads/2013/11/evernotetags.png[/img:yor806t5]
Saludos,
José Luis |
etiquetas a la evernote | Hola,
creo que la clase TTagCloud puede ser un buen punto de partida. Iré informando de mis avances. Si alguien esta interesado en colaborar conmigo que me escriba un correo.
Saludos, |
etiquetas a la evernote | José Luis,
Me parece interesante el tema que planteas para lo siguiente: imagínate una ficha de clientes, productos, acreedores, etc...
Quedaría muy bien que en esa ficha el nombre, por ejemplo, pudiera quedar "remarcado" con un estilo a "lo" evernote. <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Quizá para lo que yo digo sea suficiente una simple modificacion en el método TGet:Paint(). De entrada no pondría la x para borrado y si estableceria dos o tres categorías de remarcado. Ejemplo: el nombre en la ficha tendria la maxima importancia, el tag importante, con marco y rojo (suave). Otro tag de menor importancia seria por ejemplo la poblacion, con marco mas fino y verde suave.
En el fondo todo esto es simplemente darle mas funcionalidad a la clase TGet en el momento del TGet:Paint(), cuando el objeto NO tiene el foco. <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Seria algo asi:
[code=fw:25o1ngq8]<div class="fw" id="{CB}" style="font-family: monospace;">oGet:<span style="color: #000000;">bLevelTag</span>:= <span style="color: #000000;">{</span>|| <span style="color: #000000;">1</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// Categoria del tag. 1, 2, 3. Es DINAMICO porque puede cambiar segun el valor del get o valor de otras variables.</span><br />oGet:<span style="color: #000000;">oFntLevelTag1</span>:= xxxxxx <span style="color: #B900B9;">// Font para cuando se aplique el tag 1</span><br />oGet:<span style="color: #000000;">nClrLevelTag1</span>:= CLR_xxxxxx <span style="color: #B900B9;">// Color para cuando se aplique el tag 1</span><br />oGet:<span style="color: #000000;">oFntLevelTag2</span>:= xxxxxx <span style="color: #B900B9;">// Font para cuando se aplique el tag 2</span><br />oGet:<span style="color: #000000;">nClrLevelTag2</span>:= CLR_xxxxxx <span style="color: #B900B9;">// Color para cuando se aplique el tag 2</span><br />oGet:<span style="color: #000000;">oFntLevelTag3</span>:= xxxxxx <span style="color: #B900B9;">// Font para cuando se aplique el tag 3</span><br />oGet:<span style="color: #000000;">nClrLevelTag3</span>:= CLR_xxxxxx <span style="color: #B900B9;">// Color para cuando se aplique el tag 3</span><br /> </div>[/code:25o1ngq8]
Quiza, en prevision de mayores funcionalidades y de no ensuciar mucho el codigo del TGet , se podria crear una clase auxiliar a la TGet que fuera una contenedora de propiedades para el tema este de los tags TTagProp que posibilitaria infinitos niveles de remarcado.
[code=fw:25o1ngq8]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">CLASS</span> TTagProp<br /> <span style="color: #00C800;">DATA</span> nLevel<br /> <span style="color: #00C800;">DATA</span> nClr<br /> <span style="color: #00C800;">DATA</span> oFnt<br />END <span style="color: #00C800;">CLASS</span><br /><br /><span style="color: #00C800;">CLASS</span> TGet<br /> <span style="color: #00C800;">DATA</span> bLevelTag<br /> <span style="color: #00C800;">METHOD</span> AddTag<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> aTail<span style="color: #000000;">(</span>aAadd<span style="color: #000000;">(</span>aTags, TTagProp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">DATA</span> aTags <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br />END <span style="color: #00C800;">CLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TGet<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />* Pinta <span style="color: #0000ff;">Get</span> con parametros del ::<span style="color: #000000;">aTags</span><span style="color: #000000;">[</span>Eval<span style="color: #000000;">(</span>::<span style="color: #000000;">bLevelTag</span><span style="color: #000000;">)</span><span style="color: #000000;">]</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br />* Y en el programa <br />oGet:= TGet<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span>.........<span style="color: #000000;">)</span><br /><span style="color: #B900B9;">// Aqui añadir tantos tags como niveles de importancia (o remark) queremos darle al TGet()</span><br />oTag:= oGet:<span style="color: #000000;">AddTag</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oTag:<span style="color: #000000;">nClr</span>:= CLR_RED<br />oTag:= oGet:<span style="color: #000000;">AddTag</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oTag:<span style="color: #000000;">nClr</span>:= CLR_BLUE</div>[/code:25o1ngq8]
En fin... espero haberme explicado. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Saludos |
etiquetas a la evernote | [quote="José Luis Sánchez":1mh5cg34]Hola,
creo que la clase TTagCloud puede ser un buen punto de partida. Iré informando de mis avances. Si alguien esta interesado en colaborar conmigo que me escriba un correo.
Saludos,[/quote:1mh5cg34]
Jose Luis
Crea un inicio en el camino para ver como quieres organizarlo
Cuenta conmigo en la medida que consideres |
euro symbol on treport class | How I can show the symbol euro into treport class ?
I try with "@€999,999.99" and "@E 999,999.99" with no result ok
sample :
COLUMN TITLE "Imp. Total" DATA IPE->PeImpTotal SIZE ::aWidth[i] FONT 1 PICTURE "@E 9,999,999.99"
any solution ? |
eval encadenados...? | Hola.
Tengo dos array:
[code=fw:35gewg2d]<div class="fw" id="{CB}" style="font-family: monospace;">a<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>:= <span style="color: #ff0000;">"A"</span><br />a<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:= <span style="color: #ff0000;">"x"</span><br /><br />b<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>:= <span style="color: #ff0000;">"d"</span><br />b<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:= <span style="color: #ff0000;">"a"</span><br />b<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>:=<span style="color: #ff0000;">"x"</span><br />b<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>:= <span style="color: #ff0000;">"A"</span></div>[/code:35gewg2d]
necesito saber en que posicion se encuentra cada item de "a" en "b"
Intente esto:
[code=fw:35gewg2d]<div class="fw" id="{CB}" style="font-family: monospace;">AEval<span style="color: #000000;">(</span> ::<span style="color: #000000;">aListaUsuarios</span>, <span style="color: #000000;">{</span> | a | IIf<span style="color: #000000;">(</span> AEval<span style="color: #000000;">(</span> ::<span style="color: #000000;">oGets</span><span style="color: #000000;">[</span> <span style="color: #000000;">10</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">aselections</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">{</span> | b | b == a<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> != <span style="color: #000000;">0</span>, <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> a<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> , <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span></div>[/code:35gewg2d]
pero... esta mal, me dice que la variable "a" esta fuera del alcance en el segundo bloque. |
eval encadenados...? | [code=fw:2yr33pwv]<div class="fw" id="{CB}" style="font-family: monospace;">aresult := <span style="color: #000000;">{</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span><br />AEval<span style="color: #000000;">(</span> a, <span style="color: #000000;">{</span> |c,i| aResult<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span> := AScan<span style="color: #000000;">(</span> b, c <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br />? aresult <span style="color: #B900B9;">// --> {4,3}</span></div>[/code:2yr33pwv] |
eval error | On mine class I create LButtonUp( nRow, nCol, nKeyFlags ) method to click a graphics .it make error on eval Error description: Error BASE/1004 Class: 'LOGICAL' has no exported method: EVAL[code:2viksb3y]
METHOD LButtonUp( nRow, nCol, nKeyFlags ) CLASS myclass
::lPressed := .f.
if ::lCaptured
::lCaptured := .f.
ReleaseCapture()
::Refresh(.f.)
if ::lButton
if ::bAction != nil
[b] Eval( ::bAction) /////////---> error why ???[/b] endif
::lOver := .f.
::Refresh(.f.)
endif
endif
return super: LButtonUp( nRow, nCol, nKeyFlags )[/code:2viksb3y]on the command of the control I write @ x,y myclass ... action msginfo("myclass")where is the error ? |
eval error | Silvio,::bAction contains a logical value instead of a codeblock <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
eval error | Right!baction is .t. or .f.but how i make to give to it to run an action , i ask to U this because i am in holydays 's home i not have with me my helps manual and the sources fwh class and I not remember how , perhaps today it is vey sunny day or i have confusion in my mind. I' m writing to U from beach with my htc tynt II wm6. |
eval error | Silvio,{ || .T. }? |
eval error | no i made it right .Now i resolve only on ch command i made an mistake..Now the class run ok ...thanks antonio. |
evaluar algo de harbour en c. | tengo una clase llamada tvlc, la cual tiene una data llamada bOnEvent de tipo codeblock
ese codeblock necesito pasarlo a c y que se evalue su contenido.
estoy muy confundido con esto ya que supera mis pocos conocimientos en c.
esto es lo que tengo el api de vlc, tiene un event manager, al cual se le debe indicar que
hacer bajo ciertas condiciones.
[code=fw:2fn37ev6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/*---------------------------------------------------------------------------------------------*/</span><br /><span style="color: #00C800;">CLASS</span> TVlc<br /><br /> <span style="color: #B900B9;">/*hidden datas and methods*/</span><br /> HIDDEN:<br /> <span style="color: #00C800;">DATA</span> bOnEvent<br /> <span style="color: #00C800;">DATA</span> hContainer<br /> <span style="color: #00C800;">DATA</span> pInstance, pMedia, pMediaPlayer, pEventManager, nStatus<br /> <span style="color: #00C800;">DATA</span> nVolumeStep <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">5</span><br /> <span style="color: #00C800;">DATA</span> nVolume <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">50</span><br /> <span style="color: #00C800;">DATA</span> nLen <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">DATA</span> nPos <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">DATA</span> nTime <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">DATA</span> cMediaFile <span style="color: #0000ff;">INIT</span> <span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">DATA</span> aMetaInfo<br />...<br /><br /><span style="color: #B900B9;">/*Play mediafile*/</span><br /><span style="color: #00C800;">METHOD</span> Play<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TVlc<br /><br /> <span style="color: #B900B9;">/*If paused, resume*/</span><br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">Status</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> == VLC_INPUT_STATE_PAUSED<br /> ::<span style="color: #00C800;">Pause</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span><br /> <span style="color: #B900B9;">/*Is playing, exit*/</span><br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">Status</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> == VLC_INPUT_STATE_PLAYING<br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> <span style="color: #00C800;">ELSE</span><br /> <span style="color: #B900B9;">/*If defines mediafile*/</span><br /> <span style="color: #00C800;">IF</span> !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cMediaFile</span> <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">/*Init info value*/</span><br /> ::<span style="color: #000000;">nLen</span> := <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nPos</span> := <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nTime</span> := <span style="color: #000000;">0</span><br /><br /> <span style="color: #B900B9;">/*clear metainfo*/</span><br /> ::<span style="color: #000000;">aMetaInfo</span> := <span style="color: #00C800;">NIL</span><br /><br /> <span style="color: #B900B9;">/*Exist vlc instance*/</span><br /> <span style="color: #00C800;">IF</span> !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">pInstance</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">/*Create media instance*/</span><br /> ::<span style="color: #000000;">pMedia</span> := VLC_CreateMedia<span style="color: #000000;">(</span> ::<span style="color: #000000;">pInstance</span>, ::<span style="color: #000000;">cMediaFile</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">pMedia</span> <span style="color: #000000;">)</span><br /> <br /> <span style="color: #B900B9;">/*if metainfo parse medifile and get metainfo*/</span><br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">lMetaInfo</span><br /> VLC_MediaParse<span style="color: #000000;">(</span> ::<span style="color: #000000;">pMedia</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">aMetaInfo</span> := VLC_MediaGetMeta<span style="color: #000000;">(</span> ::<span style="color: #000000;">pMedia</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #B900B9;">/*Create mediaplayer instance*/</span><br /> ::<span style="color: #000000;">pMediaPlayer</span> := VLC_CreateMediaPlayer<span style="color: #000000;">(</span> ::<span style="color: #000000;">pMedia</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">/*Exist mediaplayer instance*/</span><br /> <span style="color: #00C800;">IF</span> !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">pMediaPlayer</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">/*Relase media handle, not need*/</span><br /> VLC_MediaRelease<span style="color: #000000;">(</span> ::<span style="color: #000000;">pMedia</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">pMedia</span> := <span style="color: #00C800;">NIL</span><br /> <br /> <span style="color: #B900B9;">/*create event mediamanager*/</span><br /> ::<span style="color: #000000;">pEventManager</span> := VLC_EventManager<span style="color: #000000;">(</span> ::<span style="color: #000000;">pMediaPlayer</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">/*Define windows container for mediaplayer*/</span><br /> VLC_SetWindow<span style="color: #000000;">(</span> ::<span style="color: #000000;">pMediaPlayer</span>, ::<span style="color: #000000;">hContainer</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">/*Apply volume*/</span><br /> ::<span style="color: #000000;">Volume</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">nVolume</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">/*Play media*/</span><br /> ::<span style="color: #000000;">nStatus</span> := VLC_Play<span style="color: #000000;">(</span> ::<span style="color: #000000;">pMediaPlayer</span> <span style="color: #000000;">)</span><br /> </div>[/code:2fn37ev6]
[code=fw:2fn37ev6]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------*/</span><br /><span style="color: #B900B9;">/*<br />Get the Event Manager from which the media player send event.<br />return the event manager associated with p_mi (mediaplayer)<br />LIBVLC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *p_mi );<br />*/</span><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> VLC_EVENTMANAGER <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> libvlc_media_player_t *mediaplayer = <span style="color: #000000;">(</span>libvlc_media_player_t *<span style="color: #000000;">)</span> hb_parptr<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> mediaplayer <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> hb_retptr<span style="color: #000000;">(</span> <span style="color: #000000;">(</span>void *<span style="color: #000000;">)</span> libvlc_media_player_event_manager<span style="color: #000000;">(</span> mediaplayer <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #000000;">{</span><br /> hb_errRT_BASE<span style="color: #000000;">(</span> EG_ARG, <span style="color: #000000;">2020</span>, <span style="color: #00C800;">NULL</span>, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /><span style="color: #000000;">}</span><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> VLC_EVENTATTACH <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> libvlc_event_manager_t *eventmanager = <span style="color: #000000;">(</span>libvlc_event_manager_t *<span style="color: #000000;">)</span> hb_parptr<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> eventmanager <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> libvlc_event_attach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerMediaChanged , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_attach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerNothingSpecial , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_attach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerOpening , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_attach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerPlaying , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_attach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerPaused , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_attach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerStopped , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_attach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerEndReached , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_attach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerTimeChanged , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_attach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerPositionChanged, vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_attach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerPausableChanged, vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_attach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerMuted , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_attach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerUnmuted , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_attach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerAudioVolume , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_attach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerLengthChanged , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> VLC_EVENTDETCH <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> libvlc_event_manager_t *eventmanager = <span style="color: #000000;">(</span>libvlc_event_manager_t *<span style="color: #000000;">)</span> hb_parptr<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> eventmanager <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> libvlc_event_detach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerMediaChanged , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_detach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerNothingSpecial , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_detach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerOpening , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_detach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerPlaying , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_detach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerPaused , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_detach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerStopped , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_detach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerEndReached , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_detach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerTimeChanged , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_detach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerPositionChanged, vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_detach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerPausableChanged, vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_detach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerMuted , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_detach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerUnmuted , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_detach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerAudioVolume , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> libvlc_event_detach<span style="color: #000000;">(</span> eventmanager, libvlc_MediaPlayerLengthChanged , vlc_mycallback, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">/*---------------------------------------------------------------------*/</span><br /><br />void vlc_mycallback<span style="color: #000000;">(</span> const libvlc_event_t *event, void *param <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> <span style="color: #00C800;">switch</span> <span style="color: #000000;">(</span> event->type <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">case</span> libvlc_MediaPlayerMediaChanged:<br /> <span style="color: #00C800;">case</span> libvlc_MediaPlayerNothingSpecial:<br /> <span style="color: #00C800;">case</span> libvlc_MediaPlayerOpening:<br /> <span style="color: #00C800;">case</span> libvlc_MediaPlayerPlaying:<br /> <span style="color: #00C800;">case</span> libvlc_MediaPlayerPaused:<br /> <span style="color: #00C800;">case</span> libvlc_MediaPlayerStopped:<br /> <span style="color: #00C800;">case</span> libvlc_MediaPlayerEndReached:<br /> <span style="color: #00C800;">case</span> libvlc_MediaPlayerTimeChanged:<br /> <span style="color: #00C800;">case</span> libvlc_MediaPlayerPositionChanged:<br /> <span style="color: #00C800;">case</span> libvlc_MediaPlayerPausableChanged:<br /> <span style="color: #00C800;">case</span> libvlc_MediaPlayerMuted:<br /> <span style="color: #00C800;">case</span> libvlc_MediaPlayerUnmuted:<br /> <span style="color: #00C800;">case</span> libvlc_MediaPlayerAudioVolume:<br /> <span style="color: #00C800;">break</span>;<br /> <span style="color: #000000;">}</span><br /><span style="color: #000000;">}</span><br /> </div>[/code:2fn37ev6] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.