topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
|---|---|
Another Question about FWH and Word
|
Dear Michel,
According to google Bard it can be done this way:
[code=fw:3961x1c1]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <windows.h><br /><br />int main<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> <span style="color: #B900B9;">// Get the handle of the Word application.</span><br /> HWND word_app = FindWindow<span style="color: #000000;">(</span>L<span style="color: #ff0000;">"Word.Application"</span>, <span style="color: #00C800;">NULL</span><span style="color: #000000;">)</span>;<br /><br /> <span style="color: #B900B9;">// Get the handle of the macjuda.dot file.</span><br /> HMODULE macjuda_dot = LoadLibrary<span style="color: #000000;">(</span>L<span style="color: #ff0000;">"macjuda.dot"</span><span style="color: #000000;">)</span>;<br /><br /> <span style="color: #B900B9;">// Disconnect the macjuda.dot file from Word.</span><br /> DisconnectObject<span style="color: #000000;">(</span>word_app, macjuda_dot<span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span>;<br /><span style="color: #000000;">}</span></div>[/code:3961x1c1]
|
Another Question about FWH and Word
|
Antonio,
Unfortunately, I wasn't able to use your suggestion because I got a lot of errors.
But maybe I can solve it is you can help me to transate this VBA-sentence into FWH :[code=fw:2yug2lcp]<div class="fw" id="{CB}" style="font-family: monospace;">AddIns<span style="color: #000000;">(</span><span style="color: #ff0000;">"C:<span style="color: #000000;">\U</span>sers<span style="color: #000000;">\M</span>ichel<span style="color: #000000;">\A</span>ppData<span style="color: #000000;">\R</span>oaming<span style="color: #000000;">\M</span>icrosoft<span style="color: #000000;">\W</span>ord<span style="color: #000000;">\S</span>TARTUP<span style="color: #000000;">\M</span>acJuda.dotm"</span><span style="color: #000000;">)</span>.Installed = <span style="color: #00C800;">False</span></div>[/code:2yug2lcp]Any idea?
Thanks a lot in advance.
|
Another Question about FWH and Word
|
Dear Michel,
chatgpt proposes this code, not sure if it will work as expected. You can easily port it to FWH
[code=fw:1hc9zhrq]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <stdio.h><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><br />int main<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> HKEY hKey;<br /> const char *regPath = <span style="color: #ff0000;">"Software<span style="color: #000000;">\\</span>Microsoft<span style="color: #000000;">\\</span>Office<span style="color: #000000;">\\</span>Word<span style="color: #000000;">\\</span>Addins<span style="color: #000000;">\\</span>MacJuda.dotm"</span>;<br /> <br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>RegOpenKeyEx<span style="color: #000000;">(</span>HKEY_CURRENT_USER, regPath, <span style="color: #000000;">0</span>, KEY_WRITE, &hKey<span style="color: #000000;">)</span> == ERROR_SUCCESS<span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> DWORD value = <span style="color: #000000;">0</span>;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>RegSetValueEx<span style="color: #000000;">(</span>hKey, <span style="color: #ff0000;">"Installed"</span>, <span style="color: #000000;">0</span>, REG_DWORD, <span style="color: #000000;">(</span>const BYTE*<span style="color: #000000;">)</span>&value, sizeof<span style="color: #000000;">(</span>DWORD<span style="color: #000000;">)</span><span style="color: #000000;">)</span> == ERROR_SUCCESS<span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> printf<span style="color: #000000;">(</span><span style="color: #ff0000;">"Value 'Installed' set to False.<span style="color: #000000;">\n</span>"</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span> <span style="color: #00C800;">else</span> <span style="color: #000000;">{</span><br /> printf<span style="color: #000000;">(</span><span style="color: #ff0000;">"Error setting value.<span style="color: #000000;">\n</span>"</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> RegCloseKey<span style="color: #000000;">(</span>hKey<span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span> <span style="color: #00C800;">else</span> <span style="color: #000000;">{</span><br /> printf<span style="color: #000000;">(</span><span style="color: #ff0000;">"Error opening registry key.<span style="color: #000000;">\n</span>"</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span>;<br /><span style="color: #000000;">}</span><br /> </div>[/code:1hc9zhrq]
|
Another Question about FWH and Word
|
Atonio,
Thank you for your efforts.
Unfortunately, this isn't working.
|
Another bug in 9.04's xbrowse
|
Dragging the horizontal thumb to the very right or left will cause a msgalert("1") to appear.
[img:3gc7emcj]http://img518.imageshack.us/img518/1183/xbrowse.jpg[/img:3gc7emcj]
|
Another bug in 9.04's xbrowse
|
Tested using \fwh\samples\testxbr3.prg with FWH 9.04 15th Apr. Still happens.
Maybe this short video capture can show it better, <!-- m --><a class="postlink" href="http://screencast.com/t/O7Rq5WHP">http://screencast.com/t/O7Rq5WHP</a><!-- m -->
|
Another bug in 9.04's xbrowse
|
Yes. This alert pops up even when we click on the horizontal thumbpos. There is no problem with vertical scroll bar
|
Another bug in 9.04's xbrowse
|
This problem started with version 9.03. version 9.02 works fine.
|
Another bug in 9.04's xbrowse
|
Here is the bug
Please see line 2119 of XBrowse.Prg ( Method SelectCol( ... ) )
[code=fw:2i8rss4v]<div class="fw" id="{CB}" style="font-family: monospace;">? ::<span style="color: #000000;">nColSel</span> := <span style="color: #0000ff;">Min</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">nColSel</span>, ::<span style="color: #000000;">LastDisplayPos</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> </div>[/code:2i8rss4v]
It is the inadvertant typing of "?" in the beginning of the line that is causing this problem.
Please remove this "?" at the beginning of the line and recompile.
That is the fix for this bug.
|
Another bug in 9.04's xbrowse
|
Yes! Thanks NageswaraRao!
Actually, what's the correct short-form for your name <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> ? Is it Nages?
|
Another bug in 9.04's xbrowse
|
Rao,
Fixed, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
We have just published a new FWH 9.04 build.
|
Another bug in 9.04's xbrowse
|
Mr Hua
>
what's the correct short-form for your name ? Is it Nages?
>
You may address me as Rao, or Nageswar.
|
Another bug in 9.04's xbrowse
|
[quote="nageswaragunupudi":2j46ocj1]Mr Hua
You may address me as Rao, or Nageswar.[/quote:2j46ocj1]
Ok Mr Rao <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Thanks again.
|
Another bug in TWBrowse scrollbar
|
[code:or4jtkan]#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg, oBrw
USE TEST
DEFINE DIALOG oDlg
@ 0, 0 LISTBOX oBrw FIELDS
ACTIVATE DIALOG oDlg;
ON INIT oDlg:SetControl( oBrw );
CENTER
CLOSE
RETURN NIL[/code:or4jtkan]
Try to press PAGEDOWN and then PAGEUP: the scrollbar should go back to the top but it doesn't.
EMG
|
Another bug in TWBrowse scrollbar
|
[code:7yhll7jz]METHOD PageUp( nLines ) CLASS TWBrowse
local nSkipped
DEFAULT nLines := ::nRowCount()
nSkipped = ::Skip( -nLines )
if ( ::nLen := Eval( ::bLogicLen, Self ) ) < 1
return nil
endif
if ! ::lHitTop
if nSkipped == 0
::lHitTop = .t.
else
::lHitBottom = .f.
if -nSkipped < nLines
::nRowPos = 1
if ::oVScroll != nil
::VSetPos( 1 )
endif
else
//nSkipped = ::Skip( -nLines )
//::Skip( -nSkipped )[/code:7yhll7jz]
Commenting out those last two statements seems to solve the problem but I'm not sure if this is the right fix. Antonio, please review.
EMG
|
Another bug in TWBrowse scrollbar
|
Enrico,
> Try to press PAGEDOWN and then PAGEUP: the scrollbar should go back to the top but it doesn't.
In Vista is working fine without modifying the method. Going to try it in XP (edited: same behavior in XP).
How many records Test.dbf has ? (Here just 2).
|
Another bug in TWBrowse scrollbar
|
No, you will see the problem only when you have a certain amount of record. I tried with xHarbour sample TEST.DBF that has 500 record.
EMG
|
Another bug in TWBrowse scrollbar
|
Enrico,
This seems the right fix. Its just needed to change the order of the call to ::VSetPos()
[code:3memk2jx]
...
else
if ::oVScroll != nil
::VSetPos( ::VGetPos() + nSkipped )
endif
nSkipped = ::Skip( -nLines )
::Skip( -nSkipped )
endif
...
[/code:3memk2jx]
|
Another bug in TWBrowse scrollbar
|
I confirm the fix, thank you!
EMG
|
Another bug in menu
|
I'm preparing a sample. Please delay the release of the new FWH build...
EMG
|
Another bug in menu
|
Here it is:
[code=fw:4yqyd83m]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><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, oMenu<br /><br /> <span style="color: #0000ff;">MENU</span> oMenu <span style="color: #000000;">2007</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Test&1"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"1"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Test&2"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"2"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Test&3"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"3"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MDI</span>;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"MDI Test"</span>;<br /> <span style="color: #0000ff;">MENU</span> oMenu<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;">INIT</span> CREATECHILD<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span><br /><br /> <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> CREATECHILD<span style="color: #000000;">(</span> oMdi <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oWnd, oMenu<br /><br /> <span style="color: #0000ff;">MENU</span> oMenu <span style="color: #000000;">2007</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Changed&1"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"1"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Changed&2"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"2"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Changed&3"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"3"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MDICHILD</span> <span style="color: #0000ff;">OF</span> oMdi;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"MDI Child Test"</span>;<br /> <span style="color: #0000ff;">MENU</span> oMenu<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd;<br /> <span style="color: #0000ff;">VALID</span> !GETKEYSTATE<span style="color: #000000;">(</span> VK_ESCAPE <span style="color: #000000;">)</span>;<br /> <span style="color: #0000ff;">MAXIMIZED</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:4yqyd83m]
EMG
|
Another bug in menu
|
The bugs:
1. the area to the right of the menu is not properly painted
2. Pressing ALT-2 you will get 1 instead of 2
3. Pressing ALT-1 and then ESC and ESC again the menu icon to the left vanishes
EMG
|
Another bug in menu
|
Enrico, I'm watching your example
This bug also it appears with previous versions FWH 15.04
I tried it with version 13.12
You can check this?
Except that is to correctly paint the menubar
Anyway, obviously I will look how to fix it
Regards
|
Another bug in menu
|
[quote="cnavarro":14p7k71r]Enrico, I'm watching your example
This bug also it appears with previous versions FWH 15.04
I tried it with version 13.12
You can check this?
Except that is to correctly paint the menubar
Anyway, obviously I will look how to fix it
Regards[/quote:14p7k71r]
Yes, bugs 2 and 3 are very old ones. Thank you for looking at them!
EMG
|
Another bug in menu
|
Enrico, thanks for you feedback
|
Another bug in menu
|
Enrico, bug 1 fixed
Menubar is painted correctly
[url=http://postimage.org/:2eb5gcop][img:2eb5gcop]http://s21.postimg.org/j3vqmi1h3/Title247.png[/img:2eb5gcop][/url:2eb5gcop]
|
Another bug in menu
|
Cristobal,
great! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
EMG
|
Another bug in menu
|
[quote="Enrico Maria Giordano":vc9kn96y]Cristobal,
great! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
EMG[/quote:vc9kn96y]
Enrico
I'm working in it
In the next version it is already included some improved in [b:vc9kn96y]old BUGs[/b:vc9kn96y] ( before FWH 14.12 ) in menus with MDI windows, and also
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=31535&p=185453#p185453">viewtopic.php?f=6&t=31535&p=185453#p185453</a><!-- l -->
|
Another bug in menu
|
Thank you, Cristobal!
EMG
|
Another for Lan Network
|
I 'm trying to run a small test into Lan Network
Now it seem run, I can open and save customer.dbf
[img:1oze71j6]https://i.postimg.cc/1z6nQ4Y2/n.png[/img:1oze71j6]
I made
[b:1oze71j6]USE &(oApp():cDbfPath+cDbf+".dbf") ;
INDEX &(oApp():cDbfPath+cDbf+".cdx") ;
ALIAS &(cAlias) NEW SHARE[/b:1oze71j6]
and I change giving to oApp():cDbfPath all the exact directory
::cExePath := cFilePath(GetModuleFileName(GetInstance())) //+ "\"
oApp:cYearPath := "2018"
oApp:cDbfPath := ::cExePath+oApp:cYearPath+"\dbf"+"\"
But I'm not convinced yet,
the program never stops even when it has to delete a record that another computer is editing,
I have deleted the number 1 from the customer.dbf file but this record was in edit mode on another computer
how is this possible?
obviously in the save record I used
[code=fw:1oze71j6]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">If</span> !Occupated<span style="color: #000000;">(</span><span style="color: #ff0000;">"CU"</span><span style="color: #000000;">)</span><br /> Replace CU->Id with nId<br /> Replace CU->First with cFirst<br /> Replace CU->Last with cLast<br /> Replace CU->street with cstreet<br /> Replace CU->City with cCity<br /> Replace CU->State with cState<br /> Replace CU->Zip with nZip<br /> Replace CU->Hiredate with dHiredate<br /> Replace CU->Married with lMarried<br /> Replace CU->Age with nAge<br /> Replace CU->Salary with nSalary<br /> CU-><span style="color: #000000;">(</span>DbCommit<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> CU-><span style="color: #000000;">(</span>Dbunlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Endif</span></div>[/code:1oze71j6]
[b:1oze71j6]the function Occupated(cAlias) with Rlock[/b:1oze71j6]
[code=fw:1oze71j6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> Occupated<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> lRet:=.F., Sigue:=<span style="color: #000000;">5</span><br /> <span style="color: #00C800;">DEFAULT</span> cAlias:=<span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> Sigue><span style="color: #000000;">0</span><br /> <span style="color: #00C800;">IF</span> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>RLock<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> Sigue:=<span style="color: #000000;">0</span><br /> <span style="color: #00C800;">ELSE</span><br /> INKEY<span style="color: #000000;">(</span><span style="color: #000000;">0.5</span><span style="color: #000000;">)</span><br /> Sigue:=Sigue<span style="color: #000000;">-0.5</span><br /> <span style="color: #00C800;">IF</span> Sigue<=<span style="color: #000000;">0</span> .AND.;<br /> MsgYesNo<span style="color: #000000;">(</span><span style="color: #ff0000;">"!Registration occupied by another user!"</span>+CRLF+ ;<br /> <span style="color: #ff0000;">" Please wait... "</span>, <span style="color: #ff0000;">"Conferma..."</span><span style="color: #000000;">)</span><br /> Sigue:=<span style="color: #000000;">3</span><br /> <span style="color: #00C800;">ELSE</span><br /> lRet:=.T.<br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDDO</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span>lRet<span style="color: #000000;">)</span></div>[/code:1oze71j6]
I'm not convinced that this can work
|
Another for Lan Network
|
There are two methods of file locking, optimistic and pessimistic.
With optimistic, the user loads and edits the file, then when they are done, the record is locked, saved, and unlocked.
With pessimistic, the record is locked, the user edits it, then it is saved and unlocked.
I have always used optimistic locking and have had few problems. Pessimistic can cause problems with users walking away from their computer while it is in edit mode. Nobody else can edit the record until they save it.
The experience that you had is unusual but can be handled. If the record was legitimately deleted, the save should fail gracefully saying the record has been deleted. It would seem to be a rare case when one user is updating a record that another user feels should be deleted. If there was good reason for deleting it, then there is no loss if the edited data doesn't get saved. You could provide the option for the user trying to save the updates, to undelete the record and then save.
There is really no right or wrong way. If something like this does happen the best you can do is guess the best solution and record what happened so it can be later undone.
It's not a perfect world...
James
[i:2tudi0al]If the world were perfect, it wouldn't be.[/i:2tudi0al]--Yogi Berra
|
Another for Lan Network
|
James,
for this topic I not use tdata but only new share
|
Another for Lan Network
|
Hello Silvio
If you want the behavior you descript you must lock the record when the user starts editing the record.
You lock immediately before saving the changes. So another user can delete the record in the mean time.
Then you can be sure that no one can change or delete this record.
Best regards
Otto
|
Another for Lan Network
|
Silvio,
I can't think of a good reason to ever delete a customer. Perhaps move them to an "archive" database after a certain period of inactivity, but I wouldn't delete them.
If you allowed a customer to be deleted then you would also have to delete all related records such as orders, invoices, etc. You can see that this could be a nightmare. What about unpaid bills, unprocessed orders, etc. You would have to do all kinds of checks before even allowing a delete. Much better would be to move the customer and everything related to archive databases. Then they can be recovered.
|
Another for MDB recorset
|
I must create two index ord on a table of a Mdb
Mdb : ecom
Table : Utenti
first = Id
second = cognome
How I must make it ?
|
Another for MDB recorset
|
When we deal with RDMS, it is not necessary to create any index to read the table in a particular order. Careful choice of indexes on very large table improves the performance of queries.
If you want to read the columns in the order of Id the query should be "SELECT ID, COGNOME FROM UTENTI ORDER BY ID" or if you want to read in the order or cognome, say ORDERY BY COGNOME.
You can even change the order after reading the recordset.
oRs:Sort := 'ID'
or
oRs:Sort := 'COGNOME'
For all this it is not necessary to create indexes.
|
Another for MDB recorset
|
i WANTED TO CREATE A TAB WITH TWO FOLDER
ON THE FIRST i MUST INSERT "id" AND ON THE SECOND "cOGNOME"
WHEN i CLICK ON FIRST TAB THE XBROWSE MUST CHANGE VISUALIZATION
@ oApp():oDlg:nGridBottom, nSplit+2 TABS oApp():oTab ;
OPTION nOrder SIZE oApp():oWndMain:nWidth()-50, 12 PIXEL OF oApp():oDlg ;
ITEMS ' First ', ' Last '
[b:2eoazn1a]ACTION ( nOrder := oApp():oTab:nOption ,;
CU->(DbSetOrder(nOrder)),;
CU->(DbGoTop()) ,;[/b:2eoazn1a] oApp():oGrid:Refresh(.t.) ,;
RefreshCont(oCont, "CU") )
IMAGES "image1.bmp","image2.bmp"
HOW i CAN MAKE IT?
|
Another for MDB recorset
|
For RecordSets:
oRs:Sort := "ID"
is equilvalent to ALIAS->(ORDSETFOCUS("ID"))
You can change sort orders viewed by simply assigning the values to oRs:Sort
Examples:
oRs:Sort := "COLNAME"
oBrw:Refresh()
|
Another for MDB recorset
|
ok but Ihave an variable
nOrder := 1
and then on tab I insert
ACTION ( [b:3uxd3vmf]nOrder[/b:3uxd3vmf] := oApp():oTab:nOption ,;
oRs:Sort := ([b:3uxd3vmf]nOrder[/b:3uxd3vmf]),;
oRs:MoveFirst())
it make error !!
[code:3uxd3vmf]
Path and name: C:\work\prg\Mwopen_W\source\FSDI2006.Exe (32 bits)
Size: 1,709,568 bytes
Time from start: 0 hours 0 mins 4 secs
Error occurred at: 11-02-2008, 13:21:36
Error description: Error ADODB.Recordset/16389 E_FAIL: _SORT
Args:
[ 1] = N 2
Stack Calls
===========
Called from: win32ole.prg => TOLEAUTO:_SORT(0)
Called from: pcustomer.prg => (b)CUSTOMER(208)
Called from: TTabs.prg => TTABS:SETOPTION(712)
Called from: TTabs.prg => TTABS:LBUTTONDOWN(632)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: CONTROL.PRG => TTABS:HANDLEEVENT(0)
Called from: WINDOW.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: WINDOW.PRG => TWINDOW:ACTIVATE(0)
Called from: main.prg => TAPPLICATION:ACTIVATE(148)
Called from: main.prg => MAIN(36)[/code:3uxd3vmf]
I write this
@ oApp():oDlg:nGridBottom, nSplit+2 TABS oApp():oTab ;
OPTION nOrder SIZE oApp():oWndMain:nWidth()-50, 12 PIXEL OF oApp():oDlg ;
ITEMS ' First ', ' Last ' ;
ACTION ( nOrder := oApp():oTab:nOption ,;
oRs:Sort := (nOrder),;
oRs:MoveFirst() ,;
oApp():oGrid:Refresh(.t.) ,;
RefreshCont(oCont,oRs) )
|
Another for MDB recorset
|
You should assign column name or names delimited by commas. Not Numeric Values.
CORRECT :
oRs:Sort := 'ID'
oRs:Sort := 'COGNOME'
WRONG:
oRs:Sort := 1 or 2
Try something like this:
[code:2jgx799z]
ACTION ( nOrder := oApp():oTab:nOption , oRs:Sort := oRs:Fields(nOrder-1):Name, ..... )
[/code:2jgx799z]
|
Another for MDB recorset
|
Now I made
@ oApp():oDlg:nGridBottom, nSplit+2 TABS oApp():oTab ;
OPTION nOrder SIZE oApp():oWndMain:nWidth()-50, 12 PIXEL OF oApp():oDlg ;
ITEMS ' First ', ' Last ' ;
ACTION ( nOrder := oApp():oTab:nOption ,;
[b:2so0w4q1]oRs:Sort := oRs:Fields(nOrder-1):Name[/b:2so0w4q1],;
oRs:MoveFirst() ,;
oApp():oGrid:Refresh(.t.) ,;
RefreshCont(oCont,oRs) )
Application
===========
Path and name: C:\work\prg\Mwopen_W\source\FSDI2006.Exe (32 bits)
Size: 1,789,952 bytes
Time from start: 0 hours 0 mins 3 secs
Error occurred at: 11-02-2008, 14:00:09
Error description: Error ADODB.Recordset/16389 E_FAIL: _SORT
Args:
[ 1] = C UserID
Stack Calls
===========
Called from: win32ole.prg => TOLEAUTO:_SORT(0)
Called from: pcustomer.prg => (b)CUSTOMER(206)
Called from: TTabs.prg => TTABS:SETOPTION(712)
Called from: TTabs.prg => TTABS:LBUTTONDOWN(632)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: CONTROL.PRG => TTABS:HANDLEEVENT(0)
Called from: WINDOW.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: WINDOW.PRG => TWINDOW:ACTIVATE(0)
Called from: main.prg => TAPPLICATION:ACTIVATE(149)
Called from: main.prg => MAIN(37)
i'm afraid thart oRs:Sort take only filed name and not field number
any idea ?
|
Another for MDB recorset
|
> 'm afraid thart oRs:Sort take only filed name and not field number
Yes. It takes only field name. but not field number.
make sure you assign the right field names to oRs:Sort
|
Another for MDB recorset
|
I made this but not run
oRs:Sort :=iff( norder=1, oRs:Fields( "ID" ):Name,oRs:Fields( "Cognome" ):Name);
|
Another for MDB recorset
|
and
@ oApp():oDlg:nGridBottom, nSplit+2 TABS oApp():oTab ;
OPTION nOrder SIZE oApp():oWndMain:nWidth()-50, 12 PIXEL OF oApp():oDlg ;
ITEMS ' First ', ' Last ' ;
ACTION ( nOrder := oApp():oTab:nOption ,;
if( norder=1, oRs:Sort( "ID" ),oRs:Sort( "Cognome" )),;
oRs:MoveFirst() ,;
oApp():oGrid:Refresh(.t.) ,;
RefreshCont(oCont,oRs) )
but it not run !!
|
Another for MDB recorset
|
I try also this but not run
@ oApp():oDlg:nGridBottom, nSplit+2 TABS oApp():oTab ;
OPTION nOrder SIZE oApp():oWndMain:nWidth()-50, 12 PIXEL OF oApp():oDlg ;
ITEMS ' First ', ' Last ' ;
ACTION ( nOrder := oApp():oTab:nOption ,;
if( norder=1, oRs:Sort := 'ID' ,oRs:Sort := 'COGNOME' ),;
oRs:MoveFirst() ,;
oApp():oGrid:Refresh(.t.) ,;
RefreshCont(oCont,oRs) )
|
Another for MDB recorset
|
Please send to my personal email, zip of your mdb, if it is not confidential. I send back a simple working code, which you can incorporate.
|
Another for MDB recorset
|
> if( norder=1, oRs:Sort := 'ID' ,oRs:Sort := 'COGNOME' ),;
This should run ok.
|
Another for MDB recorset
|
question ... on a related note .. consider this query :
Select lname,fname from Customer order by lname
...
...
lets say I want to re-order my existing recordset created by the above query .. are you saying I can oRs:Sort := 'fname' to reorder ?? or do I need to re-create the query with order by fname ?
Rick Lipkin
|
Another for MDB recorset
|
Mr Rick Liptin
>
ets say I want to re-order my existing recordset created by the above query .. are you saying I can oRs:Sort := 'fname' to reorder ??
>
Yes.
>
or do I need to re-create the query with order by fname ?
>
No need at all.
If we do, that will increase response time and unnecessary burden on the server and also the network traffic.
Actually, it is a good idea not to request an ordered set from the server, but to do the sorting on the client. When we request an ordered set, the sever has to do an additional work of sorting, creating temporary tables and so on. We should place the least strain on the server and and the network bandwidth.
|
Another for MDB recorset
|
Outstanding .. I did not know you can re-sort a recordset .. many times I have a 'find' routine that I need to re-order the same information .. to do this I have used my origional order by query ( lname ) and if I needed to find a group of records matching a like % on fname ...I used the oRs:Filter .. but the filter is a bit clumsy and you have to release the filter
Thanks for the information ..
Rick Lipkin
fyi .. I have not given up on oracle .. I have the oracle 11 disks and plan on trying to load the client in the near future to see if I can connect
|
Another for MDB recorset
|
Mr Rick Liptin
Still Find is very powerful. It is like our classical locate and locate next in xBase. But we can as well use it in the place of Seek.
> but the filter is a bit clumsy and you have to release the filter
Yet, it is powerful. We can even set filter to an array of book marks. At times very handy and useful. oRs:Filter := { bm1, bm2, ....}
If you find setting and releasing filters needs special attention, consider an alternative, create a clone, set filter and then close it.
oRs2 := oRs:Clone()
oRs2:Filter := ................
do something with oRs2
oRs2:Close
These are some ideas
|
Another for MDB recorset
|
NageswaraRao,
Can you sort recordsets on more complex information like concantated multiple fields? How about descending?
James
|
Another for MDB recorset
|
Mr James
Yes
oRs:Sort := "FIRST , CITY DESC"
ASC is assumed if not specified.
also we can sort on multiple fields of char, number, dates etc.
|
Another for MDB recorset
|
I'm afrad that Sort() method works only with MDB. As an example, it doesn't work with MSDE.
EMG
|
Another for MDB recorset
|
Sort works with MDB, Oracle, MSSQL Server.
Actually it is an internal feature of ADO and has nothing to do with the data provider, because the ADO engine sorts the recordset within memory totally on the client. The server does not come into picture at all. It even works with synthetic recordsets totally built on the client. It is something analogous to sorting an array after we read data into an array in the memory of our PC.
Kindly recheck.
I use the syntax oRs:Sort = <expression>. I do not know if oRs:Sort( <exp> ) works. Does it work this way also ?
|
Another for MDB recorset
|
Mr Enrico
[quote="Enrico Maria Giordano":3ojfphdw]I'm afrad that Sort() method works only with MDB. As an example, it doesn't work with MSDE.
EMG[/quote:3ojfphdw]
I have not worked with MSDE. May I know how is your experience with the product? Do you think we can do development work with this before we test on real servers ?
Thanks in advance.
|
Another for MDB recorset
|
[quote="nageswaragunupudi":2tuvhja2]I have not worked with MSDE. May I know how is your experience with the product? Do you think we can do development work with this before we test on real servers ?
Thanks in advance.[/quote:2tuvhja2]
I have MSDE installed and Sort() method doesn't seem to work. So I think it doesn't work with MS SQL Server either. I don't know about MySQL and other engines but yes, I'd test real servers before using Sort() method estensively.
EMG
|
Another for MDB recorset
|
This is the sample I tried:
[code:1eazt2yk]#define adOpenForwardOnly 0
#define adOpenKeyset 1
#define adOpenDynamic 2
#define adOpenStatic 3
#define adLockReadOnly 1
#define adLockPessimistic 2
#define adLockOptimistic 3
#define adLockBatchOptimistic 4
FUNCTION MAIN()
LOCAL oRs
oRs = CREATEOBJECT( "ADODB.Recordset" )
oRs:Open( "SELECT * FROM T_Utenti ORDER BY Utente", "Provider=SQLOLEDB;Integrated Security=SSPI;Data Source=EMAG\Emag;Initial Catalog=Quadro", adOpenForwardOnly, adLockReadOnly )
oRs:Sort = "Passw"
WHILE !oRs:EOF
? oRs:Fields( "Utente" ):Value, oRs:Fields( "Passw" ):Value
oRs:MoveNext()
ENDDO
oRs:Close()
INKEY( 0 )
RETURN NIL[/code:1eazt2yk]
And this is the error I get:
[code:1eazt2yk]Error ADODB.Recordset/6 DISP_E_UNKNOWNNAME: _SORT Arguments: ( [ 1] = Type: C Val: Passw)[/code:1eazt2yk]
Do you see any problems in my sample that can explain the error?
EMG
|
Another for MDB recorset
|
Found! I have to use
[code:1kwob13q]oRs:CursorLocation = adUseClient[/code:1kwob13q]
It is perfectly logical. But still I don't know if it is a good idea to use a technique that forces client cursor usage.
EMG
|
Another for MDB recorset
|
Mr Enrico
You found the reason. Most of the data and methods do not work on serverside cursors and some work only for serverside cursors but not for clientside.
I have a few advices to make in general, based on theory, widely accepted good practices, confirmed by our own experiences.
It is desirable and the normal practice to open recordsets on the client side only. Opening serverside cursors is an exception.
In real life situations the applications are supposed to put least demands on Server and Network resources. Therefore the best practices are ( our discussion is limited to client-server 2-tier architecture only ) :-
1. Dont open more than one connection per application.
2. Ask the server for just enough information required for the purpose. Quickly retrieve it and say Thanks. Leave the Server free to attend to other requests from other users / applications.
I have seen in our forums that every record set is opened with connection information.
Disadvantages:
a) While opening each recordset we are opening a new connection and leaving those connections open on the server till we finish our work at our liesure. Imagine hundreds or users opening tens of connections each and locking the server's limited resources. It is not surprising if the server soon starts denying further requests till previous resources are released. Or server's performance gets bogged down.
b) Opening a connection takes more time. Opening a recordset with a connection already opened is faster.
It seems this usage is adopted from sources available from asp codes and webpage sources. That is 3-tier architecture. There is an application server sitting between us and the server. That situation is much different and good practices are diferent.
c) Classified information like server names, database names, passwords are scattered all around our modules in the application code. Serious security lapse. If the connection is opened in only one function, that alone can be changed whenever passwords and usernames are changed by the administrators for security reasons.
Recommendations:
i) Open one connection at the beginning and store it in a global variable ( better as a return value of a function ). Use the connection as RecordSet's ActiveConnection property while opening a new Recordset. We open the recordset faster ( our users are happy with our program ) and consume minimum resources of the server ( Our System Adminstrator friends are thankful to us.). Amy periodical changes in the connection parameters can be easily changed. Actually it is better not to hardcode such params.
ii) Ask the minimum information and give the server the minimum work. Example, we can sort the recordset at the client instead of bothering the server. After getting the information, disconnect the recordset and leave the server for other works. We can always reconnect if we want to make any updates or resyncs.
iii) More and more advanced our programming needs are more and more complex our sql queries become. Tuning of sql queries is an essential knowledge we need to aquire. Badly drafted sql's can lock server resources for unduly long periods, bringing down the server performance.
iii) Unless required, open client server cursors. Application performance will be very fast. Users will be happy with the blazing speeds of browses. Serverside cursors are not only slow but also keep the server tied up. Also there is a known issue with opening more than one serverside cursor on mssql server at the same time. Easier way is Open the connection at the outset with cursor location set to adUseClient. By default all recordsets will be opened client side.
|
Another for MDB recorset
|
EMG or nageswaragunupudi
I must implement an TAB
I want inser this tab to the bottom of a xbrowse
when I clicl on a folder the Xbrowse must order the record to one order
@ oApp():oDlg:nGridBottom, nSplit+2 TABS oApp():oTab ;
OPTION nOrder SIZE oApp():oWndMain:nWidth()-50, 12 PIXEL OF oApp():oDlg ;
ITEMS ' First ', ' Last '
ACTION ( nOrder := oApp():oTab:nOption ,;
oRs:Sort (nOrder)),;
oRs:movetop() ,; oApp():oGrid:Refresh(.t.) ,;
How I can make it ?
)
|
Another for MDB recorset
|
I think we discussed this earlier. Depending on nOption, set oRs:Sort := <columnname>, oBrw:Refresh().
Make sure you opened the recordset with adUseClient option. The above code will work
|
Another for MDB recorset
|
[quote="nageswaragunupudi":zh7f4662]I have seen in our forums that every record set is opened with connection information.[/quote:zh7f4662]
They are only minimal samples. Nothing more.
[quote="nageswaragunupudi":zh7f4662]Recommendations: [...][/quote:zh7f4662]
That's why I don't like client/server at all. Too much constraints. An archaic technology passed off as new.
EMG
|
Another for MDB recorset
|
nageswaragunupudi,
Thanks for the client-side/server-side cursor explanations.
> Open one connection at the beginning and store it in a global variable ( better as a return value of a function ).
This sounds like good use for a connection object. You could put a connection object inside a SET/GET function. Then you could retrieve the connection object and use it's methods or vars anywhere in the application. You could do things like this:
oConnection:= TCSConnection():new( ... )
connection( oConnection )
connection():activate()
connection():open()
connection():close()
Regards,
James
|
Another for MDB recorset
|
Dear nageswaragunupudi
I made a s you sad but it make erro on Sort command
I try with :
ors:sort:="First"
or
ors:sort:field("first"):value
or
ors:sort:field("first")::name
I must create a small sample to see it ...
|
Another for MDB recorset
|
Mr James
Yes thats is what I suggest.
You and me being OOPS fans, we better have a Class for Connection. Make a base class for Ado Connection and then we have derived classes for oracle, mssql, etc. with their specific features,
In fact thats what I do. Like you I have one public function which returns the connection object. With my oops model, I finally program like this
oTable := MyServer():OpenTable( <csql>, ... params )
My oTable class is like your TData class. It is wrapper for recordset. Bridges behavioral gaps of dbf and recset.
Now I am sure you know what I mean and what I am doing, without futher elaboration.
|
Another for MDB recorset
|
Mr Silvio
Please make a very short program.
Open recordset.
Then write this line oRs:Sort := <first column name>
Post the code here.
|
Another for MDB recorset
|
try it
[code:4wkyq5oc]
#include "FiveWin.ch"
#include "Splitter.ch"
STATIC oDb, oRs
FUNCTION Customer()
LOCAL aBrowse
LOCAL nSplit :=102
LOCAL nOrder :=1
LOCAL nRecno :=1
LOCAL oDlg,oFont,oTab
oRs = CREATEOBJECT( "ADODB.Recordset" )
TRY
oRs:Open( "SELECT * FROM Utenti ORDER BY COGNOME", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=ecom.mdb", 1, 3 )
CATCH oErr
? oErr:Description
RETURN NIL
END TRY
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-12
DEFINE DIALOG oDlg from 2,4 to 24,80;
TITLE "test xbrowse with tabs with MDB" ;
FONT oFont
oBrw := TXBrowse():New( oDlg )
WITH OBJECT oBrw
:nTop := 10
:nLeft := 20
:nBottom := 150
:nRight := 300
END
aBrowse := { { { || STR( oRs:Fields( "ID" ):Value) }, i18n("Codice"), 50, 0 },;
{ { || oRs:Fields( "Nome" ):Value }, i18n("Nome"), 150, 0 },;
{ { || oRs:Fields( "Cognome" ):Value}, i18n("Cognome"), 150, 0 },;
{ { || oRs:Fields( "Via" ):Value} , i18n("Indirizzo"), 150, 0 } ,;
{ { || oRs:Fields( "Civico" ):Value} , i18n("Civico"), 150, 0 },;
{ { || oRs:Fields( "Citta" ):Value} , i18n("Città"), 150, 0 } ,;
{ { || oRs:Fields( "Provincia" ):Value} , i18n("Prov"), 150, 0 }}
FOR i := 1 TO Len(aBrowse)
oCol := oBrw:AddCol()
oCol:bStrData := aBrowse[ i, 1 ]
oCol:cHeader := aBrowse[ i, 2 ]
oCol:nWidth := aBrowse[ i, 3 ]
oCol:nDataStrAlign := aBrowse[ i, 4 ]
oCol:nHeadStrAlign := aBrowse[ i, 4 ]
NEXT
oBrw:SetADO( oRs )
oBrw:CreateFromCode()
oBrw:nRowHeight := 21
oBrw:nHeaderHeight := 36
@ oBrw:nBottom+1,20 TABS oTab ;
OPTION nOrder SIZE oDlg:nWidth()-50, 12 PIXEL OF oDlg ;
ITEMS ' First ', ' Last ' ;
ACTION ( nOrder := oTab:nOption ,;
if( norder=1, oRs:Sort := 'ID' ,oRs:Sort := 'COGNOME' ),;
oRs:MoveFirst() ,;
oBrw:Refresh(.t.) )
ACTIVATE DIALOG oDlg
RETURN NIL
[/code:4wkyq5oc]
|
Another for MDB recorset
|
Please insert this line
oRs:CursorLocation := 3
just after creating the recordset object
[code:3kp2lrdl]
oRs = CREATEOBJECT( "ADODB.Recordset" )
oRs:CursorLocation := 3 // insert this line here
TRY
[/code:3kp2lrdl]
Now please try
|
Another for MDB recorset
|
thanks now run ok
|
Another for MDB recorset
|
THE PROBLEM IS ANOTHER :
NOW i MUST SORT ON TWO FIELD :
if( norder=1, oRs:Sort := 'ID' ,oRs:Sort := 'COGNOME' ),;
BUT IF i MUST SORT ON MANY FIELDS HOW i CAN MAKE ?
i NEED CREATE SOMETHING OF
@ oBrw:nBottom+1,20 TABS oTab ;
OPTION nOrder SIZE oDlg:nWidth()-50, 12 PIXEL OF oDlg ;
ITEMS ' CODICE ', ' COGNOME ' ;
ACTION ( nOrder := oTab:nOption ,[b:tbg7wy2x]oRs:sort:=nOrder[/b:tbg7wy2x];
oRs:MoveFirst() ,;
oBrw:Refresh(.t.) )
|
Another for MDB recorset
|
oRs:Sort := "ID,COGNOME"
|
Another for MDB recorset
|
ok but I have a variable norder
and this variable I must use with Tab noption
the sort read only the field name oRs:sort:="Id,cognome,nome"
but there is not a command to sort on number of field ?
sample
oRs:sort=norder
I cannot use the fieldname because i must rewrite each program
|
Another for MDB recorset
|
>
but there is not a command to sort on number of field ?
>
NO
>
oRs:sort=norder
>
Instead, you create an array of sort orders. example:
aOrders := { "ID", "ONE,TWO", "ID,NAME DESC", .... }
then depending on the option, say oRs:Sort := aOrders[oTabs:nOption]
|
Another for MDB recorset
|
ok this is a good idea i try to improved it
|
Another for MDB recorset
|
ok this run ok
[code:218uxccn]
#include "FiveWin.ch"
#include "Splitter.ch"
STATIC oDb, oRs
FUNCTION Customer()
LOCAL aBrowse
LOCAL nSplit :=102
LOCAL nOrder :=1
LOCAL nRecno :=1
LOCAL oDlg,oFont,oTab
Local aOrders := { "ID", "NOME", "COGNOME", "CITTA" }
oRs = CREATEOBJECT( "ADODB.Recordset" )
oRs:CursorLocation := 3 // insert this line here
TRY
oRs:Open( "SELECT * FROM Utenti ORDER BY COGNOME", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=ecom.mdb", 1, 3 )
CATCH oErr
? oErr:Description
RETURN NIL
END TRY
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-12
DEFINE DIALOG oDlg from 2,4 to 24,80;
TITLE "test xbrowse with tabs with MDB" ;
FONT oFont
oBrw := TXBrowse():New( oDlg )
WITH OBJECT oBrw
:nTop := 10
:nLeft := 20
:nBottom := 150
:nRight := 300
END
aBrowse := { { { || STR( oRs:Fields( "ID" ):Value) }, i18n("Codice"), 50, 0 },;
{ { || oRs:Fields( "Nome" ):Value }, i18n("Nome"), 150, 0 },;
{ { || oRs:Fields( "Cognome" ):Value}, i18n("Cognome"), 150, 0 },;
{ { || oRs:Fields( "Via" ):Value} , i18n("Indirizzo"), 150, 0 } ,;
{ { || oRs:Fields( "Civico" ):Value} , i18n("Civico"), 150, 0 },;
{ { || oRs:Fields( "Citta" ):Value} , i18n("Città"), 150, 0 } ,;
{ { || oRs:Fields( "Provincia" ):Value} , i18n("Prov"), 150, 0 }}
FOR i := 1 TO Len(aBrowse)
oCol := oBrw:AddCol()
oCol:bStrData := aBrowse[ i, 1 ]
oCol:cHeader := aBrowse[ i, 2 ]
oCol:nWidth := aBrowse[ i, 3 ]
oCol:nDataStrAlign := aBrowse[ i, 4 ]
oCol:nHeadStrAlign := aBrowse[ i, 4 ]
NEXT
oBrw:SetADO( oRs )
oBrw:CreateFromCode()
oBrw:nRowHeight := 21
oBrw:nHeaderHeight := 36
@ oBrw:nBottom+1,20 TABS oTab ;
OPTION nOrder SIZE oDlg:nWidth()-50, 12 PIXEL OF oDlg ;
ITEMS ' CODICE ', 'NOME' ,'COGNOME';
ACTION ( nOrder := oTab:nOption ,;
oRs:Sort := aOrders[oTab:nOption],;
oRs:MoveFirst() ,;
oBrw:Refresh(.t.) )
ACTIVATE DIALOG oDlg
RETURN NIL
[/code:218uxccn]
|
Another for Sockserv and sockcli
|
I understood that there is an sample called sockserv.prg
One time I run the exe it listen if there are oclients on lan ( sockcli.prg)
I understood I must make an array to save all client is connected to server ( I must save the nsocket, the name and the ip of client)
The server before must connect to one oclient and then can called this oclient with msg the oclient. ok
this because the server is connected with the last oclient connected to server
there are many problems I not understood also ....
for a sample I not understood how a client can send a msg with another oclent
Another thing ...If it is true that for the communication via socket (tcip) between clients it always takes the server and the client I did not understand how it can run an application I found it on the internet called popmessenger which uses the tcip protocol and has the ports inserted and the IP address but I do not see any server program (<!-- m --><a class="postlink" href="http://www.leadmind.com">http://www.leadmind.com</a><!-- m -->)
|
Another for date Range
|
Dear Friend,
Look this please
[img:s8i756zd]http://img823.imageshack.us/img823/7321/errport1.jpg[/img:s8i756zd]
the procedure does not show exactly the right reservation
on My archive I have the room n. 7 has a different date range
[img:s8i756zd]http://img822.imageshack.us/img822/7908/arch1jv.jpg[/img:s8i756zd]
Why it show other dates ?
I explain You
I have RESERVA->CHECK_IN and RESERVA->CHECK_OUT on reserva.dbf and I must show the reservation
the final user can select the dates fron datepich control , the datepich are on the ribbonbar ( I select from 23.02.2013 to 23.02.2013)
when I show the bitmaps I made a dbseek on number of room to se the state of each room
IF RESERVA->( DbSeek( nRoom ) )
and then
IF DToS( RESERVA->CHECK_OUT ) > DToS( dStart ) .AND. DToS( RESERVA->CHECK_IN ) < DToS( dEnd )
nStato:= val(RESERVA->STATUS)
endif
ELSE
nStato:= 0
ENDIF
I tried also with
IF (DToS( RESERVA->CHECK_IN ) >= DToS( dStart ) .AND. DToS( RESERVA->CHECK_IN ) <= DToS( dEnd ) ) .OR.;
(DToS( RESERVA->CHECK_OUT ) >= DToS( dStart ) .AND. DToS( RESERVA->CHECK_OUT ) <= DToS( dEnd ))
but it make error !!!! ( the same)
|
Another for fwstring
|
I saw the fwstring not show the character & for the button .... why ?
[img:37m23l36]http://img820.imageshack.us/img820/7527/4v6g.jpg[/img:37m23l36]
|
Another free 32 Bit Resource-Editor ( maybe useful ? )
|
Hello,
I had a look at a 32 Bit-Resource-editor I found.
For the Moment, I don`t have the Time, to test it ( to big )
Some Futures are included, I didn't see before ( visual design ).
Maybe useful for FWH-users ( it seems, Assembler-Source and Resources are included ) ?
No problem, to import BCC-Rc-files.
[color=#FF0000:flokqb0l]Features.
The resource editor handles the following resource types:
? Dialogs with more than 30 defined windows controls.
? Menus.
? String tables.
? Accelerator tables.
? Version info.
? Language setting.
? Resources like bitmaps, icons, manifest and several others.
? Unlimitted Undo / Redo on dialog editor.
? No installation needed.
? Visual dialog editor.
? Custom controls.[/color:flokqb0l]
<!-- m --><a class="postlink" href="http://www.oby.ro/rad_asm/resed/index.html">http://www.oby.ro/rad_asm/resed/index.html</a><!-- m -->
[img:flokqb0l]http://www.pflegeplus.com/pictures/resedit.jpg[/img:flokqb0l]
[img:flokqb0l]http://www.pflegeplus.com/pictures/resource6.jpg[/img:flokqb0l]
[img:flokqb0l]http://www.pflegeplus.com/pictures/resstyle1.jpg[/img:flokqb0l]
[img:flokqb0l]http://www.pflegeplus.com/pictures/resstyle2.jpg[/img:flokqb0l]
Have a look at the Help-files, before You start, there are many possible settings :
[img:flokqb0l]http://www.pflegeplus.com/pictures/resource7.jpg[/img:flokqb0l]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
Another free 32 Bit Resource-Editor ( maybe useful ? )
|
Uwe,
Very good, thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Already available from FiveWin Contributions site:
[url:4jzh2qva]http://code.google.com/p/fivewin-contributions/downloads/list[/url:4jzh2qva]
[url:4jzh2qva]http://code.google.com/p/fivewin-contributions/downloads/detail?name=ResEd.zip&can=2&q=[/url:4jzh2qva]
|
Another historic moment in Harbour ...
|
Hi !,
Today connected the group of mod Harbour and commmanded by Mr. Antonio we have entered the dimension of being able to debug at the harbour code level with Visual Code.
Simply spectacular !
C.
|
Another historic moment in Harbour ...
|
1. Download and install Visual Studio Community from here:
[url:266s5z2o]https://visualstudio.microsoft.com/vs/community/[/url:266s5z2o]
2. git clone <!-- m --><a class="postlink" href="https://github.com/FiveTechSoft/harbour_app_msvc64_sources">https://github.com/FiveTechSoft/harbour ... 64_sources</a><!-- m -->
3. Double click on the Harbour_app.sln file
4. Search for hb_vmInit() from the solution explorer and set a breakpoint there
5. Click on run and see Harbour working internally <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Another historic moment in Harbour ...
|
[url:123vs0mz]https://youtu.be/VYA7B1otyVo[/url:123vs0mz]
|
Another more about RPreview and Image2PDF
|
Hello friends of the forum.
I've been testing the evaluation Image2PDF DLL, I made use of "RPrevUserBtns" from the main program for which I work on all reports and works well:
[code=fw:rpz5k7hs]<div class="fw" id="{CB}" style="font-family: monospace;">RPrevUserBtns<span style="color: #000000;">(</span> <span style="color: #000000;">{</span> | oPrev, oBar | MyButtons<span style="color: #000000;">(</span> oPrev, oBar <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> && Botones adicionales<br /><br />...<br /><br /><span style="color: #00C800;">FUNCTION</span> MyButtons<span style="color: #000000;">(</span> oPreview, oBar <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"PDF"</span> <span style="color: #0000ff;">ACTION</span> SavePDF<span style="color: #000000;">(</span> oPreview:<span style="color: #000000;">oDevice</span> <span style="color: #000000;">)</span> ;<br /> TOOLTIP <span style="color: #ff0000;">"Generar archivo PDF"</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Email"</span> <span style="color: #0000ff;">ACTION</span> Send2Email<span style="color: #000000;">(</span> oPreview <span style="color: #000000;">)</span> ;<br /> TOOLTIP <span style="color: #ff0000;">"Enviar en email como archivo PDF adjunto"</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:rpz5k7hs]
The code to use with Image2PDF (Posted below) only converts the text of the report, I can not see images in the preview, this is because the evaluation version or there is an error?
Someone has done a completely Image2PDF, I can help.
[code=fw:rpz5k7hs]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> SavePDF<span style="color: #000000;">(</span> oDevice, cMyNombrePDF <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> error, hLibImg2PDF<br /> <span style="color: #00C800;">LOCAL</span> imageFilename:=<span style="color: #ff0000;">" "</span><br /> <span style="color: #00C800;">LOCAL</span> cPdfFilename<br /> <span style="color: #00C800;">LOCAL</span> nI, iErr:=<span style="color: #000000;">0</span><br /> <span style="color: #00C800;">LOCAL</span> aFiles:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span>, cTemp<br /><br /> cPdfFileName:= oApp:<span style="color: #000000;">Path_PDF</span> + oDevice:<span style="color: #000000;">cDocument</span> + <span style="color: #ff0000;">".Pdf"</span><br /> aFiles:=oDevice:<span style="color: #000000;">aMeta</span><br /> hLibImg2PDF:=LoadLib32<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Image2PDF"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> ValType<span style="color: #000000;">(</span>aFiles<span style="color: #000000;">)</span>==<span style="color: #ff0000;">"A"</span><br /> I2PDF_License<span style="color: #000000;">(</span><span style="color: #ff0000;">"LICENCIA"</span><span style="color: #000000;">)</span><br /> iErr:=IPMeta<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// Flag that his is a meta file</span><br /> iErr:=IPSize<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// Reset the size</span><br /> iErr:=IPMetaAdjustText<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> iErr:=IPSetDPI<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// Set DPI to the default for PDF's. It works better</span><br /> <span style="color: #00C800;">FOR</span> nI:=<span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> Len<span style="color: #000000;">(</span>aFiles<span style="color: #000000;">)</span> <span style="color: #B900B9;">// Build the pages using the array of temp files</span><br /> CursorWait<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> imageFilename:=aFiles<span style="color: #000000;">[</span>nI<span style="color: #000000;">]</span><br /> iErr:=IPAddImg<span style="color: #000000;">(</span>imageFilename<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">NEXT</span> nI<br /> CursorWait<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> iErr:=IPMakePDF<span style="color: #000000;">(</span>cPdfFileName,<span style="color: #000000;">0</span>,error,<span style="color: #000000;">40</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// Create the PDF.</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> FreeLib32<span style="color: #000000;">(</span>hLibImg2PDF<span style="color: #000000;">)</span><br /> CursorArrow<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> cMyNombrePDF != <span style="color: #00C800;">NIL</span><br /> cMyNombrePDF := cPdfFileName<br /> <span style="color: #00C800;">ELSE</span><br /> <span style="color: #00C800;">IF</span> !File<span style="color: #000000;">(</span>cPdfFileName<span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"No se generó el archivo PDF."</span>,<span style="color: #ff0000;">"Información!"</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span><br /> ShellExecute<span style="color: #000000;">(</span>,<span style="color: #ff0000;">"Open"</span>,cPdfFileName,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\"</span>,.T.)<br /> ENDIF<br /> ENDIF<br /> <br />RETURN (NIL)<br /><br />//--- Wrappers ---------------------------------------------------------------//<br /><br /> DLL32 STATIC FUNCTION I2PDF_License( code AS LPSTR) AS LONG;<br /> PASCAL FROM "</span>I2PDF_License<span style="color: #ff0000;">" LIB "</span>IMAGE2PDF.dll<span style="color: #ff0000;">"<br /><br /> DLL32 STATIC FUNCTION IPMeta( ) AS LONG;<br /> PASCAL FROM "</span>I2PDF_MetaToNativePDF<span style="color: #ff0000;">" LIB "</span>Image2PDF.dll<span style="color: #ff0000;">"<br /><br /> DLL32 STATIC FUNCTION IPMetaAdjustText() AS LONG;<br /> PASCAL FROM "</span>I2PDF_MetaTextFitBoundingRect<span style="color: #ff0000;">" LIB "</span>Image2PDF.dll<span style="color: #ff0000;">"<br /><br /> DLL32 STATIC FUNCTION IPSize( ) AS LONG;<br /> PASCAL FROM "</span>I2PDF_UseEMFDeviceSize<span style="color: #ff0000;">" LIB "</span>Image2PDF.DLL<span style="color: #ff0000;">"<br /><br /> DLL32 STATIC FUNCTION IPAddImg( cImage AS LPSTR ) AS LONG;<br /> PASCAL FROM "</span>I2PDF_AddImage<span style="color: #ff0000;">" LIB "</span>Image2PDF.dll<span style="color: #ff0000;">"<br /><br /> DLL32 STATIC FUNCTION IPSetDpi( nDpi AS LONG ) AS LONG;<br /> PASCAL FROM "</span>I2PDF_SetDPI<span style="color: #ff0000;">" LIB "</span>Image2PDF.dll<span style="color: #ff0000;">"<br /><br /> DLL32 STATIC FUNCTION IPMakePDF( cOutFile AS LPSTR, nOptions AS LONG, cErrTxt AS LPSTR, nMaxESize AS LONG ) AS LONG;<br /> PASCAL FROM "</span>I2PDF_MakePDF<span style="color: #ff0000;">" LIB "</span>Image2PDF.dll<span style="color: #ff0000;">"<br /><br /> DLL32 FUNCTION COPYFILE( cExistName AS LPSTR, cNewName AS LPSTR, nFailIfExist AS LONG ) AS BOOL;<br /> PASCAL FROM "</span>CopyFileA<span style="color: #ff0000;">" LIB "</span>kernel32.dll<span style="color: #ff0000;">"<br /><br /> DLL32 FUNCTION xI2PDF_BatesFormat( format AS LPSTR ) AS LONG;<br /> PASCAL FROM "</span>I2PDF_BatesFormat<span style="color: #ff0000;">" LIB "</span>Image2PDF.dll<span style="color: #ff0000;">"<br /><br /> DLL32 FUNCTION xI2PDF_BatesLocation( verticalPosition AS LONG, horizontalPosition AS LONG, orientation AS LONG, margin AS LONG) AS LONG;<br /> PASCAL FROM "</span>I2PDF_BatesLocation<span style="color: #ff0000;">" LIB "</span>Image2PDF.dll<span style="color: #ff0000;">"<br /><br /> DLL32 FUNCTION xI2PDF_BatesFont_Int( iSize AS LONG, FontID AS LPSTR, fillRed AS LONG, fillGreen AS LONG, fillBlue AS LONG, iStyle AS LONG, otherRed AS LONG, otherGreen AS LONG, otherBlue AS LONG) AS LONG;<br /> PASCAL FROM "</span>I2PDF_BatesFont_Int<span style="color: #ff0000;">" LIB "</span>Image2PDF.dll<span style="color: #ff0000;">"<br /><br /> DLL32 FUNCTION xI2PDF_BatesBackground_Int( shape AS LONG, bkRed AS LONG, bkGreen AS LONG, bkBlue AS LONG, borderRed AS LONG, borderGreen AS LONG, borderBlue AS LONG ) AS LONG;<br /> PASCAL FROM "</span>I2PDF_BatesBackground_Int<span style="color: #ff0000;">" LIB "</span>Image2PDF.dll<span style="color: #ff0000;">"<br /></span></div>[/code:rpz5k7hs]
Thanks in advance.
Best regards <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
|
Another more about RPreview and Image2PDF
|
Hello again
I just wanted to make mention that the images, are on the same page.
I know I can add pictures in a different page.
With the instruction:
[code=fw:2tp9d63n]<div class="fw" id="{CB}" style="font-family: monospace;">iErr:=IPAddImg<span style="color: #000000;">(</span>imageFilename<span style="color: #000000;">)</span></div>[/code:2tp9d63n]
Sooner or later, but I need the image is on the same page.
Thanks in advance.
Best regards <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
|
Another more about RPreview and Image2PDF
|
There is no problem having images in the same page , i don't know about ehe evaluation version , maybe ...
try adding this
iErr := I2PDF_MetaToNativePDF()
iErr := I2PDF_MetaTextFitBoundingRect()
iErr := I2PDF_UseEMFDeviceSize( )
iErr := I2PDF_SetDPI(0) // Set PDF DPI to the same as the image
iErr := I2PDF_MetamMargins()
I use Image2pdf since several years and it is an excellent product
HTH
Richard
|
Another more about RPreview and Image2PDF
|
Richard, I appreciate your time.
Try suggesting, not turned, and still more, download the trial version 2.52, and neither, I will be inclined to think that being a demo.
Yet despite that, engaging in the purchase.
Best regards
|
Another more about RPreview and Image2PDF
|
hola
necesito convertir wmf a pdf, pero en este codigo no veo como enviar el oPreview...¿?
alguien tiene el codigo completo
gracias
saludos
|
Another problem with Btnbmp
|
I use btnbmp to open a Selection as you can see on this snapshot
[img:3g8euama]https://i.postimg.cc/9MDvNzgL/ttttt.png[/img:3g8euama]
when I click on btnbmp is on the dialog lookup return this error
this is the error
[code=fw:3g8euama]<div class="fw" id="{CB}" style="font-family: monospace;">Application<br />===========<br /> Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">C</span>:\Work\Errori\Numeri_Ombrelloni_sezione\test.Exe <span style="color: #000000;">(</span><span style="color: #000000;">32</span> bits<span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">Size</span>: <span style="color: #000000;">3</span>,<span style="color: #000000;">994</span>,<span style="color: #000000;">624</span> bytes<br /> Compiler version: <span style="color: #000000;">Harbour</span> <span style="color: #000000;">3.2</span>.0dev <span style="color: #000000;">(</span>r1904111533<span style="color: #000000;">)</span><br /> FiveWin version: <span style="color: #000000;">FWH</span> <span style="color: #000000;">20.04</span><br /> C compiler version: <span style="color: #000000;">Borland</span>/Embarcadero C++ <span style="color: #000000;">7.0</span> <span style="color: #000000;">(</span><span style="color: #000000;">32</span>-bit<span style="color: #000000;">)</span><br /> Windows version: <span style="color: #000000;">6.2</span>, Build <span style="color: #000000;">9200</span> <br /><br /> Time <span style="color: #0000ff;">from</span> start: <span style="color: #000000;">0</span> hours <span style="color: #000000;">0</span> mins <span style="color: #000000;">4</span> secs <br /> Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">06</span>/<span style="color: #000000;">11</span>/<span style="color: #000000;">20</span>, <span style="color: #000000;">10</span>:<span style="color: #000000;">03</span>:<span style="color: #000000;">52</span><br /> Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1004</span> No exported <span style="color: #00C800;">method</span>: <span style="color: #0000ff;">ACTIVATE</span><br /> Args:<br /> <span style="color: #000000;">[</span> <span style="color: #000000;">1</span><span style="color: #000000;">]</span> = U <br /> <span style="color: #000000;">[</span> <span style="color: #000000;">2</span><span style="color: #000000;">]</span> = N <span style="color: #000000;">42</span><br /> <span style="color: #000000;">[</span> <span style="color: #000000;">3</span><span style="color: #000000;">]</span> = N <span style="color: #000000;">34</span><br /> <span style="color: #000000;">[</span> <span style="color: #000000;">4</span><span style="color: #000000;">]</span> = O TDIALOG<br /> <span style="color: #000000;">[</span> <span style="color: #000000;">5</span><span style="color: #000000;">]</span> = L .F.<br /><br />Stack Calls<br />===========<br /> Called <span style="color: #0000ff;">from</span>: => <span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">BTNBMP</span>.PRG => TBTNBMP:<span style="color: #000000;">LBUTTONUP</span><span style="color: #000000;">(</span> <span style="color: #000000;">981</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span> <span style="color: #000000;">1817</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">BTNBMP</span>.PRG => TBTNBMP:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span> <span style="color: #000000;">2043</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">(</span> <span style="color: #000000;">3559</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => DIALOGBOXINDIRECT<span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">(</span> <span style="color: #000000;">304</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">test2</span>.prg => TE</div>[/code:3g8euama]
here the test
[code=fw:3g8euama]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><br /><span style="color: #00C800;">Function</span> Test<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> oDlg,oBtnSel<br /> <span style="color: #00C800;">local</span> nElemento:=<span style="color: #000000;">35</span><br /> <span style="color: #00C800;">local</span> ctype:=<span style="color: #ff0000;">"01"</span><br /> <span style="color: #00C800;">local</span> dFirst:=date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> dLast:=date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">200</span><br /><br /> @ <span style="color: #000000;">07</span>,<span style="color: #000000;">17</span> <span style="color: #0000ff;">BTNBMP</span> oBtnSel FILENAME <span style="color: #ff0000;">"selbtn.png"</span>;<br /> FLAT <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">20</span>,<span style="color: #000000;">14</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg NOBORDER<br /><br /> oBtnSel:<span style="color: #000000;">oPopUp</span>:= <span style="color: #000000;">{</span> |oBtn| ElementiVicini<span style="color: #000000;">(</span>nElemento,ctype,dFirst,dLast,oBtn<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDLG<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> ElementiVicini<span style="color: #000000;">(</span>nElemento,ctype,dFirst,dLast,ocontrol<span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">local</span> abtn:=array<span style="color: #000000;">(</span><span style="color: #000000;">2</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Local</span> nBtnW :=<span style="color: #000000;">25</span><br /><span style="color: #00C800;">Local</span> nBtnH :=<span style="color: #000000;">15</span><br /><span style="color: #00C800;">local</span> nSelection:=<span style="color: #000000;">0</span><br /><span style="color: #00C800;">local</span> n:= <span style="color: #000000;">1</span><br /><span style="color: #00C800;">Local</span> nRow:=<span style="color: #000000;">10</span><br /><span style="color: #00C800;">Local</span> nCol:=<span style="color: #000000;">1</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">260</span>,<span style="color: #000000;">190</span><br /> <span style="color: #00C800;">for</span> n=<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">(</span>abtn<span style="color: #000000;">)</span><br /> @ nRow,nCol <span style="color: #0000ff;">BTNBMP</span> abtn<span style="color: #000000;">[</span>n<span style="color: #000000;">]</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> nBtnW,nBtnH FLAT <span style="color: #0000ff;">CENTER</span><br /> abtn<span style="color: #000000;">[</span>n<span style="color: #000000;">]</span>:<span style="color: #000000;">bAction</span> := <span style="color: #000000;">{</span> | o | nSelection := o:<span style="color: #000000;">Cargo</span>, oDlg:<span style="color: #000000;">end</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">next</span><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /> <span style="color: #00C800;">return</span> nSelection<br /> </div>[/code:3g8euama]
|
Another problem with Btnbmp
|
In the function ElementiVicini, declare oBtn as local variable
|
Another problem with Btnbmp
|
make the same
|
Another problem with TFolderEx
|
Hi,
again I've found a problem with TFolderEx. Everything right from and beneath the checkbox I go over with the mouse disappears.
It only happens with windows XP (and XP-Mode on Win7) using the classic design of windows XP and a manifest.
On Win7 with classic design it also happens if you first click checkbox "Test1" and then checkbox "Test2"
I guess there are some problems with the paint event, which also could have to do with my previously reported problem (which also still is unanswered), that it isn't possible to disable a label (say)
Who can help me solve these issues?
Dialog freshly painted
[img:2h6nwwhm]http://www.ctosoftware.de/images/stories/fivetech/checkbox-folderex1.jpg[/img:2h6nwwhm]
After going over Test2 on TFolderEx with mouse (or clicking Test1 / Button1):
[img:2h6nwwhm]http://www.ctosoftware.de/images/stories/fivetech/checkbox-folderex2.jpg[/img:2h6nwwhm]
My source code of a working example:
[code=fw:2h6nwwhm]<div class="fw" id="{CB}" style="font-family: monospace;"><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;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> oDlg, oFld<br /><span style="color: #00C800;">local</span> lCheck, lCheck2<br /><span style="color: #00C800;">local</span> oBtn1, oBtn2<br /><span style="color: #00C800;">local</span> oSay1<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">5</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">35</span>, <span style="color: #000000;">60</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"A Dialog Box"</span><br /><br /> @ <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">CHECKBOX</span> lCheck <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Test1"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">13</span><br /><br /> @ <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">BUTTON</span> oBtn1 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Button1"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"ButtonTest"</span><span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">4</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Hello"</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">75</span>, <span style="color: #000000;">10</span> FOLDEREX oFld <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">100</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Page 1"</span>, <span style="color: #ff0000;">"Page 2"</span>, <span style="color: #ff0000;">"Page 3"</span><br /><br /> @ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">CHECKBOX</span> lCheck2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Test2"</span> <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">13</span><br /> @ <span style="color: #000000;">2</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">SAY</span> oSay1 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Page 1"</span> <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br /> @ <span style="color: #000000;">3</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> oBtn2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Button1"</span> <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"ButtonTest"</span><span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">2</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Seite 2"</span> <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span><br /><br /> oSay1:<span style="color: #000000;">Disable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br /><span style="color: #00C800;">return</span> .t.<br /> </div>[/code:2h6nwwhm]
and the text in the manifest (just save it as example.exe.manifest if the example is called example.prg)
[code=fw:2h6nwwhm]<div class="fw" id="{CB}" style="font-family: monospace;"><?xml version=<span style="color: #ff0000;">"1.0"</span> encoding=<span style="color: #ff0000;">"UTF-8"</span> standalone=<span style="color: #ff0000;">"yes"</span>?><br /> <assembly xmlns=<span style="color: #ff0000;">"urn:schemas-microsoft-com:asm.v1"</span> manifestVersion=<span style="color: #ff0000;">"1.0"</span>><br /> <dependency><br /> <dependentAssembly><br /> <assemblyIdentity type=<span style="color: #ff0000;">"win32"</span> <span style="color: #0000ff;">name</span>=<span style="color: #ff0000;">"Microsoft.Windows.Common-Controls"</span> version=<span style="color: #ff0000;">"6.0.0.0"</span> processorArchitecture=<span style="color: #ff0000;">"*"</span> publicKeyToken=<span style="color: #ff0000;">"6595b64144ccf1df"</span> language=<span style="color: #ff0000;">"*"</span> /> <br /> </dependentAssembly><br /> </dependency><br /> </assembly><br /> </div>[/code:2h6nwwhm]
|
Another problem with dialog boxes
|
Hello,I have a very strange problem with dialog boxes. The dialog boxes are build from resources.The code looks like this :[code:qtfuif89]PRIVATE LnDlg,ClkDlg
......
DEFINE DIALOG LnDlg NAME ...
......
ACTIVATE DIALOG LnDlg NOWAIT ...
......
DEFINE DIALOG ClkDlg NAME ...
......
ACTIVATE DIALOG ClkDlg NOWAIT ...
[/code:qtfuif89]
At a certain point, one dialog box needs to be ended. To do this, I use :[code:qtfuif89]ClkDlg:End()[/code:qtfuif89]But what happens ? When the dialog box ClkDlg is ended here, the dialog box LnDlg is ended as well.I also noticed that the problem only occurs when ClkDlg is defined before LnDlg is defined. If LnDlg is defined before ClkDlg, then the problem doesn't occur.How can there be any connection between those dialog boxes ?Why does LnDlg end when ClkDlg is ended ?Thank you very much in advance for any help.
|
Another problem with dialog boxes
|
Michel,You are using private variables and non modal dialogboxes. As they are non modal, the execution of the PRG does not stop there and you exit from your function and those private variables get destroyed.Please change those private variables into static variables
|
Another problem with dialog boxes
|
Antonio,Thanks for your quick answer.I defined those variables as PRIVATE right at the start of my main program. Is that not the same as a STATIC variable ?I'll try your suggestion and I let you know the outcome.Thanks a lot.
|
Another problem with dialog boxes
|
Michel,Then use public variables
|
Another problem with dialog boxes
|
Antonio,I changed the PRIVATE variables first to STATIC variables.At the ClkDlg:End(), I got an error that "Variable ClkDlg doesn't exist".Then I changed those variables to PUBLIC variables but than the behaviour is just the same as it was with PRIVATE variables.What now ?Thanks.
|
Another problem with dialog boxes
|
Michel,Could you provide me a small example to test here ? thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Another problem with dialog boxes
|
Antonio,I wish I could provide you with a example.It a some very small parts of a huge application (more than 120.000 lines of code). Second problem that OLE is involved (for a connection with Word).I'll try to give some more explanation :ClkDlg is a small dialogbox. In combination, a timer is started for the user to know the time he has been using for a certain job. The dialogbox is used to end the clock and a registration of the time used is saved into a timesheet.While the timer is running, a document in Word can be made. During the time, the document in Word is active, a small dialogbox is defined which contains some buttons for the user to be able to close Word and to save the document into the archive of the system.So a small summary :1. The clock is started (ClkDlg).2. Word is starten through OLE with its dialog box (LnDlg).3. ClkDlg is clicked to halt the time and the time used is registered.4. And now, I notice that LnDlg has disappeared too (I found out through the debugger that LnDlg is closed at the instruction ClkDlg:End() )In this case the problem does NOT happen :1. Word is starten through OLE with its dialog box (LnDlg).2. The clock is started (ClkDlg).3. ClkDlg is clicked to halt the time and the time used is registered.4. LnDlg is still available.Do you have any idea ?Thanks.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.