topic
stringlengths
1
63
text
stringlengths
1
577k
Checkboxes disappear pressing ALT in Vista
Gilbert, Already sent the EXE to your email
Checkboxes in specific xbrowse column?
Hi, How do I show standard checkboxes in a [b:1tu7le5m]specific[/b:1tu7le5m] xbrowse column?
Checkboxes in specific xbrowse column?
[code=fw:2ihtjl7y]<div class="fw" id="{CB}" style="font-family: monospace;">oCol:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#91;</span>aBmps<span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#91;</span>lEdit<span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#91;</span>aPrompts<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span></div>[/code:2ihtjl7y]
Checkboxes in specific xbrowse column?
Thanks !
Checkboxes of root nodes!?
Antonio and friends,Exists a way to do for remove the checkbox of the root nodes?In the image below, the checkboxes with red circle, need be removed! It's possible?[img:2yavxybk]http&#58;//lh3&#46;ggpht&#46;com/ferreira&#46;together/SNTzWYLl_ZI/AAAAAAAAALs/ZZDCMh_NMOA/s800/tree&#46;JPG[/img:2yavxybk]
Checkboxes of root nodes!?
Júlio,Please provide a working PRG to test, thanks
Checkboxes of root nodes!?
[quote="Antonio Linares":1uytbcx9]Júlio, Please provide a working PRG to test, thanks[/quote:1uytbcx9]Antonio,Please take it at <!-- m --><a class="postlink" href="http://rapidshare.com/files/154237267/TestTree.zip.html">http://rapidshare.com/files/154237267/TestTree.zip.html</a><!-- m -->
Checkboxes of root nodes!?
A little sample to provide any idea![img:czbyjd3d]http&#58;//www&#46;craigmurphy&#46;com/blog/wp-content/uploads/2006/04/treeview&#46;gif[/img:czbyjd3d]
Checkboxes of root nodes!?
Antonio,This is possible to do?
Checkboxes of root nodes!?
Julio,Please review this thread:<!-- m --><a class="postlink" href="http://forums.fivetechsoft.com/viewtopic.php?t=7047">http://forums.fivetechsoft.com/viewtopic.php?t=7047</a><!-- m -->
Checkboxes of root nodes!?
[quote="Antonio Linares":3pkphjt1]Julio, Please review this thread: <!-- m --><a class="postlink" href="http://forums.fivetechsoft.com/viewtopic.php?t=7047">http://forums.fivetechsoft.com/viewtopic.php?t=7047</a><!-- m -->[/quote:3pkphjt1]Antonio,Yes, I have looked your example but it's not my intention!I got it put in the correct format, with checkboxes... really, it's very simple...Now, I want to change this option into class or via codification.I have sent to you a wrong example. I'm sorry!At all node, when it's a root node, in this item I want to not display the checkboxes... like the image above! The checkboxes only in sub-items of all items of treeview.Please, look this image below to explanation:[img:3pkphjt1]http&#58;//lh6&#46;ggpht&#46;com/ferreira&#46;together/SPctBchVREI/AAAAAAAAAMU/JdQ5LSEAJH4/s800/treeview&#46;gif[/img:3pkphjt1]
Checkboxes of root nodes!?
Nobody? Any idea?
Checked menuitem
Hi, Why do menu items with checks appear with the check in a border? [img:29v4hyaj]http&#58;//home&#46;quicksoftware&#46;co&#46;za/menu&#46;jpg[/img:29v4hyaj] Also, is there a way to "bullet" a menu item, like the view menu in windows explorer? Alex
Checked menuitem
Alex, Please comment out this line in source\winapi\menus.c line 295: [code:3ruicgvc] if&#40; lpdis->itemState & ODS_CHECKED &#41; &#123; HBITMAP hBmp = LoadBitmap&#40; 0, MAKEINTRESOURCE&#40; OBM_CHECK &#41; &#41;; if&#40; ! &#40; lpdis->itemState & ODS_SELECTED &#41; &#41; DrawGrayed&#40; lpdis->hDC, hBmp, lpdis->rcItem&#46;top + 1, lpdis->rcItem&#46;left + 1 &#41;; else DrawMasked&#40; lpdis->hDC, hBmp, lpdis->rcItem&#46;top + 1, lpdis->rcItem&#46;left + 1 &#41;; DeleteObject&#40; hBmp &#41;; // WindowInset&#40; lpdis->hDC, &rct &#41;; HERE! &#125; [/code:3ruicgvc] We have to implement the bullet option.
Checked menuitem
Hi, What #defines do I need to compile this? Compiling fails using Xhb Tried WIN32 Alex
Checked menuitem
Alex, We email you the modified library for your review, thanks.
Checked menuitem
It seems that there is still a light grey background under the check sign. EMG
Checked menuitem
Enrico, Please try this: [code:2sur9ld0] if&#40; lpdis->itemState & ODS_CHECKED &#41; &#123; HBITMAP hBmp = LoadBitmap&#40; 0, MAKEINTRESOURCE&#40; OBM_CHECK &#41; &#41;; DrawMasked&#40; lpdis->hDC, hBmp, lpdis->rcItem&#46;top + 1, lpdis->rcItem&#46;left + 1 &#41;; DeleteObject&#40; hBmp &#41;; &#125; [/code:2sur9ld0]
Checked menuitem
Can you send me the new lib, please? EMG
Checked menuitem
Hi, I've gotten menus.c to compile, and highlighted menu items are ok, but unhighlighted items still have the gray background?
Checked menuitem
Alex, Are you still using DrawMasked() ? If yes, does your bitmap has the transparent color at pixel 0, 0 ? Please post a screenshot of the bitmap and how it looks in the menu. Thanks
Checked menuitem
Hi, This is the gray background of unselected menu items, as below [img:wy8mp9bw]http&#58;//home&#46;quicksoftware&#46;co&#46;za/menuitems&#46;jpg[/img:wy8mp9bw]
Checked menuitem
Alex, Are those menuitems "checked" ?
Checked menuitem
Yes, they are <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Checked menuitem
Alex, Please make this change in your menus.c: [code:dxhlu1sb] if&#40; lpdis->itemState & ODS_CHECKED &#41; &#123; HBITMAP hBmp = LoadBitmap&#40; 0, MAKEINTRESOURCE&#40; OBM_CHECK &#41; &#41;; DrawMasked&#40; lpdis->hDC, hBmp, lpdis->rcItem&#46;top + 1, lpdis->rcItem&#46;left + 1 &#41;; DeleteObject&#40; hBmp &#41;; &#125; [/code:dxhlu1sb]
Checked menuitem
Did that change from your earlier post. Selected items are ok, unselected are not
Checked menuitem
Alex, You are using white as the menu color, please select another menu color and check if that makes a difference, thanks
Checking GetLastError() from C
Sometimes we have the need to check the value that returns Windows GetLastError(), so this code is required: [code=fw:30o6563u]<div class="fw" id="{CB}" style="font-family: monospace;">void ShowErrorTxt<span style="color: #000000;">&#40;</span> DWORD dwError <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   LPVOID lpMsgBuf;<br />   char buffer<span style="color: #000000;">&#91;</span> <span style="color: #000000;">6</span> <span style="color: #000000;">&#93;</span>;<br /><br />   FormatMessage<span style="color: #000000;">&#40;</span> FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,<br />                  <span style="color: #00C800;">NULL</span>,<br />                  dwError,<br />                  MAKELANGID<span style="color: #000000;">&#40;</span> LANG_NEUTRAL, SUBLANG_DEFAULT <span style="color: #000000;">&#41;</span>, <span style="color: #B900B9;">// Default language</span><br />                  <span style="color: #000000;">&#40;</span> LPTSTR <span style="color: #000000;">&#41;</span> &lpMsgBuf,<br />                  <span style="color: #000000;">0</span>,<br />                  <span style="color: #00C800;">NULL</span> <span style="color: #000000;">&#41;</span>;<br />   sprintf_s<span style="color: #000000;">&#40;</span> buffer, <span style="color: #ff0000;">"%i"</span>, dwError <span style="color: #000000;">&#41;</span>;<br />   MessageBox<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">&#40;</span> char * <span style="color: #000000;">&#41;</span> lpMsgBuf, buffer, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>;               <br />   LocalFree<span style="color: #000000;">&#40;</span> lpMsgBuf <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span></div>[/code:30o6563u] I post it here so it is usefull for all and I can find it next time <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Checking Windows Service
Is there a function to test and see if a windows service is running or not?
Checking Windows Service
You can try this (from my notes)--I don't know if it will work. [code=fw:29ks0kln]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// Check whether the application is already running in the same PC </span><br /><span style="color: #00C800;">if</span> IsExeRunning<span style="color: #000000;">&#40;</span> cFileName<span style="color: #000000;">&#40;</span> HB_ARGV<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;MsgWait<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"This application is already running"</span>, <span style="color: #ff0000;">"Application Name"</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;Quit <br /><span style="color: #00C800;">endif</span></div>[/code:29ks0kln]
Checking Windows XP sp.3
Hi,Microsoft just released the Windows XP's service pack 3.Is there any way to detect it ? I always detected the windows version using the version in the registry but in this case it is the same of the service pack 2 (5.1.2600).Thanks in advance
Checking Windows XP sp.3
Solved using oSystemInfo:csp
Checking changes in folder
Hi,I need to check if the value of some controls (get, combobox..) in a folder has changed in order to request a confirm to the customer before exit.Due the outlook interface I am using the customer can loose the data simply selecting another record so a confirm exit is needed.See image at <!-- w --><a class="postlink" href="http://www.softwarexp.co.uk/beta/sample.jpg">www.softwarexp.co.uk/beta/sample.jpg</a><!-- w -->I made the following routine to check it that providing the oFld as parameter will scan all GET controls inside and check the ::oGet:Changed() value.Function CheckChanged(oFld) local aArray,i,n,nPrompts,lChanged lChanged:=.f. nPrompts:=len(oFld:aPrompts) for n:=1 to nPrompts aArray:=oFld:aDialogs[n]:aControls for i:=1 to len(aArray) if oFld:aDialogs[n]:aControls[i]:Classname="TGET" if oFld:aDialogs[n]:aControls[i]:oGet:Changed() lChanged:=.t. && has changed exit endif endif next next return(lChanged)The problem is that I only can check changes in GET controls but I need to check the combobox and tcbrowse also. Any ideas to make this ? As I know the ::Changed() data is only applied on GET controls.Thanks iin advance.
Checking changes in folder
Marco,This is the way I do this check :[code:tljo7nna] LOCAL cFIELD1, oFIELD1 LOCAL cFIELD2, oFIELD2 &#46;&#46;&#46;&#46; cFIELD1 &#58;= oFIELD1 &#58;= FILE->FIELD1 cFIELD2 &#58;= oFIELD2 &#58;= FILE->FIELD2 &#46;&#46;&#46;&#46; DEFINE DIALOG &#46;&#46;&#46;&#46; &#46;&#46;&#46;&#46; REDEFINE GET cFIELD1 ID 101 OF &#46;&#46;&#46;&#46; REDEFINE CHECKBOX cFIELD2 ID 102 OF &#46;&#46;&#46;&#46; &#46;&#46;&#46;&#46; ACTIVATE DIALOG &#46;&#46;&#46;&#46; IF cFIELD1 = oFIELD1 &#46;AND&#46; cFIELD2 = oFIELD2 &#46;&#46;&#46;&#46; data has not been changed &#46;&#46;&#46;&#46; ELSE &#46;&#46;&#46;&#46; data has been changed &#46;&#46;&#46;&#46; ENDIF [/code:tljo7nna]It doesn't matter what the kind of cFIELD1 or cFIELD2 is : a GET, a CHECKBOX, a RADIO BUTTON, ...It always works.Good luck
Checking changes in folder
Hi Driessen,you are right but I have a lot of variables to check so I would like find an automatic check without manage each control.
Checking changes in folder
Marco,Do you use a Class TDataBase for fields editing ?If yes, then you can simply check oDataBase:Modified() <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Checking changes in folder
[quote="Antonio Linares":2enc0qlu]Marco, Do you use a Class TDataBase for fields editing ? If yes, then you can simply check oDataBase:Modified() <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->[/quote:2enc0qlu]Unfortunately that data file is not in a dbf format.
Checking changes in folder
Marco,If you use locals, then I am thinking that we could implement an easy and very powerfull solution <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->if you keep the locals together, then we could step through them and build an array from them, and later on, compare the original values with the array. Thats what Class TDataBase does basically.There are some functions in [x]Harbour to step through the local variables by their position (order) and no by its name. So it can be done <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Checking changes in folder
Marco,Here you have a working sample. It can be very much simplified, as I have included some code so testers can understand the virtual machine stack structure. Also the "locals" checker code could be placed into an external function:[code:1jsx704x] #include "FiveWin&#46;ch" function Main&#40;&#41; Test&#40; "one", "two", "three" &#41; return nil function Test&#40; x, y, z &#41; local local1 &#58;= "first", local2 &#58;= "second", aBegin &#58;= HB_DBG_VMSTKLLIST&#40;&#41;, aEnd, n MsgInfo&#40; "Name of the function&#58; " + aBegin&#91; 1 &#93; &#41; MsgInfo&#40; "Is this a function or a method ? " + If&#40; aBegin&#91; 2 &#93; != nil, "Method", "function" &#41; &#41; for n = 1 to PCount&#40;&#41; MsgInfo&#40; "parameter " + AllTrim&#40; Str&#40; n &#41; &#41; + "&#58; " + cValToChar&#40; aBegin&#91; 2 + n &#93; &#41; &#41; next n++ while n < Len&#40; aBegin &#41; - 1 MsgInfo&#40; "local " + AllTrim&#40; Str&#40; n - PCount&#40;&#41; - 1 &#41; &#41; + "&#58; " + cValToChar&#40; aBegin&#91; n + 1 &#93; &#41; &#41; n++ end local2 &#58;= "changed!" // we change a local value aEnd = HB_DBG_VMSTKLLIST&#40;&#41; for n = PCount&#40;&#41; + 1 to Len&#40; aEnd &#41; - 1 if aBegin&#91; n &#93; != aEnd&#91; n &#93; MsgInfo&#40; "local " + AllTrim&#40; Str&#40; n - PCount&#40;&#41; - 2 &#41; &#41; + " has changed!" &#41; endif next return nil [/code:1jsx704x]
Checking changes in folder
A simplified version:[code:3arfsxbt] #include "FiveWin&#46;ch" function Main&#40;&#41; Test&#40; "one", "two", "three" &#41; return nil function Test&#40; x, y, z &#41; local local1 &#58;= "first", local2 &#58;= "second", aBegin &#58;= HB_DBG_VMSTKLLIST&#40;&#41;, aEnd, n // your code&#46;&#46;&#46; local2 &#58;= "changed!" // we change a local value // Now we check for changes in locals variables aEnd = HB_DBG_VMSTKLLIST&#40;&#41; for n = PCount&#40;&#41; + 1 to Len&#40; aEnd &#41; - 1 if aBegin&#91; n &#93; != aEnd&#91; n &#93; MsgInfo&#40; "local " + AllTrim&#40; Str&#40; n - PCount&#40;&#41; - 2 &#41; &#41; + " has changed!" &#41; endif next return nil [/code:3arfsxbt]
Checking changes in folder
Maybe this will work , also when folders are nestedFrank[code:1pmbz52d] #include "FiveWin&#46;ch" #include "common&#46;ch" function Main&#40;&#41; local oDlg, oFld LOCAL Num &#58;= 100 LOCAL MemInpVal&#91;0&#93; LOCAL n &#58;= 1 , oRadMenu , oGet DEFINE DIALOG oDlg RESOURCE "test" REDEFINE FOLDER oFld ID 110 OF oDlg ; DIALOGS "dlg1", "dlg2" PROMPTS "One", "Two" REDEFINE GET oGet VAR Num OF oFld&#58;aDialogs&#91;1&#93; ID 100 REDEFINE RADIO oRadMenu VAR n ID 110 , 120 OF oFld&#58;aDialogs&#91;2&#93; REDEFINE BUTTON ID 120 OF oDlg ACTION CompInputValue&#40;oDlg , @MemInpVal &#41; ACTIVATE DIALOG oDlg CENTERED ; ON INIT &#40;SaveInputValue&#40;oDlg , @MemInpVal&#41;&#41; return nil PROC SaveInputValue&#40;oDlg , Arr&#41; ************************* LOCAL el , elem , oRadMenu&#91;0&#93; FOR EACH el IN oDlg&#58;aControls IF el&#58;ClassName == "TFOLDER" FOR EACH elem IN el&#58;aDialogs SaveInputValue&#40;elem , @Arr&#41; NEXT ELSE IF el&#58;ClassName = "TRADIO" IF ASCAN&#40;oRadMenu , &#123;|j|j==el&#58;oRadMenu&#125;&#41; == 0 AADD&#40;oRadMenu , el&#58;oRadMenu&#41; AADD&#40;Arr,el&#58;oRadMenu&#58;nOption&#40;&#41;&#41; END ELSEIF __ObjHasMethod&#40;el,"VarGet"&#41; // Maybe better &#58; IF el&#58;ClassName IN &#123;"TGET","TCHECK", &#46;&#46;&#46;&#46;&#46;&#46;&#125; AADD&#40;Arr,el&#58;VarGet&#40;&#41; &#41; END END NEXT RETURN ********************************************************************************************** FUNC CompInputValue&#40;oDlg , MemInpVal &#41; *************************************** LOCAL Arr&#91;0&#93; , i LOCAL lOk &#58;= &#46;T&#46; SaveInputValue&#40;oDlg,@Arr&#41; FOR i &#58;= 1 TO Len&#40;MemInpVal&#41; IF Arr&#91;i&#93; <> MemInpVal&#91;i&#93; lOk &#58;= &#46;F&#46; EXIT END NEXT RETURN lOk ************************************************************ Test DIALOG 19, 47, 233, 124 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "FiveWin Folders" &#123; CONTROL "", 110, "SysTabControl32", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 4, 5, 225, 99 PUSHBUTTON "&OK", 120, 98, 108, 37, 14 &#125; dlg1 DIALOG 18, 18, 205, 80 STYLE WS_CHILD | 4 &#123; LTEXT "Number &#58; ", 90, 10 , 2 , 40 , 10 //, WS_BORDER | WS_TABSTOP EDITTEXT 100, 37 , 2, 20 , 10, WS_BORDER | WS_TABSTOP CONTROL "First", 110, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 37, 30, 28, 12 &#125; dlg2 DIALOG 18, 18, 205, 80 STYLE WS_CHILD | 4 &#123; CONTROL "Second", 110, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 37, 30, 28, 12 CONTROL "Third", 120, "BUTTON", BS_AUTORADIOBUTTON | WS_TABSTOP, 37, 43, 28, 12 &#125; [/code:1pmbz52d]
Checking changes in folder
AntonioIn many cases we are using arrays , or why not , nested arrays , or arrays are mixted with others.In this case i suppose that this code is much more complicated and has tobe changed .Frank[quote="Antonio Linares":3mgzssfg]A simplified version: [code:3mgzssfg] #include "FiveWin&#46;ch" function Main&#40;&#41; Test&#40; "one", "two", "three" &#41; return nil function Test&#40; x, y, z &#41; local local1 &#58;= "first", local2 &#58;= "second", aBegin &#58;= HB_DBG_VMSTKLLIST&#40;&#41;, aEnd, n // your code&#46;&#46;&#46; local2 &#58;= "changed!" // we change a local value // Now we check for changes in locals variables aEnd = HB_DBG_VMSTKLLIST&#40;&#41; for n = PCount&#40;&#41; + 1 to Len&#40; aEnd &#41; - 1 if aBegin&#91; n &#93; != aEnd&#91; n &#93; MsgInfo&#40; "local " + AllTrim&#40; Str&#40; n - PCount&#40;&#41; - 2 &#41; &#41; + " has changed!" &#41; endif next return nil [/code:3mgzssfg][/quote:3mgzssfg]
Checking changes in folder
Hi Frank,your code is the easyest solution for my case. Thanks to all for the tips.
Checking for a Windows 64-bit
Hello, How can we check in FWH if an application is running on a 64-bit Windows version ? Thanks you very much in advance.
Checking for a Windows 64-bit
Michel, [url:1ya5231g]http&#58;//wiki&#46;fivetechsoft&#46;com/doku&#46;php?id=fivewin_function_iswin64[/url:1ya5231g]
Checking for a Windows 64-bit
Antonio, [quote="Antonio Linares":2ee6flw7][url:2ee6flw7]http&#58;//wiki&#46;fivetechsoft&#46;com/doku&#46;php?id=fivewin_function_iswin64[/url:2ee6flw7][/quote:2ee6flw7] I found out that IsWin64() doesn't work on Windows 7 professional 64bit (6.1 build 7600 - it returns .f.) I'm still on FWH 9.05 - xH 1.2.1 - bcc 5.5 - Is this the problem ? Hi, Davide
Checking for a Windows 64-bit
Simple test: [img:3nmcuhqf]http&#58;//img825&#46;imageshack&#46;us/img825/7167/iswin64&#46;png[/img:3nmcuhqf] Nobody's using IsWin64() here ? Hi, Davide
Checking for a Windows 64-bit
Hi guys, here's the function, taken from <!-- m --><a class="postlink" href="http://msdn.microsoft.com/en-us/library/ms684139%28VS.85%29.aspx">http://msdn.microsoft.com/en-us/library ... 85%29.aspx</a><!-- m --> I tested in: Windows 98 -> .F. WinXP 32 SP3 -> .F. Vista 32 SP2 -> .F. Win7 64 -> .T. Could you please check if I made the right corrections for xH and test it against your own 32/64 bit Windows ? Thanks, Davide [code=fw:i6ymh0ok]<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;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />? IsWow64<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 /><span style="color: #B900B9;">//---------------------------------------------------------------------------</span><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <stdio.h><br /><br />typedef BOOL <span style="color: #000000;">&#40;</span>WINAPI *LPFN_ISWOW64PROCESS<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#40;</span>HANDLE, PBOOL<span style="color: #000000;">&#41;</span>;<br /><br />LPFN_ISWOW64PROCESS fnIsWow64Process;<br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> ISWOW64 <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />    BOOL bIsWow64 = <span style="color: #00C800;">FALSE</span>;<br /><br />    <span style="color: #B900B9;">//IsWow64Process is not available on all supported versions of Windows.</span><br />    <span style="color: #B900B9;">//Use GetModuleHandle to get a handle to the DLL that contains the function</span><br />    <span style="color: #B900B9;">//and GetProcAddress to get a pointer to the function if available.</span><br /><br />    fnIsWow64Process = <span style="color: #000000;">&#40;</span>LPFN_ISWOW64PROCESS<span style="color: #000000;">&#41;</span> GetProcAddress<span style="color: #000000;">&#40;</span><br />        GetModuleHandle<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">TEXT</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"kernel32"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #ff0000;">"IsWow64Process"</span><span style="color: #000000;">&#41;</span>;<br /><br />    <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span><span style="color: #00C800;">NULL</span> != fnIsWow64Process<span style="color: #000000;">&#41;</span><br />    <span style="color: #000000;">&#123;</span><br />        <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>!fnIsWow64Process<span style="color: #000000;">&#40;</span>GetCurrentProcess<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,&bIsWow64<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />        <span style="color: #000000;">&#123;</span><br />            <span style="color: #B900B9;">//handle error</span><br />        <span style="color: #000000;">&#125;</span><br />    <span style="color: #000000;">&#125;</span><br />    hb_retl<span style="color: #000000;">&#40;</span> bIsWow64 <span style="color: #000000;">&#41;</span>;<br />    <span style="color: #00C800;">return</span>; <span style="color: #B900B9;">// bIsWow64;</span><br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------</span><br /> </div>[/code:i6ymh0ok]
Checking for a Windows 64-bit
Davide... Yes, your purpose is correct, but if the application was built under 32 bits, for correct this function we changed source\winapi\wndis.c with this change applications built under 32 and 64 will show .T. Thanks... [code=fw:1lvyeuwc]<div class="fw" id="{CB}" style="font-family: monospace;"><br />#ifdef _WIN64<br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> ISWIN64 <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Check if Windows 64 is running</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;hb_retl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> sizeof<span style="color: #000000;">&#40;</span> void * <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span> &nbsp; &nbsp; &nbsp; <br />#else <br />typedef BOOL <span style="color: #000000;">&#40;</span>WINAPI *LPFN_ISWOW64PROCESS<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#40;</span>HANDLE, PBOOL<span style="color: #000000;">&#41;</span>;<br /><br />LPFN_ISWOW64PROCESS fnIsWow64Process;<br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> ISWIN64 <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; BOOL bIsWow64 = <span style="color: #00C800;">FALSE</span>;<br /><br />&nbsp; &nbsp; <span style="color: #B900B9;">//IsWow64Process is not available on all supported versions of Windows.</span><br />&nbsp; &nbsp; <span style="color: #B900B9;">//Use GetModuleHandle to get a handle to the DLL that contains the function</span><br />&nbsp; &nbsp; <span style="color: #B900B9;">//and GetProcAddress to get a pointer to the function if available.</span><br /><br />&nbsp; &nbsp; fnIsWow64Process = <span style="color: #000000;">&#40;</span>LPFN_ISWOW64PROCESS<span style="color: #000000;">&#41;</span> GetProcAddress<span style="color: #000000;">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; GetModuleHandle<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"kernel32"</span><span style="color: #000000;">&#41;</span> ,<span style="color: #ff0000;">"IsWow64Process"</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span><span style="color: #00C800;">NULL</span> != fnIsWow64Process<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;!fnIsWow64Process<span style="color: #000000;">&#40;</span>GetCurrentProcess<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,&bIsWow64<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; hb_retl<span style="color: #000000;">&#40;</span> bIsWow64 <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br />#endif <span style="color: #B900B9;">/*_WIN64*/</span><br />&nbsp;</div>[/code:1lvyeuwc]
Checking for a Windows 64-bit
Daniel, thank you for your feedback. [quote="Daniel Garcia-Gil":1d23a1gj]HB_FUNC( ISWIN64 )[/quote:1d23a1gj] I intentionally left IsWin64() untouched and added IsWow64() because the former is already used (for example) in rPreview.prg to determine whether to load the 32 or 64 bit DLL. Your change would make a FWH32 program trying to load PREV64.DLL (that's not possible) Hi, Davide
Checking for a Windows 64-bit
[quote="Davide":3llrzluh]Daniel, thank you for your feedback. [quote="Daniel Garcia-Gil":3llrzluh]HB_FUNC( ISWIN64 )[/quote:3llrzluh] I intentionally left IsWin64() untouched and added IsWow64() because the former is already used (for example) in rPreview.prg to determine whether to load the 32 or 64 bit DLL. Your change would make a FWH32 program trying to load PREV64.DLL (that's not possible) Hi, Davide[/quote:3llrzluh] Yes is correct Now for clear facts... The function IsWin64 return .T. / .F. if the application was built under 64 Function IsWow64 return .T. / .F. if the application was built in 32bit and run over 64 [code=fw:3llrzluh]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> ISWIN64 <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Check if Windows 64 is running</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;hb_retl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> sizeof<span style="color: #000000;">&#40;</span> void * <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span> &nbsp; &nbsp; &nbsp; <br /><br /><br />typedef BOOL <span style="color: #000000;">&#40;</span>WINAPI *LPFN_ISWOW64PROCESS<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#40;</span>HANDLE, PBOOL<span style="color: #000000;">&#41;</span>;<br /><br />LPFN_ISWOW64PROCESS fnIsWow64Process;<br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> ISWOW64 <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; BOOL bIsWow64 = <span style="color: #00C800;">FALSE</span>;<br /><br />&nbsp; &nbsp; <span style="color: #B900B9;">//IsWow64Process is not available on all supported versions of Windows.</span><br />&nbsp; &nbsp; <span style="color: #B900B9;">//Use GetModuleHandle to get a handle to the DLL that contains the function</span><br />&nbsp; &nbsp; <span style="color: #B900B9;">//and GetProcAddress to get a pointer to the function if available.</span><br /><br />&nbsp; &nbsp; fnIsWow64Process = <span style="color: #000000;">&#40;</span>LPFN_ISWOW64PROCESS<span style="color: #000000;">&#41;</span> GetProcAddress<span style="color: #000000;">&#40;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; GetModuleHandle<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"kernel32"</span><span style="color: #000000;">&#41;</span> ,<span style="color: #ff0000;">"IsWow64Process"</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span><span style="color: #00C800;">NULL</span> != fnIsWow64Process<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;fnIsWow64Process<span style="color: #000000;">&#40;</span>GetCurrentProcess<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,&bIsWow64<span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; hb_retl<span style="color: #000000;">&#40;</span> bIsWow64 <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:3llrzluh]
Checking for a Windows 64-bit
Daniel, [quote="Daniel Garcia-Gil":6bci4116] The function IsWin64 return .T. / .F. if the application was built under 64 Function IsWow64 return .T. / .F. if the application was built in 32bit and run over 64 [code=fw:6bci4116]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> ISWIN64 <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Check if Windows 64 is running</span><br /> </div>[/code:6bci4116][/quote:6bci4116] Yes. I believe that the comment should be: HB_FUNC( ISWIN64 ) // Check if my program is a 64 bit one (useful if you're using either FWH32 or FWH64) Obviously if it's .T. you're evidently using Windows64 bit, but a FWH32 program will always return .F. even on Win64 (that's why I added IsWow64) The Wiki about IsWin64() should explain that too. Hi, Davide
Checking for a Windows 64-bit
Davide... <!-- m --><a class="postlink" href="http://wiki.fivetechsoft.com/doku.php?id=fivewin_function_iswin64">http://wiki.fivetechsoft.com/doku.php?i ... on_iswin64</a><!-- m --> This function returns .t. if we are executing the application under Windows 64 bit i saw the wiki and explain is wrong and correct IsWin64 return .T. / .F. if the program was built with 64 bit complier (no need emulation for run), and you're right [quote="Davide":3rmcqjoe]Obviously if it's .T. you're evidently using Windows64 bit, but a FWH32 program will always return .F. even on Win64 (that's why I added IsWow64)[/quote:3rmcqjoe] this is expect return value [url=http&#58;//www&#46;sitasoft&#46;net/fivewin/samples/winver32&#46;zip:3rmcqjoe]Download samples 32bit[/url:3rmcqjoe] WOW64 is the x86 emulator that allows 32-bit Windows-based applications to run seamlessly on 64-bit Windows for this reason IsWow64 return .T. when run in 64bit a program built in 32 bits, because only work with 32bit programs [url=http&#58;//www&#46;sitasoft&#46;net/fivewin/samples/winver64&#46;zip:3rmcqjoe]Download samples 64bit[/url:3rmcqjoe] [code=fw:3rmcqjoe]<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: #ff0000;">"Is Windows 64 (IsWin64):"</span> + cValToStr<span style="color: #000000;">&#40;</span> IsWin64<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"Is Windows 64 (IsWow64):"</span> + cValToStr<span style="color: #000000;">&#40;</span> IsWow64<span style="color: #000000;">&#40;</span><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 /> </div>[/code:3rmcqjoe] Obviously is a program built in 64bit is running, is in 64 bit OS
Checking for a Windows 64-bit
Daniel, maybe the name of the function is a little bit confusing. The other funcions (IsWinXP(),...) are returning the version of the OS, so I think it would be clearer if IsWin64() would return the type of the OS (.f. for 32bit and .t. for a 64bit OS). I suggest IsWin64() for the OS and IsWow64() for the application. IsWin64() should return .t. if a 64bit OS is running, IsWow64() should return .t. if a 32bit app is running under 64bit. Just an idea...
Checking for a Windows 64-bit
Stefan... the return value is correct in both case the point is call IsWin64 in 32 bit program (built) never shall return .T. because run in emulation mode (WOW64) under 64 bit OS, this emulation is 32bits like say : <!-- m --><a class="postlink" href="http://msdn.microsoft.com/en-us/library/ms684139(VS.85">http://msdn.microsoft.com/en-us/library/ms684139(VS.85</a><!-- m -->).aspx IsWow64 Determines whether the specified process is running under WOW64. i mean, no verify OS verify emulation mode so we need use IsWow64 in 32bit applications
Checking for a Windows 64-bit
Daniel, I download all test sample that of 32 bit run ok on xp the second i cannot run it ( because now I use xpprofessional) and it is ok but if I made an application witha Windows Seven 64 bit and the I must give to customer this application it can run on xp professional 32 bit or vista 32 bit ? I'm thinking it cannot run .... Can I create an application run on 32 and 64 bit ?
Checking for a Windows 64-bit
Silvio... the applications built in 64bit no run in 32bits, you can build in 32bit and run in 64bit (emulation mode)
Checking for a Windows 64-bit
Daniel, [quote="Daniel Garcia-Gil":3gf99gc2]the applications built in 64bit no run in 32bits[/quote:3gf99gc2] this is the point. If I'm using FHW64 I have no need for a IsWin64() function because my program would not run on any other platform. If I'm using FWH32 instead (like I am), then I need IsWow64() to know whether the host OS is a 32 or 64 bit one (and in fact I use this one to decide whether I want to send the additional 4th parameter in my modified treg.prg to read the 64bit registry entries, for example). The only need I see for IsWin64() is when the same code can be compiled either with FWH32 or with FWH64 (like rpreview.prg does to decide which DLL it has to load), but even in this case this function returns which kind of PROGRAM is mine, rather than which kind of OS I'm running. So, the Wiki is, at least, confusing, if not wrong at all (unless it will not specify that function will detect the real OS only with FWH64, but at that point I see no utility for such a function). Just my 2 cents. Hi, Davide
Checking for a Windows 64-bit
[quote="StefanHaupt":1kyr4sap]Daniel, maybe the name of the function is a little bit confusing. The other funcions (IsWinXP(),...) are returning the version of the OS, so I think it would be clearer if IsWin64() would return the type of the OS (.f. for 32bit and .t. for a 64bit OS). I suggest IsWin64() for the OS and IsWow64() for the application. IsWin64() should return .t. if a 64bit OS is running, IsWow64() should return .t. if a 32bit app is running under 64bit. [/quote:1kyr4sap] +1 I think it's more intuitive and in line with the rest of IsWin...() functions.
Checking for a Windows 64-bit
hua, stefan we can not change IsWin64() functionality, maybe other user use this function, we could break compatibility. yes the function is not intuitive, but return a correct value ( .T. in applications built under 64 and .F. in applications built under 32 ) [quote="Daniel Garcia-Gil":3qu0c3qi]Stefan... the return value is correct in both case the point is call IsWin64 in 32 bit program (built) never shall return .T. because run in emulation mode (WOW64) under 64 bit OS, this emulation is 32bits like say : <!-- m --><a class="postlink" href="http://msdn.microsoft.com/en-us/library/ms684139(VS.85">http://msdn.microsoft.com/en-us/library/ms684139(VS.85</a><!-- m -->).aspx IsWow64 Determines whether the specified process is running under WOW64. i mean, no verify OS verify emulation mode so we need use IsWow64 in 32bit applications[/quote:3qu0c3qi] to run 32 bits applications under 64bit, only is possible in emulation mode, we can not skip this "layer", only way is with new function IsWow64 (thanks to davide)
Checking for a Windows 64-bit
Daniel, [quote="Daniel Garcia-Gil":3ves8745]we can not change IsWin64() functionality, maybe other user use this function[/quote:3ves8745] you're right, but if someone did you use it as advertised in the Wiki (like I did), they've already found it doesn't work that way. I would suggest: 1) Rename IsWin64() as IsMyPrg64() (including all the calls to IsWin64() in the different sources, like rPreview.prg) 2) Function IsWin64() ; Return ( IsMyPrg64() .or. IsWow64() ) This way IsWin64() would really check the OS rather then the prg, either with FWH32 or with FWH64, without breaking backward compatibility for most of the FiveWin users, apart those that eventually did use it in their own prg's to check whether they were compiled under 32 or 64 bit (they would just have to rename IsWin64() as above however) Alternatively, we can leave IsWin64() like it is now, but then the Wiki needs to be updated or more and more people will make the mistake to use it with FWH32 to check if the OS is 64bit or not. Hi, Davide
Checking for a Windows 64-bit
Daniel, [quote:3pifyxbi]I think it's more intuitive and in line with the rest of IsWin...() functions.[/quote:3pifyxbi] That was my intention. Maybe changing the function could break compatibility with existing apps, but are there already 64bit apps ? I think, it´s not too late to change the function.
Checking for a Windows 64-bit
[quote="Davide":1lc32f41]Alternatively, we can leave IsWin64() like it is now, but then the Wiki needs to be updated or more and more people will make the mistake to use it with FWH32 to check if the OS is 64bit or not.[/quote:1lc32f41] [url:1lc32f41]http&#58;//wiki&#46;fivetechsoft&#46;com/doku&#46;php?id=fivewin_function_iswin64[/url:1lc32f41] The return section explain perfectly this point: Returns <lWin64> This function returns .t. if we are executing the application under Windows 64 bit i will change IsWind64 section already is: IsWin64() It checks if the version of Windows is 64 bit. for this it check if we are executing the application under Windows 64 bit Remarks: 32 bis applications no run in 64 bit, these run under 32 bit emulation, for detect emulation mode use IsWow64 wiki for IsWow64() could be, it check if we are executing the application under 32 bit emulation
Checking for a Windows 64-bit
Already changed wiki [url:2fmd3e2h]http&#58;//wiki&#46;fivetechsoft&#46;com/doku&#46;php?id=fivewin_function_iswin64[/url:2fmd3e2h] [url:2fmd3e2h]http&#58;//wiki&#46;fivetechsoft&#46;com/doku&#46;php?id=fivewin_function_iswow64[/url:2fmd3e2h] please any thing else or additional comment, please let us know, thanks by feedback
Checking for updated fields
Hi, I'm looking to put a message in my app to check if the user has updated any fields in a dialog (these can be gets/radio/checkboxes etc) and then if the user tries to quit, display a message saying "Data not saved, are you sure you wish to quit?" Is there a global setting that i can put into my dialog that can get updated if any updates occur, or do i have to put an ON CHANGE onto each of my controls? Any ideas will be appreciated Pete
Checking for updated fields
Peter I don't have a direct answer for you .. but consider a couple options .. 1) In a network environment you could have issues with two people having buffered up the same record .. very typical in a small office situation .. if one person saves the record and the other saves on top of that same record .. you now have a delima. In this case I use a 'signature' numeric field that gets incremented once each time the record is saved. If workstation A saves a record the signature field in the table gets incremented .. the trick is before workstation B saves the same record .. you go out once again to the table and verify the signature field buffered on workstation B is the same as what the table says .. if not .. then workstation A has slipped behind workstation B and changed the information and workstation B should not be allowed to save if the signature field is not the same. 2) It may seem redundant .. but many times I will thru up a MsgYesNo() and even if nothing has changed and ask the user to Save or Cancel during the end of an Edit session .. let the user confirm if they have changed a record. Just my 2 cents.. Rick Lipkin
Checking for updated fields
Thanks for your reply - i've always said to our customers that i could change my app to work as you suggested in point 2, so i'm probably going to go with that. Just wondered if there was an "hidden" automated procedure somewhere <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> Regards, Pete
Checking for updated fields
This bit of code might point you in the right direction. This code would run after the ON INIT for the dialog. It does not take into account if you already have bChange block already assigned. You might have to add other types of controls also. It also does not do folder within folder. [code=fw:2h22xyv1]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;<span style="color: #00C800;">FOR</span> nI := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">aControls</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> nI <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">ClassName</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"TGET"</span> .or. oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> nI <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">ClassName</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"TCHECKBOX"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> nI <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bChange</span> == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Here is where you can assign variable or use function to turn on save checking. </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// There is another place further down.</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> nI <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bChange</span> = <span style="color: #000000;">&#123;</span> || ::<span style="color: #000000;">togglesaveon</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> nI <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">ClassName</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"TFOLDER"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">FOR</span> nIFold := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> nI <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aDialogs</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">FOR</span> nFoldI := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> nI <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span> nIFold <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aControls</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> nI <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span> nIFold <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> nFoldI <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">ClassName</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"TGET"</span> .or. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> nI <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span> nIFold <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> nFoldI <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">ClassName</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"TCHECKBOX"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> nI <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span> nIFold <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> nFoldI <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bChange</span> == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Here is where you can assign variable or use function to turn on save checking.</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> nI <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span> nIFold <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> nFoldI <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bChange</span> = <span style="color: #000000;">&#123;</span> || ::<span style="color: #000000;">togglesaveon</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">NEXT</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">NEXT</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<span style="color: #00C800;">NEXT</span><br />&nbsp;</div>[/code:2h22xyv1]
Checking for updated fields
Pete, Personally, I am against such a design. The software should assume that the user wants to do what they said they did. I hate confirmations! Consider that 99 times out of a hundred, the answer will be the same. The user will be so used to getting rid of the annoying message by answering in a certain matter that it will be so automatic, that the one time in a hundred that they really needed to answer it differently, it will be too late. The confirmation message will have already been dismissed by the user in the usual way. So confirmations don't work and they just create more work for the user. If you really wish to do this, however, there is a modified() method of the TDatabase class that will tell you if the data has been changed. The database class holds the data in an array, the user can then edit it and the modified() method will check the array against the original record. Of course, you must change your code to use a database object in order to use the modified() method. Regards, James
Checking for updated fields
Hello James, would you be so kind to explain the modified() method a bit. Is modified asking if you want save. It would also be a good step to have a undo build in. Thanks in advance. Best regards, Otto
Checking for updated fields
Otto, >would you be so kind to explain the modified() method a bit. >Is modified asking if you want save. No, calling Modified() simply checks the buffer agianst the record and returns .t. if they are different. >It would also be a good step to have a undo build in. Yes, Undo is much better than a confirmation. In order to create a undo you will have to save the previous data somewhere, then provide an Undo button or menu choice. James
Checking for updated fields
I fully agree with Mr. James on user psychology. About checking whether any data is modified by a dialog, in a network environment, we need to consider two kinds of changes. 1) If our user has modified the data by editing the dialog. 2) If any other user changed the data, after our user read the data. I normally use a class derived from TDataBase. I maintain two buffers, aOriginal and aBuffer. Comparing aOriginal and aBuffer tells me if our user has changed the data. If changed it needs to be saved. This comparison does not require a diskread, which is costly in network environments. ( This has another advantage. User might have edited a few Gets and again re-edited to the original values. In such a case we need not save the record ). Also maintaining two buffers aOriginal and aBuffer enables 'UNDO' without another diskread. By comparing aOriginal with data in the table ( similar to modified method of TDataBase ) we know if some other user changed the data already. ( Comparing Version fields if maintained may appear to be faster, but our normal RDDs anyway read the entire record ). Mr James' TData class stood the test of time. I do not know how TData class helps the programmer in this regard. Would Mr James or any user of TData like to enlighten us on this aspect of TData ? It may be noted that ADO recordset also maintains these values to enable the programmer to do these kinds of comparisons. Every field has OriginalValue, UnderlyingValue and Value. Comparing Value with OriginalValue tells us if our user has modified data. Resync method to update only underlyingvalues reads the current data into this value. Comparing Value with UnderlyingValues tells is if other user modified the data. ( Using Version fields is faster while dealing with RDMSs ) In case, I am not using any classes, I normally have all the values in an array at the outset and compare with edited values in the dialog. Incidentally I would like to share my views on oGet:Changed. This such a handy feature that we are tempted to use this value to determine if our user has changed the data. But this can be dangerously misleading. Every time a Get gets focus, the oGet;Changed is reset to .f. The user might have edited the data once and might have gone back to the same get and did not modify this time. oGet:changed shows .f.
Checking for updated fields
Hello Mr. NagesWaraRao, would you please show how you compare to arrays. I always use a FOR-NEXT statement. Is there a better way? Thanks in advance And best regards, Otto
Checking for updated fields
I have solved this problem many years ago, even already in my Clipper times. I always use this kind of code : [code=fw:3nepkgds]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">LOCAL</span> cField1,cField2,cField2<br /><span style="color: #00C800;">LOCAL</span> cUpdate := .F.<br />.................<br />cFIELD1 := DBF1->FIELD1<br />cFIELD2 := DBF1->FIELD2<br />cFIELD3 := DBF1->FIELD3<br />.................<br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> ........<br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> cFIELD1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg<br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> cFIELD2 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span> <span style="color: #0000ff;">OF</span> oDlg<br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> cFIELD3 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">103</span> <span style="color: #0000ff;">OF</span> oDlg<br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> ........<br />.................<br /><span style="color: #00C800;">IF</span> !<span style="color: #000000;">&#40;</span>cFIELD1 = DBF1->FIELD1 .AND. ;<br />     cFIELD2 = DBF1->FIELD2 .AND. ;<br />     cFIELD3 = DBF1->FIELD3<span style="color: #000000;">&#41;</span><br />    cUPDATED := .T.<br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">IF</span> cUPDATED<br />   DBF1->FIELD1 := cFIELD1<br />   DBF1->FIELD2 := cFIELD2<br />   DBF1->FIELD3 := cFIELD3<br /><span style="color: #00C800;">ENDIF</span></div>[/code:3nepkgds] You could make a cUPDATED for each field if you want to know which fields are updated. Good luck.
Checking for updated fields
Mr Otto > I always use a FOR-NEXT statement. Is there a better way? > I also do the same thing. I think this is the best way I can think of.
Checking for valid fieldname
Hi, My program import data from an other system. These files include a parameter and info about this parameter. When I import it I create a fieldname with the same name as the parameter from the imported file. Till now I had no problem but a client wanted to import a file that contains wrong info. My program wanted to create a fieldname containing '*' and other strange characters. Is there a way to chech if a fieldname is correct? Thanks, Marc
Checking for valid fieldname
Maybe this func could help you. Regards, Otto func f_isOK(cTest) local cReturn:="" local i:=0 FOR I := 1 TO len(cTestl) IF ASC(substr(cTest,i,1)) >= 33 .and. ASC(substr(cTest,i,1)) <= 90 cReturn:=cReturn+substr(cTest,i,1) elseif ASC(substr(cTest,i,1)) >= 97 .and. ASC(substr(cTest,i,1)) <= 122 cReturn:=cReturn+substr(cTest,i,1) elseif ... ENDIF NEXT return (cReturn)
Checking for valid fieldname
Using charonly : [code:jy9dfnhy] LOCAL CharAllowed &#58;= "" , i , lOk FOR i &#58;= 65 TO 90 CharAllowed += CHR&#40;i&#41; + CHR&#40;i+32&#41; NEXT // Are numbers allowed in fieldnames ? If yes add the range 48-57 lOk &#58;= &#40; LEN&#40;CharOnly&#40;CharAllowed,cString&#41; == LEN&#40;cString&#41; &#41; RETURN lOk // Or CharOnly&#40;CharAllowed,cString&#41; [/code:jy9dfnhy]
Checking for valid fieldname
Otto, Frank, Thanks for the info. I will try it. Marc
Checking if Outlook is running
Hello, How can I check in FWH if Outlook is running on my PC? I tried to use GetTasks() but Outlook can not be found in the tasklist. Is there a difference in Outlook 2003, 2007, 2010 or 2013? Anyone any idea? Thanks a lot in advance.
Checking if Outlook is running
Michel, This may help you: [code=fw:2nxsxsce]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #00C800;">if</span> FWGetOleObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"outlook.application"</span> <span style="color: #000000;">&#41;</span> == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"outlook is not available"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"outlook is available"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span></div>[/code:2nxsxsce]
Checking if Outlook is running
Antonio, Thanks for you efforts, but I'm afraid it isn't working. I always get the message "Outlook is available" whether Outlook is running or not. If Outlook is not running, I can see that Outlook is started invisible for a short moment, then the message "Outlook is available" appears and then Outlook is quited. I did another test. I added the source you suggested into my source and I removed the try catch end section, just to see what happens. Then I got this error : "Error TOleAuto/65535 TOLEAUTO:GETACTIVEOBJECT" Any idea?
Checking if Outlook is running
[quote:3a0e7854]Because I want to prevent that Outlook is started more than one time.[/quote:3a0e7854] if GetActiveObject( cName ) succeeds without error, it means the app is already running. So the logic should be [code=fw:3a0e7854]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; oObj := GetActiveObject<span style="color: #000000;">&#40;</span> cApp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; ? <span style="color: #ff0000;">'already running'</span><br />CATCH<br />&nbsp; &nbsp; <span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; &nbsp;oObj := CreateObject<span style="color: #000000;">&#40;</span> cApp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;? <span style="color: #ff0000;">'Created now'</span><br />&nbsp; &nbsp; CATCH<br />&nbsp; &nbsp; &nbsp; &nbsp;? <span style="color: #ff0000;">'app not available<br />&nbsp; &nbsp; END<br />END<br /></span></div>[/code:3a0e7854] The FWH function FWGetOleObject( cApp ) does exactly the above. I advise you to use FWGetOleObject( cApp ) instead of TOleAuto():New(...) to achieve what you wanted. Please see the code in \fwh\source\function\olefuncs.prg
Checking if Outlook is running
Michel Maybe the following code will help [code=fw:1zbz58fg]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> lfSetMail<span style="color: #000000;">&#40;</span>oCMSFolder<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> NameSpace,oInbox<br /><span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp;oOL := 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;">"Outlook.Application"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oNameSpace &nbsp; := oOL:<span style="color: #0000ff;">Get</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"GetNameSpace"</span>, <span style="color: #ff0000;">"MAPI"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oInbox &nbsp; &nbsp; &nbsp; := oNameSpace:<span style="color: #0000ff;">Get</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"GetDefaultFolder"</span>,<span style="color: #000000;">6</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// 6 = Inbox-Folder</span><br />&nbsp; &nbsp;<span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; oCMSFolder &nbsp; := oInbox:<span style="color: #000000;">Folders</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"cmsmail"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;CATCH<br />&nbsp; &nbsp; &nbsp; MsgAlert<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'No CMSMAIL Folder Setup'</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br />CATCH<br />&nbsp; &nbsp;MsgAlert<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'Outlook Not Installed'</span><span style="color: #000000;">&#41;</span><br />END<br /><span style="color: #00C800;">return</span><span style="color: #000000;">&#40;</span>oCMSFolder<span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:1zbz58fg] Regards Colin
Checking if Outlook is running
Colin, Thanks a lot for trying to help me. I don't want to know if Outlook is installed or not, I want to know if Outlook is running. Why do I want to know if Outlook is running? Because I want to prevent that Outlook is started moren than one time.
Checking if Outlook is running
Michel I justed tested outlook and it appears you can not start it multiple times - you can have multiple child windows open but they are closed when the top window is closed. Tested on Windows 8 and Outlook 2010. Regards Colin
Checking if Outlook is running
Thanks a lot everybody for trying to help me. Unfortunately, whatever I try, I always get the error : "Error TOleAuto/65535 TOLEAUTO:GETACTIVEOBJECT". What am I doing wrong?
Checking if Outlook is running
[quote="driessen":f87x0fe3]Thanks a lot everybody for trying to help me. Unfortunately, whatever I try, I always get the error : "Error TOleAuto/65535 TOLEAUTO:GETACTIVEOBJECT". What am I doing wrong?[/quote:f87x0fe3] If Outlook is not already running, you will and should get this error and getting the error is the way to know that it is not running. Please see my explanation above.
Checking if Outlook is running
Helle everyone, Of course, I made a mistake by not using TRY .. CATCH ... END in my test. Now it's running just fine. Thank you very much for your help.
Checking if Outlook is running
Good. So I advise you to use FWGetOleObject( cApp ) instead of TOleAuto():New(...). This function checks if the application is already active and if active uses the active object. If not active opens the application.
Checking if Outlook is running
Mr. Rao, Thanks a lot for your advice.
Checking list
Hi this my first post here: What I need to port an application program (FWH) that actually runs in windows platform to mac? 0) Fivewin - obvious 1) Mac (or emulator?....) 2) editor (I use a free editor) 3) Resource editor (this is also free) 4) linker? what else? I also want to know the cost of each item ( except fivewin I just read ) Many thanks marco
Checking list
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=25437">viewtopic.php?f=3&t=25437</a><!-- l -->
Checking non released GDI objects
FiveWin provides some functions to check non released GDI objects. We have have enhanced that code, so you can manage it from PRG level and have full control on it: rescheck.prg [code=fw:blo9zua4]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">static</span> aResources := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> PalBmpFree<span style="color: #000000;">&#40;</span> hBmp, hPal <span style="color: #000000;">&#41;</span><br /><br />   DeleteObject<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />   DeleteObject<span style="color: #000000;">&#40;</span> hPal <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: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> AddResource<span style="color: #000000;">&#40;</span> nHResource, cType <span style="color: #000000;">&#41;</span><br /><br />   AAdd<span style="color: #000000;">&#40;</span> aResources, <span style="color: #000000;">&#123;</span> cType, nHResource, ProcName<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span>, ProcLine<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</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: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> DelResource<span style="color: #000000;">&#40;</span> nHResource <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> nAt<br /><br />   <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> nAt := AScan<span style="color: #000000;">&#40;</span> aResources, <span style="color: #000000;">&#123;</span> | aRes | aRes<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> == nHResource <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span><br />      ADel<span style="color: #000000;">&#40;</span> aResources, nAt <span style="color: #000000;">&#41;</span><br />      ASize<span style="color: #000000;">&#40;</span> aResources, Len<span style="color: #000000;">&#40;</span> aResources <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span>    <br /><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> CheckRes<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> cInfo := <span style="color: #ff0000;">""</span>, n<br />   <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;">&#40;</span> aResources <span style="color: #000000;">&#41;</span><br />      cInfo += aResources<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">","</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">9</span> <span style="color: #000000;">&#41;</span> + Str<span style="color: #000000;">&#40;</span> aResources<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">9</span> <span style="color: #000000;">&#41;</span> + ;<br />               aResources<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">","</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">9</span> <span style="color: #000000;">&#41;</span> + Str<span style="color: #000000;">&#40;</span> aResources<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> + CRLF<br />   <span style="color: #00C800;">next</span>   <br />   <br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> cInfo <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: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><span style="color: #00D7D7;">#include</span> <hbapiitm.h><br /><span style="color: #00D7D7;">#include</span> <hbvm.h><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><br />void RegisterResource<span style="color: #000000;">&#40;</span> HANDLE hRes, LPSTR szType <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;PHB_ITEM pRet = hb_itemNew<span style="color: #000000;">&#40;</span> hb_param<span style="color: #000000;">&#40;</span> <span style="color: #000000;">-1</span>, HB_IT_ANY <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><br />   hb_vmPushSymbol<span style="color: #000000;">&#40;</span> hb_dynsymGetSymbol<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADDRESOURCE"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />   hb_vmPushNil<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />   hb_vmPushLong<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> LONG <span style="color: #000000;">&#41;</span> hRes <span style="color: #000000;">&#41;</span>;<br />   hb_vmPushString<span style="color: #000000;">&#40;</span> szType, <span style="color: #0000ff;">strlen</span><span style="color: #000000;">&#40;</span> szType <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />   hb_vmFunction<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;hb_itemReturnRelease<span style="color: #000000;">&#40;</span> pRet <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span>  <br /><br />void pascal DelResource<span style="color: #000000;">&#40;</span> HANDLE hResource <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;PHB_ITEM pRet = hb_itemNew<span style="color: #000000;">&#40;</span> hb_param<span style="color: #000000;">&#40;</span> <span style="color: #000000;">-1</span>, HB_IT_ANY <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><br />   hb_vmPushSymbol<span style="color: #000000;">&#40;</span> hb_dynsymGetSymbol<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DELRESOURCE"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />   hb_vmPushNil<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />   hb_vmPushLong<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> LONG <span style="color: #000000;">&#41;</span> hResource <span style="color: #000000;">&#41;</span>;<br />   hb_vmFunction<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;hb_itemReturnRelease<span style="color: #000000;">&#40;</span> pRet <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span>    <br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /> </div>[/code:blo9zua4] To check consumed GDI objects in your app, add this function call at the beginning: [code=fw:blo9zua4]<div class="fw" id="{CB}" style="font-family: monospace;"><br />SetResDebug<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:blo9zua4] and when you want to check the GDI objects, simply call: [code=fw:blo9zua4]<div class="fw" id="{CB}" style="font-family: monospace;"><br />CheckRes<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:blo9zua4]
Checking non released GDI objects
Hello Antonio, if I link in rescheck.prg I get following error: Best regards, Otto Application =========== Path and name: C:\xWinhotel\xRechnung.EXE (32 bits) Size: 3,083,776 bytes Time from start: 0 hours 0 mins 2 secs Error occurred at: 21.06.2009, 10:49:02 Error description: Error BASE/1068 Argument error: array access Args: [ 1] = N 0 [ 2] = N 1 Stack Calls =========== Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LOADBITMAPS(0) Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:NEWBAR(0) Called from: c:\develop8\WH_Fwh\xRg\RECHNUNG.PRG => EXEC_ZIRECHNUNG(1721) Called from: c:\develop8\WH_Fwh\xRg\RECHNUNG.PRG => ZIRECHNUNG(371) Called from: c:\develop8\WH_Fwh\xRg\RECHNUNG.PRG => (b)MAIN(356) Called from: c:\develop8\WH_Fwh\xRg\window.prg => TMDIFRAME:ACTIVATE(876) Called from: c:\develop8\WH_Fwh\xRg\RECHNUNG.PRG => MAIN(356)
Checking non released GDI objects
Otto, We have edited and modified the previous code. Please copy it and test it again, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Checking non released GDI objects
Otto, We have modified the original posted code in the first msg here. Please try it again with the new code, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Checking non released GDI objects
Hello Antonio, it errors out, too. Best regards, Otto
Checking non released GDI objects
Hi Otto, I use MemProof. Regards, Toninho.
Checking non released GDI objects
Otto, > it errors out, too. What error do you get ? How to reproduce it ? thanks