topic
stringlengths
1
63
text
stringlengths
1
577k
Closing Windows neatly
I answered 2. myself: wndMain():oWndClient:aWnd[1]:MAXIMIZE() (thanks to James Bott's 'bring window to the front')
Closing Windows neatly
Ollie, Better check if the table is already in use, and/or disable the menuitems and buttons to reopen a window meanwhile it is open
Closing Windows neatly
[quote="Ollie":342ast4i]I have a MDI application that opens different databases, say CLIENTS, SUPPLIERS and MANUFACTURERS. I open each as a MDICHILD. (I use resources, so I have a borderless dialog the same size of the MDICHILD) (as taught to be my Antonio Linares and fwh\samples\TestMdi4.prg ) 1. I want to prevent the user from opening the same table more than once, so I need to check before opening, if the window is defined - ISWINDOW() doesn't seem to be working - is it me? Is that correct way? Hi, I use tis code to check if window with the same title is already opened: for i := 1 to len(oWnd:oWndclient:aWnd) if 'MDICHILD'$oWnd:oWndclient:aWnd[i]:classname() jcaption:=alltrim(oWnd:oWndclient:aWnd[i]:cCaption) if jcaption==alltrim(newcaption) //Alreadyhave MDI child with this name oWnd:oWndclient:aWnd[i]:Setfocus() return endif endif next [/quote:342ast4i]
Closing Windows neatly
Thanks Taavi, I'll give it a try. Antonio - how can I be sure that the databases are closed no matter how the user closes the screen. E.g. If he presses the 'close' button, I check that the data is saved and that the tables are closed. If he presses the Child 'X' to close or the Application 'X' to close - the checks don't get done.
Closing Windows neatly
I use a static variable then when i come in i set the var in "9999" and later if try to in one more time i see if the var is set to NIL or <> NIL then when i finish restart de var to NIL ..... that's my way !!
Closing Windows neatly
I have a same problem I use this code: [code:y6u7hfhv] #command OPEN <&#40;db&#41;> ; &#91;VIA <rdd>&#93; ; &#91;ALIAS <a>&#93; ; &#91;<new&#58; NEW>&#93; ; &#91;<ex&#58; EXCLUSIVE>&#93; ; &#91;<sh&#58; SHARED>&#93; ; &#91;<ro&#58; READONLY>&#93; ; &#91;INDEX <&#40;index1&#41;> &#91;, <&#40;indexn&#41;>&#93;&#93; ; => if Select&#40; <&#40;db&#41;> &#41;==0 ; ; dbNetUseArea&#40; <&#46;new&#46;>, <rdd>, <&#40;db&#41;>, <&#40;a&#41;>, if&#40;<&#46;sh&#46;> &#46;or&#46; <&#46;ex&#46;>, !<&#46;ex&#46;>, NIL&#41;, <&#46;ro&#46;>, 0 &#41;&#91;; dbSetIndex&#40; <&#40;db&#41;> &#41;&#93;; ;else ; ; dbSelectArea&#40; <&#40;db&#41;> &#41; ; ;endif [/code:y6u7hfhv] In [b:y6u7hfhv]if Select( <(db)> )[/b:y6u7hfhv] you pass the table name and if is not in memory open or just select the open table. [code:y6u7hfhv] &#46;&#46;&#46; if Select&#40; "clients" &#41;==0 use CLIENTS shared new index &#46;&#46;&#46; else dbSelectArea&#40; "clients" &#41; endif &#46;&#46;&#46; [/code:y6u7hfhv]
Closing an Access Database ( ldb )- compact and repair
To All I have written a Compact and Repair Access database routine under program control however even though I have no active tables, recordsets, or connections open .. I can not seem to close the .Mdb Database and have Access remove the .Ldb. ( at this point I am the only user .. no other connections or network users present ) I do notice that when my program Quits, all resources, files and databases are closed and the Access .Ldb is removed. Is there a way under program control to release all Connections to an Access database so I can close the .Ldb ? Again, my program does not rely on any active connections but I pass the Ado connection string to open a recordset each time I wish to open a table. I would be most grateful If anyone knows how I can truly CLOSE a database ( under program control ) and make the .Ldb go away so I can run my Compact and Repair routine? Thanks Rick Lipkin
Closing an Access Database ( ldb )- compact and repair
Mr Rick If I remember right, you always open recordset with connection string each time. This is what I observed from your postings. That means if you open 5 record sets you have opened 5 independent connections to the MDB. When you close the recordset, you call oRs:Close(), but never close the connection explicitly. That means the connection is still active and open even after you closed recordset. That in turn means if you opened the same recordset 10 times and closed 10 times, there are still 10 independent active -connections open. If you adopt the approach of opening recordsets with connection strings, when u close the recordset, please oRs:Close() oRs:ActiveConnection:Close() OR Open connection once at the beginning, use the same connection object for all recordsets and finally close the connection object. Even after that wait for about 100 secs or so before assuming that you are totally detached from the mdb.
Closing an Access Database ( ldb )- compact and repair
[quote:k1qia0xj]Even after that wait for about 100 secs or so before assuming that you are totally detached from the mdb.[/quote:k1qia0xj] I assume this is to wait for the write cache to be written to disk. I know the COMMIT command is for DBF's but I wonder if it just forces the write cache for the entire app to be written? Maybe try it. Regards, James
Closing an Access Database ( ldb )- compact and repair
[quote="James Bott":2kt9ibgj][quote:2kt9ibgj]Even after that wait for about 100 secs or so before assuming that you are totally detached from the mdb.[/quote:2kt9ibgj] I assume this is to wait for the write cache to be written to disk. I know the COMMIT command is for DBF's but I wonder if it just forces the write cache for the entire app to be written? Maybe try it. Regards, James[/quote:2kt9ibgj] I advised it as matter of caution. In another posting, one of colleagues complained about similar issue regarding SqLite database. In that case, on the advice of EMG, we tried delay of 100 seconds and it worked.
Closing an Access Database ( ldb )- compact and repair
Here is some info by Microsoft: How to shut down a custom Access application remotely [url:khptd1ia]http&#58;//support&#46;microsoft&#46;com/kb/304408[/url:khptd1ia] The sample code is in VB but these are the commands I think you need: Application.Quit acQuitSaveAll I don't know how to translate them into ADO. Regards, James
Closing an Access Database ( ldb )- compact and repair
That is not ADO. That is a code inside Access Forms, to close the application. I mean the Access Aplication. In ADO we never open the Access Application.
Closing an Access Database ( ldb )- compact and repair
NageswaraRao, [quote="nageswaragunupudi":3r63rzlg]When you close the recordset, you call oRs:Close(), but never close the connection explicitly. That means the connection is still active and open even after you closed recordset.[/quote:3r63rzlg] As far as I know, oRs:Close() closes the related connection too. EMG
Closing an Access Database ( ldb )- compact and repair
Rao [quote:2jvskg15] If you adopt the approach of opening recordsets with connection strings, when u close the recordset, please oRs:Close() oRs:ActiveConnection:Close() [/quote:2jvskg15] I tested your above suggestion .. when I open my applications I open a security table ( just once ) and the .ldb was created .. I added the ActiveConnection:CLose() after the recordset close() and INDEED the .ldb went away. Now I am at a crossroads .. asking myself, what harm is there in leaving a ( single ) active connection open which is no different than opening a connection and passing it to each recordset as I need it ? My only concern ( as Rao mentions ) .. everytime I open a recordset does the number of connections continue to add up ?? or is a connection a ( single ) connection and once you open a recordset does the active connections keep increasing or is the same connection recycled with the next open recordset ? I am going to test my concerns shortly .. the only advantage in creating the ( on-demand ) connection ( just passing the connection 'string' ) each time I open a recordset is that I do not have to keep an active oCn and count on it to be active at any one time in my application ( potentially ) giving me an un-welcomed run-time surprise at any point when I open a new recordset. Don't know if there is any right or wrong answer here .. my only concern is what if any ramifications there are if the open connections continue to add up each time I open a new recordset and what harm ( pragmatically if any ) does that cause... or perhaps a licensing issue with the number of active connections if active connections are counted as concurrent licenses. In all my years in State government I never had a licensing issue with Sql Server with any of my applications. Rick Lipkin
Closing an Access Database ( ldb )- compact and repair
Rick, [quote="Rick Lipkin":19dyvhlb]I added the ActiveConnection:CLose() after the recordset close() and INDEED the .ldb went away.[/quote:19dyvhlb] I think the problem is the ownership of oRs variable. Try with a straghtforward code like this: [code=fw:19dyvhlb]<div class="fw" id="{CB}" style="font-family: monospace;">oRs = CREATEOBJECT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br /><br />oRs:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> ... <span style="color: #000000;">&#41;</span><br /><br />...<br /><br />oRs:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:19dyvhlb] You will see that LDB file is automatically closed and deleted. If you are using a browse, it is probably the browse itself that keeps the ownership of oRs variable preventing it to properly close. EMG
Closing an Access Database ( ldb )- compact and repair
Enrico I tried your suggestion with this code : [code=fw:3t3x9c17]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRsUser &nbsp;:= &nbsp;CREATEOBJECT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br /><br />*oRsUser := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />*oRsUser:<span style="color: #000000;">CursorType</span> &nbsp; &nbsp; := <span style="color: #000000;">1</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// opendkeyset</span><br />*oRsUser:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// local cache</span><br />*oRsUser:<span style="color: #000000;">LockType</span> &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">3</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// lockoportunistic</span><br /><br />cSQL := <span style="color: #ff0000;">"SELECT * From [Staff] Order by [Lname]"</span><br /><br /><span style="color: #00C800;">TRY</span><br />&nbsp; oRsUser:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span>cSQL,xConnect, <span style="color: #000000;">1</span>, <span style="color: #000000;">3</span> &nbsp;<span style="color: #000000;">&#41;</span> <br />CATCH oErr<br />&nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening Staff table"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /><br />...<br />...<br /><br />oRsUser:<span style="color: #000000;">CLose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp;</div>[/code:3t3x9c17] The .ldb was created .. but after the close() the .ldb remained <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> .. Do you see anything in the above code you would change ? .. xConnect is just the connection string. Thanks Rick
Closing an Access Database ( ldb )- compact and repair
Ok, as I said, the problem is the variable oRs ownership. Try the sample below: [code=fw:djgv9c92]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#define</span> adOpenForwardOnly <span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> adOpenKeyset &nbsp; &nbsp; &nbsp;<span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> adOpenDynamic &nbsp; &nbsp; <span style="color: #000000;">2</span><br /><span style="color: #00D7D7;">#define</span> adOpenStatic &nbsp; &nbsp; &nbsp;<span style="color: #000000;">3</span><br /><br /><span style="color: #00D7D7;">#define</span> adLockReadOnly &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> adLockPessimistic &nbsp; &nbsp; <span style="color: #000000;">2</span><br /><span style="color: #00D7D7;">#define</span> adLockOptimistic &nbsp; &nbsp; &nbsp;<span style="color: #000000;">3</span><br /><span style="color: #00D7D7;">#define</span> adLockBatchOptimistic <span style="color: #000000;">4</span><br /><br /><span style="color: #00D7D7;">#define</span> adUseNone &nbsp; <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> adUseServer <span style="color: #000000;">2</span><br /><span style="color: #00D7D7;">#define</span> adUseClient <span style="color: #000000;">3</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; INKEY<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> oRs := CREATEOBJECT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; oRs:<span style="color: #000000;">CursorLocation</span> = adUseClient<br /><br />&nbsp; &nbsp; oRs:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SELECT * FROM Clienti ORDER BY Cliente"</span>, <span style="color: #ff0000;">"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clienti.mdb"</span>, adOpenForwardOnly, adLockReadOnly <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">WHILE</span> !oRs:<span style="color: #000000;">EOF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; ? oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Cliente"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oRs:<span style="color: #000000;">MoveNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDDO</span><br /><br />&nbsp; &nbsp; oRs:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:djgv9c92] EMG
Closing an Access Database ( ldb )- compact and repair
Enrico Unfortunately modifying my code like yours had no effect on closing the .Ldb. The only difference in my connection string is that I have a password on my .mdb. Here is my code based on your suggestion. Rick Lipkin [code=fw:i8pgb2sj]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />xPROVIDER := <span style="color: #ff0000;">"Microsoft.Jet.OLEDB.4.0"</span><br />xSOURCE   := cDEFA+<span style="color: #ff0000;">"<span style="color: #000000;">\G</span>room.mdb"</span><br />xPASSWORD := <span style="color: #ff0000;">"xxxxxxxx"</span><br /><br />xCONNECT := <span style="color: #ff0000;">'Provider='</span>+xPROVIDER+<span style="color: #ff0000;">';Data Source='</span>+xSOURCE+<span style="color: #ff0000;">';Jet OLEDB:Database Password='</span>+xPASSWORD<br /><br />oRsUser  :=  CREATEOBJECT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br /><br />*oRsUser := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />*oRsUser:<span style="color: #000000;">CursorType</span>     := <span style="color: #000000;">1</span>        <span style="color: #B900B9;">// opendkeyset</span><br />oRsUser:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// local cache</span><br />*oRsUser:<span style="color: #000000;">LockType</span>       := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// lockoportunistic</span><br /><br />cSQL := <span style="color: #ff0000;">"SELECT * From [Staff] Order by [Lname]"</span><br /><br /><span style="color: #00C800;">TRY</span><br />  oRsUser:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span>cSQL,xConnect, <span style="color: #000000;">0</span>, <span style="color: #000000;">1</span>  <span style="color: #000000;">&#41;</span><br />CATCH oErr<br />  <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening Staff table"</span> <span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /><br /><span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Check ldb"</span> <span style="color: #000000;">&#41;</span><br />oRsUser:<span style="color: #000000;">CLose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Check Closed"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span>.f.<span style="color: #000000;">&#41;</span><br /> </div>[/code:i8pgb2sj]
Closing an Access Database ( ldb )- compact and repair
Rick, You didn't get the point. You must test the LDB when oRs has gone out of scope. Please, test my exact sample changing only the connection string and the query. EMG
Closing an Access Database ( ldb )- compact and repair
Rick, Is it the same problem that I had in this topic? I couldn't delete the file brcause it was not completely closed. [url:3a7cxtd1]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=26787[/url:3a7cxtd1]
Closing an Access Database ( ldb )- compact and repair
[quote="Enrico Maria Giordano":1sw9157w]Rick, You didn't get the point. You must test the LDB when oRs has gone out of scope. Please, test my exact sample changing only the connection string and the query. EMG[/quote:1sw9157w] I got your point. I am working on this. It also means "all references in the memory" to this recordset object should go out of scope. Right?
Closing an Access Database ( ldb )- compact and repair
Marc No, if I recall your issue was with SqlLite ?? not closing when you quit your app. This has to do with how a recordset is defined and created at runtime and as Enrico mentions the runtime scope of the recordset object. Two ways you can create a recordset is to Open() with the Sql statement and a connection string, OR a pre-opened global connection OBJECT. What I did not know is that when working with Ms Access .. the .ldb does not necessarily go away when you Close() a recordset specifically created with a connection string. So as you open and close many recordsets, you accumulate many 'active' connections. Where this came into focus for me was that I created a Repair and Compact utility for Ms Access ( .mdb ) and to work properly, the .ldb MUST be closed. I searched and searched for any possible recordsets I potentially did not Close() and found none.. so if there are no tables open .. why did the .ldb not go away ? I went back thru my code and 'found and replaced' all my Recordsets that opened with a connection string and replaced that string parameter with an active global connection object I created at the top of my program. NOW .. when I go to my 'repair and compact' routine .. all I have to do is close the global connection oCn:CLose() and the .ldb goes away... run my routine and re-establish the global connection oCn... and the application continues to run fine. Again .. this is all well and good as long as nothing happens to interrupt the global connection object. This has been an interesting learning experience .. Rick Lipkin
Closing an Access Database ( ldb )- compact and repair
[quote="Marc Vanzegbroeck":3i11p4po]Rick, Is it the same problem that I had in this topic? I couldn't delete the file brcause it was not completely closed. [url:3i11p4po]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=26787[/url:3i11p4po][/quote:3i11p4po] Mr Mark Unless we test with simplest possible code, we can not figure out whats going wrong and why. (Note: This is what one can learn from Mr. EMG's postings) Please see the code I am about to post now in the thread you referred above. We can erase the file without waiting after closing the connection.
Closing an Access Database ( ldb )- compact and repair
NageswaraRao, [quote="nageswaragunupudi":3eb42cqn]I got your point. I am working on this. It also means "all references in the memory" to this recordset object should go out of scope. Right?[/quote:3eb42cqn] Suppose so. EMG
Closing an Access Database ( ldb )- compact and repair
Mr EMG [quote:1t5pgp0t]Suppose so.[/quote:1t5pgp0t] It IS so. I am testing. After some preliminary tests, I can now confirm that in fact it is so. I get back to you with more details later, but broadly what is happening is this. After we open a recordset, we are not just doing simple operations and closing the recordset. We use the object in browses and various other places. As a result we are creating references to this recordset object in various modules and all of them are not going out of scope. But we are aware of only one variable oRs and even after oRs:Close() and oRs := nil, references to this recset object are remaining in different memory locations in the memory which we are not aware of. Because of this, ActiveConnection of this recordset is not getting closed. So, for now, it may be safer to close oRs:ActiveConnection also. I am now examining our libraries and see what we can do the relinquish all references to the object wherever needed
Closing an Access Database ( ldb )- compact and repair
NageswaraRao, [quote="nageswaragunupudi":2sa6jvzc]So, for now, it may be safer to close oRs:ActiveConnection also.[/quote:2sa6jvzc] I'm not so sure. If there is an active reference to oRs somewhere then closing the connection can cause errors elsewhere. EMG
Closing an Access Database ( ldb )- compact and repair
Mr Rick Using a single connection and closing the connection while exiting the application surely works well. But let us continue testing your former approach. After opening RecordSet you normally use it for browing. After you exit browse you write ----- oRs:Close() oRs := nil ------ Still oBrw:oRs continues to refer to this recordset object. Even after oBrw goes out of scope, the data oRs of oBrw (not any more visible to us) still contains the reference. So, after browsing please do this: =============== After browsing in a dialog: ACTIVATE DIALOG oBrw:oRs := nil oRs:Close() oRs := nil If you are browing in an MDICHILD: oWnd:bPostEnd := { || oBrw:oRs := nil, oRs:Close(), oRs := nil } ================ Now surely the ActiveConnection of the oRs also is closed. [b:5k1zfx0x]I have tested this before posting here.[/b:5k1zfx0x] I am modifying the xbrowse's Destroy() method to set oRs := nil. From the next release onwards xbrowse does not create any problem. Modifying the TDataRow class also. So, FWH library will not stand in your way to achieve closure of ActiveConnection when you close recset.
Closing an Access Database ( ldb )- compact and repair
NageswaraRao, [quote="nageswaragunupudi":ilpp68nu]So, after browsing please do this: =============== After browsing in a dialog: ACTIVATE DIALOG oBrw:oRs := nil oRs:Close() oRs := nil If you are browing in an MDICHILD: oWnd:bPostEnd := { || oBrw:oRs := nil, oRs:Close(), oRs := nil } ================ Now surely the ActiveConnection of the oRs also is closed.[/quote:ilpp68nu] Unfortunately, not. As I wrote in another thread, even ACTION clause can detach oRs and keep a reference to it alive. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> EMG
Closing an Access Database ( ldb )- compact and repair
Let us continue the discussion in the other thread
Closing another aplication
Hello In mine aplication , i use Memowrit("C:\TEMP\efkes.rtf",cText) Shellexecute(0 ,0 , "C:\TEMP\efkes.rtf" ,0 ,0 , 1) To edit a rtf-file When the rtf-file is not closed , and this commands are executed again with a different cText , the editor is activated with the old text file not the new Using findwnd from enrico , i continue with : ? "Attention , Wordpad.exe or winword.exe must be closed correctly" DO WHIL .T. hWnd := FINDWND( "EFKES.RTF" ) IF !EMPTY( hWnd ) ? "Temporary rtf-file is not closed : " + CRLF + GETWINDOWTEXT( hWnd ) ELSE EXIT END But , knowing the handle from the editor , can it be closed by FW ? In that case we don't need a looping Frank
Closing another aplication
If you mean the handle of the window then yes: [code:3mytwqum]#define WM_CLOSE 16 SENDMESSAGE&#40; hWnd, WM_CLOSE &#41; or POSTMESSAGE&#40; hWnd, WM_CLOSE &#41;[/code:3mytwqum] EMG
Closing another aplication
Enricio thank you very much , as always it works I hope i am not to late : congratulations to italy with welth cup !!! Frank
Cloud computer - www.coder.com (free!)
[url:7ap60e27]http&#58;//www&#46;coder&#46;com[/url:7ap60e27] [url:7ap60e27]https&#58;//ide&#46;coder&#46;com/[/url:7ap60e27] [url:7ap60e27]https&#58;//ide&#46;coder&#46;com/ssh[/url:7ap60e27]
Cloud server – WINDOWS 2016 SERVER - for our meeting is onli
Dear Antonio, the Cloud server – WINDOWS 2016 SERVER - for our meeting is online. I would like to ask you to install FIVEWIN. Then we others can prepare the samples and demos for the meeting Please install all the database servers and all what we need. Best regards, Otto
Cloud server – WINDOWS 2016 SERVER - for our meeting is onli
Dear Antonio, I added English and Spanish language. Best regards, Otto
Cloud server – WINDOWS 2016 SERVER - for our meeting is onli
I forgot to mention that you have to use RDP to connect. Best regards, Otto
Cloud server – WINDOWS 2016 SERVER - for our meeting is onli
TEAM NEWS Dear Otto, many thanks FWH is already installed and running best regards Antonio -------------------------------- FWH is already installed, same as Visual Studio Community 2017. Thats easy. But I need to use Nox for FiveTouch, or another Android emulator. --------------------------------- >>>>>>>> Let us go step by step If you first install FWH binaries and compilers, we can then upload our samples and build them for demonstration ---------------------------------- I need to install an Android emulator on it. Usually I install nox: <!-- m --><a class="postlink" href="https://bitbucket.org/fivetech/fivetouch-public-repository/downloads/nox_setup_v3.8.1.2_full_intl.exe">https://bitbucket.org/fivetech/fivetouc ... l_intl.exe</a><!-- m --> but it reports a german (?) message and can't install it. I guess it is related to the graphics card. I appreciate if you can check it from there, many thanks best regards Antonio ---------------------------------- This is a very good idea. I will start uploading data and ADS server I will use for demo purposes. ---------------------------------- I will take a full WINDOWS SERVER BACKUP first then install the right graphic card driver. At the moment we have Microsoft Standard Driver installed. This is a WINDOWS 2016 Server. I hope we find a Driver. Best regards, Otto
Cloud server – WINDOWS 2016 SERVER - for our meeting is onli
Dear Otto, Many thanks!
Cmbio fondo ventana principal
Tengo una aplicación, donde la ventana principal tiene un fondo. Me funciona correctamente y lo tengo definido de la manera mas clásica y sencilla: @ 1, 0 BITMAP oBmp FILE "fuengi.bmp" OF oWnd ; SIZE 800,495 ADJUST Necesito ahora cambiar el fondo de esta ventana, dependiendo del usuario que lo use.- Lo he intentado de varias maneras con UPDATE y REFRESH, pero no consigo echarlo andar. ¿Alguna idea? Un saludo Manuel
Cmbio fondo ventana principal
Manuel, Has probado a hacer oBmp:LoadBMP( cBmpFile ) ?
Cmbio fondo ventana principal
Antonio, Te explico mas detalladamente: STATIC oWnd static cTitle static cBitmap FUNCTION MAIN ...... cBitmap := "fuengi.bmp" ..... ACTIVATE WINDOW oWnd MAXIMIZED ; ON PAINT PAINTWIN(oWnd) /// /// una funcion para poner el BMP segun resolucion pantalla /// STATIC FUNC PAINTWIN(oWnd) LOCAL hDC := oWnd:hDC local hWnd := oWnd:hWnd local T:=GetClientRect(hWnd) memvar oBmp @ 01,00 BITMAP oBmp FILE cDir + cBitmap OF oWnd SIZE ; T[4],T3] ;ADJUST RETURN nil /// /// cuando cambio de propietario realizo lo siguiente // aqui es donde deberia cambiar el bitmap segun propie->LOGO /// pero no sale el nuevo bitmap // oBmp:LoadBmp (propie->LOGO) oBmp:REFRESH() oWnd:cTitle := propie->NOMBRE oWnd:Refresh() Un saludo y gracias Manuel
Cnexion WEB SERVICE
Buenas tardes Estoy desarrollando una aplicación que conecta con un Webservice de una aplicación de venta on-line. Hasta el momento he podido integrar todas las opciones que ofrece el servicio, pedidos realizados, empaquetado, etc. El problema me viene a la hora de solicitar la emisión de la etiqueta para el transporte, la cual una vez enviada la petición devuelve lo siguiente: [code=fw:3b52y9b8]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #000000;">&#123;</span><br />  <span style="color: #ff0000;">"id"</span>: <span style="color: #000000;">295208</span>,<br />  <span style="color: #ff0000;">"fileContents"</span>: <span style="color: #ff0000;">"JVBERi0xLjQKJdP0zOEKMSAwIG9iago8PAovQ3JlYX[...]"</span>,<br />  <span style="color: #ff0000;">"contentType"</span>: <span style="color: #ff0000;">"application/pdf"</span>,<br />  <span style="color: #ff0000;">"fileName"</span>: <span style="color: #ff0000;">"label_ASUS12_186934_295208_20180712082022.pdf"</span><br /><span style="color: #000000;">&#125;</span><br /> </div>[/code:3b52y9b8] Mi problema está en que no sé como puedo descargar el fichero PDF para la posterior impresión. Gracias
Cnexion WEB SERVICE
He creado una clase la cual llamo oApi donde oApi:oHttp:= CreateObject( 'MSXML2.ServerXMLHTTP.6.0' ) El código donde llamo a las etiquetas es [code=fw:34v8jfv4]<div class="fw" id="{CB}" style="font-family: monospace;"> <br />       cUrl:=cUrl1 + alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>oApi:<span style="color: #000000;">aTbr5</span><span style="color: #000000;">&#91;</span>x,<span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"/label"</span><br />       oApi:<span style="color: #000000;">oHttp</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"POST"</span> , cUrl, .F. <span style="color: #000000;">&#41;</span><br />       oApi:<span style="color: #000000;">oHttp</span>:<span style="color: #000000;">setRequestHeader</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Content-Type"</span>,<span style="color: #ff0000;">"application/json"</span><span style="color: #000000;">&#41;</span><br />        oApi:<span style="color: #000000;">oHttp</span>:<span style="color: #000000;">setRequestHeader</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Authorization"</span>, <span style="color: #ff0000;">"Bearer "</span> + oApi:<span style="color: #000000;">vToken</span><span style="color: #000000;">&#41;</span><br />        oApi:<span style="color: #000000;">oHttp</span>:<span style="color: #000000;">setRequestHeader</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"labelType"</span>, <span style="color: #ff0000;">"pdf"</span><span style="color: #000000;">&#41;</span> <br />        oApi:<span style="color: #000000;">oHttp</span>:<span style="color: #000000;">Send</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />        <span style="color: #00C800;">if</span> oApi:<span style="color: #000000;">oHttp</span>:<span style="color: #000000;">status</span> <> <span style="color: #000000;">200</span><br />            msg<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No se ha podido Generar la etiqueta"</span><br />        <span style="color: #00C800;">else</span> <br />            msg<span style="color: #000000;">&#40;</span>oApi:<span style="color: #000000;">oHttp</span>:<span style="color: #000000;">ResponseText</span><span style="color: #000000;">&#41;</span><br />        end <span style="color: #00C800;">if</span><br /> </div>[/code:34v8jfv4] la variable cUrl1 es la que contiene la URL Gracias por tu interes.
Cnexion WEB SERVICE
Holá, sin código, no és posible tener como ayudar. Post el código, porfa. Gracias, saludos.
Cnexion WEB SERVICE
Mira se ayuda: [url:z6jhch4z]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=39458[/url:z6jhch4z] Saludos.
Cnexion WEB SERVICE
Según lo que yo entiendo el pdf viene en el nodo fileContents codificado en base64 { "id": 295208, "fileContents": "JVBERi0xLjQKJdP0zOEKMSAwIG9iago8PAovQ3JlYX[...]", "contentType": "application/pdf", "fileName": "label_ASUS12_186934_295208_20180712082022.pdf" } Yo lo recuperaría de la siguiente manera: [code=fw:21vaag9x]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />hRespuesta  := hash<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />hb_jsondecode<span style="color: #000000;">&#40;</span>response ,@hRespuesta  <span style="color: #000000;">&#41;</span><br />fPdf := hb_base64decode<span style="color: #000000;">&#40;</span>hRespuesta<span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"fileContents"</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:21vaag9x]
Cnexion WEB SERVICE
Gracias por vuestra colaboración. Ya me funciona perfectamente hb_base64decode no me funcionaba (supongo que por la libreria o la versión), pero gracias al foro he encontrado y usado la función Base64ToStr. [code=fw:1287c9pq]<div class="fw" id="{CB}" style="font-family: monospace;"><br />            vRet:=fCrea_array<span style="color: #000000;">&#40;</span>alltrim<span style="color: #000000;">&#40;</span>oApi:<span style="color: #000000;">oHttp</span>:<span style="color: #000000;">ResponseText</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />            cPdf:=Base64ToStr_1<span style="color: #000000;">&#40;</span> vRet<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />            handle:=fCreate<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"z:<span style="color: #000000;">\p</span>rueba.pdf"</span><span style="color: #000000;">&#41;</span><br />            fwrite<span style="color: #000000;">&#40;</span>handle,cPdf<span style="color: #000000;">&#41;</span><br />            fclose<span style="color: #000000;">&#40;</span>handle<span style="color: #000000;">&#41;</span><br /> </div>[/code:1287c9pq] Un Saludo
Code 128 - Error extraño.
Hola estoy imprimiendo codigos de barras usando en code 128 de la siguietne manera : vcodigobarras:=alltrim(transform((cbloque)->numero,"999999"))+"-"+; alltrim(transform((cbloque)->churro,"99"))+"-"+; (alltrim(transform(year((cbloque)->fecha),"9999"))) y lo imprimo asi : @ 4,1.5 cm_code128 vcodigobarras of oPrn SIZE 2 vertical MODE "A" El problema que tenia es que cierto codigo de barras el lector no me los leia y lo cambie a : @ 4,1.5 cm_code128 vcodigobarras of oPrn SIZE 2 vertical MODE "B" Pero ahora codigo que si me leia con la opción "A" no me los lee con la opción "B". EJEMPLO : 1167-11-2011 LO LEE CON LA OPCION "A" Y NO CON LA OPCION "B" ¿Alguna sugerencia?
Code 128 - Error extraño.
Como veo que a nadie le ha pasado algo parecido. Que Codigo de barras me recomendais usar, pensado que no puede ser muy largo, el code Code3_9 lo he probado pero se me hacer muy largo para imprimir en etiquetas, puesto se sale de la etiqueta y teniendo en cuenta que lo tengo que separar en tres partes ej, 1167-11-2011, incluso puede ser 1-1-2012 (dentro de poco), puesto que cada valor me sirve para buscar y hacer otras operaciones. Necesito la ayuda de vosotros, porque estoy un poco estancado. Gracias.
Code 128 - Error extraño.
Al final he optado por el codabar, porque aunque tenga que poner un codigo comienzo y otro de terminar creo que funcinara correctamente y el tamaño se ajusta perfectamente al que necesito. Lo comento por si a alguien le sirve. Saludos y gracias.
Code Bar PDF417 ó QR Code
Saludos amigos, Alguna forma de imprimir o generar códigos PDF417 o QR Code
Code Bar PDF417 ó QR Code
Hay alguna solucion para poder imprimir en PDF417
Code Bar PDF417 ó QR Code
Hola, En harbour en las contrib hay una libreria para los pdf417 Atte., Lautaro Moreira
Code Bar PDF417 ó QR Code
Lautaro, cual es esa libreria yo uso xHarbour y no me importaria tratar de pasarla a xharbour, pdf417 no es lo mismo que pdf, El pdf417 es un tipo de codigo de barras tridimensional
Code Bar PDF417 ó QR Code
Pablo, Tengo claro que el pdf417 es un codigo de barras bidimensional. Ya me toco darme un round con ese codigo de barras. <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> La libreria es hbzebra y esta en las contrib de harbour. Saludos, Lautaro Moreira
Code Bar PDF417 ó QR Code
Gracias <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Pero estube buscando en las contribuciones de harbour y no esta ? a ver si me la puedes mandar a pabloalbertovidal arroba gmail punto com
Code Bar PDF417 ó QR Code
Hola Lautaro Gracias por la respuesta Tienes un pequeño ejemplo para verlo, agradeceria tu apoyo nuevamente
Code Bar PDF417 ó QR Code
[quote="pablovidal":2d51r6pu]Gracias <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Pero estube buscando en las contribuciones de harbour y no esta ? a ver si me la puedes mandar a pabloalbertovidal arroba gmail punto com[/quote:2d51r6pu] Pablo, elmoiquique El codigo si esta dentro de los fuentes de harbour, al parecer es muy facil usarlo busca en harbour\contrib\hbzebra\ hay que enlazar las librerias [url=http&#58;//www&#46;sitasoft&#46;net/fivewin/files/hbzebra&#46;lib:2d51r6pu]hbzebra.lib[/url:2d51r6pu] dejo el link del exe [url:2d51r6pu]http&#58;//www&#46;sitasoft&#46;net/fivewin/samples/barcode&#46;zip[/url:2d51r6pu] [code=fw:2d51r6pu]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oWnd<br /><br />   <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">window</span> oWnd<br />   <br />   <span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">window</span> oWnd;<br />            <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">paint</span><span style="color: #000000;">&#40;</span> BarCode<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> BarCode<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br />   <br />   <span style="color: #00C800;">local</span> hZebra<br />   <span style="color: #00C800;">local</span> cCode := <span style="color: #ff0000;">"testing from fivewin"</span><br />   <span style="color: #00C800;">local</span> hBrush := CreateSolidBrush<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br />   hZebra := hb_zebra_create_pdf417<span style="color: #000000;">&#40;</span> cCode, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /><br />   hb_zebra_draw<span style="color: #000000;">&#40;</span> hZebra, <span style="color: #000000;">&#123;</span>| x, y, w, h | FillRect<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">&#123;</span> y, x, y +  h, x + w <span style="color: #000000;">&#125;</span>, hBrush <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span><br />   <br />   deleteobject<span style="color: #000000;">&#40;</span> hBrush <span style="color: #000000;">&#41;</span><br />   hb_zebra_destroy<span style="color: #000000;">&#40;</span> hZebra <span style="color: #000000;">&#41;</span><br />   <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:2d51r6pu]
Code Bar PDF417 ó QR Code
Gracias Daniel, Una preguntita, esa lib que pusiste se podra enlazar con xharbour ?
Code Bar PDF417 ó QR Code
Pablo Es de Harbour <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> talves se podria buscar la conversion, pero para eso habria que sentarse un rato
Code Bar PDF417 ó QR Code
Gracias Daniel Por tu ayuda, es justo lo que necesitaba para mi desarrollo, pero no puedo encontrar las libreria de hbzebra que tu mencionas en harbour, yo tengo el harbour 2.0 y no estan Agradeceria tu ayuda o bien si me las puedes facilitar por email <!-- e --><a href="mailto:elmoceballos@gmail.com">elmoceballos@gmail.com</a><!-- e --> Agradecido por tu tiempo y ayuda gracias
Code Bar PDF417 ó QR Code
Saludos la libreria esta disponible para la descarga en el post anterior
Code Bar PDF417 ó QR Code
Daniel, una consulta como esta libreria es para harbour, intenete cambiar mi aplicacion para harbour y creo que no es el camino ya que tengo que hacer demasiados cambios, tu sabes quien hizo esta libreria o como se puede cambiar a xharbour que creo que es mas facil cambiar una libreria a xharbour que mas de una a harbour.. Ademas tu dices de sentarse un rato a cambiarla, yo podria sentarme hacer eso, ya que lo necesito urgente Agradeceria tu ayuda y guia para poder hacer esto,,,, NO se si Pablo lo habra hecho o si resolvio el problema de xharbour a harbour
Code Bar PDF417 ó QR Code
Saludos... [quote="elmoiquique":1do258ii]Ademas tu dices de sentarse un rato a cambiarla, yo podria sentarme hacer eso, ya que lo necesito urgente[/quote:1do258ii] descargate harbour desde el svn, alli encontraras los fuentes para cambiarlo solo bastaria con saber un poco de C y manejar el api de ambos compiladores mi correo es <!-- e --><a href="mailto:danielgarciagil@gmail.com">danielgarciagil@gmail.com</a><!-- e -->
Code Bar PDF417 ó QR Code
[quote="elmoiquique":1maguo8u]Ademas tu dices de sentarse un rato a cambiarla, yo podria sentarme hacer eso, ya que lo necesito urgente[/quote:1maguo8u] elmoiquique Si quieres entre los dos podriamos hacer los cambios, yo no se mucho de C ni del Api de (x)harbour, pero me interesaria tener la lib.-
Code Bar PDF417 ó QR Code
Ok, pablo no hay problemas, estamos casi igual, pero se aprende de a poco voy a bajar lo que me informa Daniel a Ver que me sale y te informo a ver si podemos terminar esta clase juntos, porque de verdad me sacaria bastante de apuro, ya que estoy con la soga al cuello para entregar el sistema de facturacion saludos y estamos en contacto
Code Bar PDF417 ó QR Code
Saludos Han empezado con esto? hay algun avance?
Code Bar PDF417 ó QR Code
???
Code Bar PDF417 ó QR Code
Estoy trabajando y tengo bastante avanzado,, una consulta existe alguna funcion o comando que me permita crear una imagen a partir de datos entregados, del programa solo me falta generar la imagen
Code Bar PDF417 ó QR Code
Bien... osea que ya lograste generar la lib para xHarbour??? de ser asi... postea un link de descarga o bien el codigo modificado <!-- s;-) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";-)" title="Wink" /><!-- s;-) -->
Code Bar PDF417 ó QR Code
Saludos [quote="Daniel Garcia-Gil":2cshjfu0]osea que ya lograste generar la lib para xHarbour??? de ser asi... postea un link de descarga o bien el codigo modificado [/quote:2cshjfu0] ???
Code Bar PDF417 ó QR Code
Hola Daniel Te cuento lo que tengo a ver si me puedes ayudar. Ya tengo el programa que genera los string del PDF417 para xharbour, pero hasta ahora solo he llegado hasta ahi, solo me falta convertirlo en imagen y en eso estado topando, ya que no he podico encontra una funcion que la cadena de string mela transforme en imagen, si yo pesco esa cadena de caracteres y la coloco en notepad me la codifica como necesito. Te envie un correo para que veas el programa y ver si me puedes ayudar o dar alguna idea saludos elmo
Code Bar PDF417 ó QR Code
Hola pablo Has hecho algo con respecto al codigo PDF417
Code Bar PDF417 ó QR Code
Saludos Mi intencion en preguntar tantas veces por este punto era solo saber si habia algun trabajo adelantado para no empezar la conversion y duplicar trabajo elmoiquique me envio un codigo el cual lo veo bastante complicado y solo genera un tipo de codigo (pdf417), entonces.. para que reinventar la rueda...? a consecuencia me motive a hacer al conversion del codigo de Harbour y portarlo a xHarbour, realmente pense que iba a ser mas complicado, al final salio bastante bien dejo el link con el codigo fuente modificado para usarlo en xHarbour, un ejemplo y una clase para manejar los codebar que usa la ZEBRA, EAN13, EAN8, UPCA, UPCE, CODE39, ITF, MSI, CODABAR, CODE93, CODE11, CODE128, PDF417, DATAMATRIX dicha clase crea un BITMAP con el codebar, vean el ejemplo... es solo un prototipo, cualquier mejora la pueden postear... para usarlo en Harbour solo usen la lib hbzebra.lib Recuerden estamos aqui para ayudarnos, no se guarden todo y compartan, es para el bienestar de la comunidad y tener herramientas mas solidas link de descarga [url:gcz4jyv0]http&#58;//www&#46;sitasoft&#46;net/fivewin/samples/zebra&#46;zip[/url:gcz4jyv0]
Code Bar PDF417 ó QR Code
Muchas Gracias Daniel
Code Bar PDF417 ó QR Code
Muy buen aporte, Daniel habia estado varios dias buscando la solucion a mi programa, y con tu ayuda he logrado lo que necesitaba... Gracias por compartir tus conocimientos saludos
Code Bar PDF417 ó QR Code
Buenos dias Daniel, o quien lo sepa: Este codigo es valido para imprimir en otra impresora que no sea la zebra?, por ejemplo cualquier laser.
Code Bar PDF417 ó QR Code
Daniel gracias por tu trabajo. Estoy intentando, con el codigo que tu has posteado, generar un exe autocontenido que pueda llamarse desde cualquier otro exe independientemente de las versiones con que hayan sido compilados. Pero mi problema es que para que esto funcione necesito grabar en disco el bmp generado. ¿podeis ayudarme en esta tarea?. ¿Como hago para grabar el bmp con el codigo de barras en el disco? ASI SE CREA EL BMP EN DISCO: hDib := DibFromBitmap( oCode:hCodeBar ) DibWrite( "barras.bmp", hDib ) saludos shock:
Code Bar PDF417 ó QR Code
[quote="JoseLuis":29ws5jia]Buenos dias Daniel, o quien lo sepa: Este codigo es valido para imprimir en otra impresora que no sea la zebra?, por ejemplo cualquier laser.[/quote:29ws5jia] es independiente, de hecho las pruebas las hice sin tener ninguna impresora instalada...
Code Bar PDF417 ó QR Code
Daniel, gracias
Code Bar PDF417 ó QR Code
Me he bajado las fuentes del link que dejó Daniel. Al compilar me echa este error [color=#FF0000:3lzf5kx5]Error E2451 codabar.c 180: Undefined Symbol "HB_ERR_FUNCNAME" in function HB_FUN_HB_ZEBRA_CREATE_CODABAR[/color:3lzf5kx5] Estoy compilando con xHarbour. Algo estaré haciendo Mal ??? Gracias
Code Bar PDF417 ó QR Code
Saludos que version de xharbour estas usando...?
Code Bar PDF417 ó QR Code
Gracias Daniel por contestar. Uso xHarbour build 1.1.0 Intl. (Simplex)
Code Bar PDF417 ó QR Code
[quote="horacio":h0t3masu]Gracias Daniel por contestar. Uso xHarbour build 1.1.0 Intl. (Simplex)[/quote:h0t3masu] me atrevo a decir que es la version de xharbour... al parecer es algo antigua... que version de fivewin usas??
Code Bar PDF417 ó QR Code
Uso fwh 7.12 Saludos
Code Bar PDF417 ó QR Code
Daniel, gerei o teste que postastes e gerou tudo ok... Fui tentar gerar uma lib e me deparei com o seguinte erro: [b:uf1rati3]can't spill register variable: esi (1) pEC c:\tools\xZebra\source\c\pdf417.c(1230): fatal error: Internal error: best_spillee. [/b:uf1rati3] Estou utilizando: fwh 11.01 xHarbour Comercial 1.2.1 (Rev. 6633) bcc55
Code Bar PDF417 ó QR Code
Hello sorry i'm not work with xharbour builder... i cant not test...
Code Bar PDF417 ó QR Code
Estimados compadres. Exelente aportacion , he complilado, y de maravillas. pero He impreso una pruebas , pero cuando le metes datos de 50 caracateres o mas, el mismo codigo se desarma, ademas por alguna raxon que no entiendo el "PDF417" no funciona en el lector de 2d no logra leerlo, pero el DATAMATRIX que creas, si funciona pero , Observacion .. EL datamatrix generado yo lo utilizo en un appliacion lo conozco bien , el que genera la libreria Zebra se asemeja mas aun "PDF417" que al mismo dataamtrix, Pero funciona, como se puede cambiar el ancho y el largo, en que escala se incrementa el largo y ancho, y por ultimo como porias eliminar HR el txto que contiene el codigo, Gracias Ochacon Busmatic de CR.
Code Bar PDF417 ó QR Code
Me podrian decir que es este error y com lo corrijo no me deja continuar tengo incluido los .c la libreria .lib la clase .prg y noy manera Proyecto: boleteria, Entorno: xHar109: [1]:Bcc32.Exe -DHB_API_MACROS -M -c -O2 -e -tWM -DHB_STACK_MACROS -DHB_OS_WIN_32 -DHB_FM_STATISTICS_OFF -IC:\FWH109\include -IC:\XHARBO~2\Include;C:\bcc582\Include -nC:\PROYEC~1\TRALAPA\Obj zebra\source\c\core.c Borland C++ 5.82 for Win32 Copyright (c) 1993, 2005 Borland zebra\source\c\core.c: Error E2451 zebra\source\c\core.c 199: Undefined symbol 'hb_stackST' in function hb_zebra_ret Error E2451 zebra\source\c\core.c 236: Undefined symbol 'hb_stackST' in function HB_FUN_HB_ZEBRA_GETERROR Error E2451 zebra\source\c\core.c 245: Undefined symbol 'hb_stackST' in function HB_FUN_HB_ZEBRA_GETCODE *** 3 errors in Compile *** Elguna Idea que tengais por ahi o posible solucion Gracias
Code Bar PDF417 ó QR Code
Perdona que insista Daniel, pero alguien ha hecho algo ya en QR code. Veo que el ejemplo es de codigo de barras pero no de QR Code o me pierdo algo? [url:1uwchvrp]http&#58;//es&#46;wikipedia&#46;org/wiki/C%C3%B3digo_QR[/url:1uwchvrp]
Code Bar PDF417 ó QR Code
[quote="Daniel Garcia-Gil":3pcqjrzq]Saludos ...los codebar que usa la ZEBRA, EAN13, EAN8, UPCA, UPCE, CODE39, ITF, MSI, CODABAR, CODE93, CODE11, CODE128, PDF417, DATAMATRIX [/quote:3pcqjrzq] hasta donde se solo trabaja con eso tipos de codebar <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( -->
Code Bar PDF417 ó QR Code
Hola Daniel Necesito tu ayuda, estoy tratando de pasar la imagen que se forma del codigo de barra en la pantalla , he seguido tus consejos de otros post, pero me ha sido imposible, me crea un archivo FILE.BMP, pero que no se puede leer, no se que estoy haciendo mal, te dejo parte del codigo, a ver si me puedes hechar una manito o por ultimo pasarlo directamente a un archivo .BMP o JPG gracias [code=fw:2xqfijcq]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">function</span> BuildCode<span style="color: #000000;">&#40;</span> nCode, cCode, nFlags <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">LOCAL</span> hDC1 := ovent:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> hDC := CreateCompatibleDC<span style="color: #000000;">&#40;</span> hDC1 <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> hDib<br />   <span style="color: #00C800;">LOCAL</span> hBmp := CreateCompatibleBitmap<span style="color: #000000;">&#40;</span> hDC1, <span style="color: #000000;">150</span>, <span style="color: #000000;">50</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> hOldBmp := SelectObject<span style="color: #000000;">&#40;</span> hDC, hBmp <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">default</span> nFlags := <span style="color: #000000;">0</span><br />   <br />   oCode:<span style="color: #000000;">Reset</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> nCode < CODEBAR_PDF417<br />      oCode:<span style="color: #000000;">nHeightCode</span> = oCode:<span style="color: #000000;">nHeight</span> - <span style="color: #000000;">50</span><br />      oCode:<span style="color: #000000;">nWidthCode</span>  = <span style="color: #000000;">1.5</span><br />   <span style="color: #00C800;">else</span><br />      oCode:<span style="color: #000000;">nHeightCode</span> = <span style="color: #000000;">3</span><br />      oCode:<span style="color: #000000;">nWidthCode</span> =  <span style="color: #000000;">1</span><br />   <span style="color: #00C800;">endif</span><br />   oCode:<span style="color: #000000;">SetType</span><span style="color: #000000;">&#40;</span> nCode <span style="color: #000000;">&#41;</span><br />   oCode:<span style="color: #000000;">SetCode</span><span style="color: #000000;">&#40;</span> cCode <span style="color: #000000;">&#41;</span><br />   oCode:<span style="color: #000000;">SetFlags</span><span style="color: #000000;">&#40;</span> nFlags <span style="color: #000000;">&#41;</span><br />   oCode:<span style="color: #000000;">Build</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   DrawBitmap<span style="color: #000000;">&#40;</span> hDC, oCode:<span style="color: #000000;">hCodeBar</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br />   hDib := DibFromBitmap<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />   DibWrite<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"file.bmp"</span> , hDib <span style="color: #000000;">&#41;</span><br />   GloBalFree<span style="color: #000000;">&#40;</span> hDib <span style="color: #000000;">&#41;</span><br /> <br />   ovent:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span>   <br /><br /> </div>[/code:2xqfijcq]
Code Bar PDF417 ó QR Code
Hola Ten pendiente de eliminar los Objetos GDI que estes creando, sino te comeras la memoria bastabte rapido 1) Deselecciona y elimina el handle del bitmap que estas creando hBmp SelectObject( hDC, hOldBmp ) DeleteObject( hBmp ) 2) eliminar el hDC que ya no usas con DeleteDC( hDC ) ahora prueba esta secuencia [code=fw:2nuk22ha]<div class="fw" id="{CB}" style="font-family: monospace;">DrawBitmap<span style="color: #000000;">&#40;</span> hDC, oCode:<span style="color: #000000;">hCodeBar</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />SelectObject<span style="color: #000000;">&#40;</span> hDC, hOldBmp <span style="color: #000000;">&#41;</span><br />hDib := DibFromBitmap<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />DibWrite<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"file.bmp"</span> , hDib <span style="color: #000000;">&#41;</span><br />GloBalFree<span style="color: #000000;">&#40;</span> hDib <span style="color: #000000;">&#41;</span><br /><br />DeleteObject<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />DeleteDC<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br />ovent:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2nuk22ha]
Code Bar PDF417 ó QR Code
Hola Daniel Hice lo que me indicaste, pero aun asi sigue creando el Archivo bmp sin poder leerlo [code=fw:6whaaldi]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> BuildCode<span style="color: #000000;">&#40;</span> nCode, cCode, nFlags <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hDC := oWnd:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> hDC1 := CreateCompatibleDC<span style="color: #000000;">&#40;</span> hDC1 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> hDib<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> hBmp := CreateCompatibleBitmap<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">150</span>, <span style="color: #000000;">50</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> hOldBmp := SelectObject<span style="color: #000000;">&#40;</span> hDC1, hBmp <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">default</span> nFlags := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oCode:<span style="color: #000000;">Reset</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nCode < CODEBAR_PDF417<br />&nbsp; &nbsp; &nbsp; oCode:<span style="color: #000000;">nHeightCode</span> = oCode:<span style="color: #000000;">nHeight</span> - <span style="color: #000000;">50</span><br />&nbsp; &nbsp; &nbsp; oCode:<span style="color: #000000;">nWidthCode</span> &nbsp;= <span style="color: #000000;">1.5</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; oCode:<span style="color: #000000;">nHeightCode</span> = <span style="color: #000000;">3</span><br />&nbsp; &nbsp; &nbsp; oCode:<span style="color: #000000;">nWidthCode</span> = &nbsp;<span style="color: #000000;">1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;oCode:<span style="color: #000000;">SetType</span><span style="color: #000000;">&#40;</span> nCode <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oCode:<span style="color: #000000;">SetCode</span><span style="color: #000000;">&#40;</span> cCode <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oCode:<span style="color: #000000;">SetFlags</span><span style="color: #000000;">&#40;</span> nFlags <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oCode:<span style="color: #000000;">Build</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;DrawBitmap<span style="color: #000000;">&#40;</span> hDC, oCode:<span style="color: #000000;">hCodeBar</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;selectObject<span style="color: #000000;">&#40;</span> hdc,hOldbmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;hDib := DibFromBitmap<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;DibWrite<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"file.bmp"</span> , hDib <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;GloBalFree<span style="color: #000000;">&#40;</span> hDib <span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;DeleteObject<span style="color: #000000;">&#40;</span> hbmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;DeleteDc <span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oWnd:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> &nbsp; <br /><br /><br />&nbsp;</div>[/code:6whaaldi]
Code Bar PDF417 ó QR Code
Daniel Estuve leyendo el Email, que enviaste y despues de las pruebas que he hecho y llego al mismo resultado, el bmp se crea pero con un formato desconocido... Habra alguna solucion como por ejemplo pasarlo directamente a un archivo, sin pasar por una ventana, hice este ejemplo aunque igual uso el DIBWRITE, que otro comando se puede usar oCode:SetType( nCode ) oCode:SetCode( cCode ) oCode:SetFlags( nFlags ) oCode:Build() // DrawBitmap( hDC, oCode:hCodeBar, 0, 0 ) hDib:=( oCode:hCodeBar ) DibWrite( "file.bmp" , hDib ) GloBalFree( hDib )
Code Bar PDF417 ó QR Code
en definitiva esta mala la funcion DIBWRITE, de la version 10.04, quisiera saber si en la version actual esta corregido este error
Code Bar PDF417 ó QR Code
Hola que tal: Estoy intentando crear un pdf417 y he visto este post mi pregunta es para elmoiquique: ¿Pudiste crear el archivo BMP? y si es así ¿Cómo? Un saludo Carlos
Code Bar PDF417 ó QR Code
[quote="colthop":2uirv7fx]Hola que tal: Estoy intentando crear un pdf417 y he visto este post mi pregunta es para elmoiquique: ¿Pudiste crear el archivo BMP? y si es así ¿Cómo? Un saludo Carlos[/quote:2uirv7fx] Si finalmente solucione el problema, con una imagen
Code Bar PDF417 ó QR Code
Amigos Alguien tiene un ejemplo de como generar en código QR Gracias. Saludos, Adhemar
Code Bar PDF417 ó QR Code
[quote="acuellar":22aus8uq]Amigos Alguien tiene un ejemplo de como generar en código QR Gracias. Saludos, Adhemar[/quote:22aus8uq] [url:22aus8uq]http&#58;//www&#46;pctoledo&#46;com&#46;br/forum/viewtopic&#46;php?f=4&t=9223[/url:22aus8uq] [url:22aus8uq]http&#58;//www&#46;pctoledo&#46;com&#46;br/forum/viewtopic&#46;php?f=4&t=15708[/url:22aus8uq] [url:22aus8uq]http&#58;//www&#46;pctoledo&#46;com&#46;br/forum/viewtopic&#46;php?f=43&t=15693[/url:22aus8uq] Saludos.