Boris Pekic - NG's archive

BTrieve

Postby Antonio Linares » Wed Aug 27, 2008 7:35 am

Btrieve


--------------------------------------------------------------------------------


Maybe someone can help me, For a new project I have to convert BTRIEVE-files (Windows 16 Bit version) to DBASE-Files. The only way to convert I found was some DOS-Tools. But they all need the DOS-Btrieve-drivers. But they are not installed on the computer of my customer. So I need a Tool to convert the Btrieve- Files without any drivers.


You can search an ODBC for BTRIEVE on the web and convert data via ODBC


Try RaSQL, the RDD works good under Clipper DOS and FiveWin Windows: http://www.rasql.com/rbcss1.htm



--------------------------------------------------------------------------------
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Button Bars

Postby Antonio Linares » Wed Aug 27, 2008 7:36 am

Button Bars


--------------------------------------------------------------------------------


Is there anyway to manage button bars for mdi windows the same way you manage menus? I'd like to show a different button bar on the main window depending on which mdi child has focus. Fivewin automatically manages the menus why doesn't it manage a different button bar? Is there any way to achieve this effect?

I am using this just to change the pictures on the buttons, but I am sure we can even remove buttons or add new ones. You can change dynamically all the settings of your toolbars and buttons at run time. Just have a look in the help file for tbar and tbtnbmp classes for the data var's.


At what point do you change the button's pictures and actions? If you have two different MDI Child windows how do you make the appropriate buttons appear on the main window toolbar depending on which mdi child has focus? Otherwise it looks confusing, for example:

Open main window with tool bar and mdi child. Toolbar buttons on main window are all functions for the mdichild. Open another unrelated or different mdichild window. The toolbar buttons are not relevent to this window. The main menu changes as the menu for the new mdi child is different but the toolbar remains the same. I need to change the toolbar dynamically depending on which mdi child has focus. I've tried using the gotfocus and lostfocus method but these are both called when the mdi child is created and therefore doesn't work. Try the TESTBAR1.PRG in the samples directory, it doesn't appear to work properly. Any ideas? Perhaps what I'm trying to do is bad user interface design, I'm open for suggestions...

You are on the right way of implementing your idea by looking at the focus, but you have to use the code block

oYour_MdiChild:bGotFocus := { || Change_the_Buttons() }

not the method ::GotFocus().

Also why are you trying to change the buttons on the MDI window ? For me the logic is to have on the MDI window the buttons to open the child windows (functions or whatever) and then each MDI CHILD window will have its own buttons. This way you will save your self a lot of work and troubles. I think so and I am using that way with no problems so far.


I'm trying to use the bGotFocus method but it's not working correctly. I'll keep working on it. I understand your logic about attaching the buttonbar to the mdichild itself but it's kind of an unusual situation. The main mdi child window is a customer screen with folders. This is were the user spends most of their time so I like the button bar being attached to the main window, not the mdi child. The only other mdichild window will only be opened occasionally. Additionally, I don't allow multiple instances of either mdi child window. So, I don't see any purpose in having a button bar on the main window that only opens one of two different mdi windows, one being the main one the user is in 98% of the time.

I am using this just to change the pictures on the buttons, but I am sure we can even remove buttons or add new ones. You can change dynamically all the settings of your toolbars and buttons at run time. Just have a look in the help file for tbar and tbtnbmp classes for the data var's.



--------------------------------------------------------------------------------





Can you assign a accelerator key to a button on a button bar like to can a menu item

Try this

DEFINE BUTTONBAR oBar SIZE 64, 70 3DLOOK BOTTOM OF oDlg

DEFINE BUTTON oButton[1] RESOURCE "BIG_STAMPA" OF oBar ;

ACTION eval(bActSta) ;

TOOLTIP " Stampa estratto"

oButton[1]:cargo := VK_F5 // key accelerator

oDlg:bKeyDown = { | nKey | CheckKey(nKey,oBar)}

// Controll the keys

Function CheckKey(nKey,oBar)

Local nX,nY

IF nKey >= VK_F2 .AND. nKey <= VK_F9

IF oBar:lActive

FOR ny := 1 TO len(oBar:aControls)

IF oBar:aControls[ny]:cargo # nil .AND. oBar:aControls[ny]:lActive

if oBar:aControls[nY]:cargo == nKey

*eval(oBtnUse[nX]:bAction())

oBar:aControls[nY]:Click()

endif

ENDIF

NEXT

ENDIF

ENDIF

Return nil



--------------------------------------------------------------------------------





I am writing a app. with a buttonbar init, how can i center the bitmaps on the buttons ? There are now at the top of the bottom.

You must define the size of buttonbar as "define buttonbar obar buttonsize nwidth, nheight of ownd" where the size (x,y) of the bitmaps must be smaller (very few smaller) than nwidht, nHeight...



--------------------------------------------------------------------------------






In the norton guides it says that the class TBAR has Data called aButtons but when I try to access this array I keep getting "No exp.method:TBAR:aButtons". Also, if I check the source code for the TBAR object I see no aButtons defined. Is this a bug or is there another way to access this array? What I need it for is to find out which was the last button pressed. I am trying oBar:aButtons[nI]:lPressed"....Would this be correct or is there an easier way to do it?


It is aControls instad of aButtons.


Try using aControls instead aButtons.Try

oBar:aControls[nI]:lPressed



--------------------------------------------------------------------------------






Could someone give an example how to use buttonbars in dialogs? Thanks in advance


Quite simple:

DEFINE DIALOG oDlg ...............

.... more statements come here.......

....

ACTIVATE DIALOG oDlg ON INIT (DlgBar(oDlg))

Function DlgBar(oDialog)

DEFINE BUTTON BAR oBar OF oDialog

.... more button bar instructions come here ....

.....

Return



--------------------------------------------------------------------------------





I got strange display if button bar displayed on left or right position, please see the jpg attached. Anything I did wrong ?


I think you must be update to FW 2.0,because solve i
Upgrade to FW 2.0 to solve the problem!



--------------------------------------------------------------------------------





Has anyone had any luck getting the 3rd Bitmap to work in a DEFINE BUTTON RESOURCE "BITMAP1",BITMAP2","BITMAP3"

The 3rd button should be the hover attribute. The 1st is normal the 2nd is pressed and the 3rd should be the active one. I am trying to emulate the Outlook buttons where they are Grey Scale and the active button is in color. I have three bitmaps for the button the 1st is a grey normal button the 2nd and 3rd are color. The hover or active attibute looks the same as the non active button?


Try Jorge Masson's modification of TBAR class. It looks good to me and it does the think you are looking for. You can download it from http://www.htcsoft.freeservers.com/ as I do not have it right now in home to send it to you.


NOP! , third button on the definition of the button bar was used in FW 1.92 to show the button when it's disabled, in FW 1.95 and upper the disable bitmap is automatically painted by FW, the third parameter remains because of a compatibility issue. Try CanalFive Bar (http://canalfive...com)


I've tried Jorge Mason's button and it does everything you need! I've put it on the http://here.as/FiveWin download page, including a sample EXE.


Thanks for all your help. George Massons code did the trick. I was on the wrong track with the 3rd parameter.



--------------------------------------------------------------------------------







I don't find in manuals and samples how can to change color of buttonbar in source . I will be thankfull for any help .

Try oBar:SetColor(CLR_FOREGROUND, CLR_BACKGROUND)



--------------------------------------------------------------------------------






My Bar.prg is dated 11.11.1999. FW 2.0 Using the method oBar:GoRight() I get the following error: (Tested with testbtn.prg of the samples.)

DEFINE BUTTONBAR oBar OF oWnd

oBar:GoRight()

Application

Path and name: C:\CLIPPER\FIVEWIN\SAMPLES\TESTBTN.EXE

Size: 722,176 bytes

Max files handles permited: ( SetHandleCount() ) 255

Error ocurred at: 06/01/00, 14:24:41

Error description: Error BASE/1083 Fehlerhaftes Argument: *

Args:

[ 1] = U

[ 2] = N



Use this method as follow:

ACTIVATE WINDOW oWnd ;

ON INIT ( oBar:GoRight(), ..... )

and it works OK!


Another way is to use this method after last DEFINE BUTTON ... It works too.

// Defining ButtonBar buttons which uses Bitmaps files from disk

#include "FiveWin.ch"

static oWnd

function Main()

local oBar

local oBrush

DEFINE BRUSH oBrush COLOR nRGB( 12, 129, 87 )

DEFINE WINDOW oWnd FROM 1, 10 TO 20, 60 ;

TITLE "Testing Buttons from disk" ;

BRUSH oBrush

DEFINE BUTTONBAR oBar OF oWnd

DEFINE BUTTON OF oBar FILE "Btn1.bmp" ACTION MsgInfo( "FiveWin 1.2" ) ;

MESSAGE "You can place..."

DEFINE BUTTON OF oBar FILE "Open.bmp" GROUP ;

ACTION MsgInfo( "FiveWin 1.2" ) ;

MESSAGE "Any BMP File here..."

DEFINE BUTTON OF oBar FILE "Cut.bmp" ACTION MsgInfo( "FiveWin 1.2" ) ;

MESSAGE "Reading it from disk !!!"

oBar:GoRight()

SET MESSAGE OF oWnd TO "FiveWin 1.2 - The Magic of Windows & Clipper 5"

ACTIVATE WINDOW oWnd

return



--------------------------------------------------------------------------------


I just started using fivewin about three days ago. So far I love it, but I have two simple questions.
1) The buttonbar on my main window has a small vertical double line in the far left position - is there any way to get rid of that?
2) When my app first loads, I see a DOS box, black screen window open just prior to my main window (maximized) - can I bypass that?
Using: Clipper 5.2.e - FiveWin 2.2c - Blinker 6.0


Here we send you a modified wndboxes.obj module that avoid thepainting of such lines. WNDBOXES.OBJ , WNDBOXES.C
> 2) When my app first loads, I see a DOS box, black screen window open
> just prior to my main window (maximized) - can I bypass that?
Could you please test samples\tutor02.prg and confirm is if you still get that DOS box ?


If you build and run your app from a batch file, you may see that DOS box.
But if click and execute your EXE, directly, you should not get such DOSbox.
Could you please check that ?


1) Buttonbar issue solved with the wndboxes.obj file.
2) I recreated my shortcut for the exe and now I don't get the DOS box.





--------------------------------------------------------------------------------


I have FiveWin 2.2c, Clipper 5.2e, Blinker 5.10 The istruction "DEFINE BUTTONBAR oBar DOWN OF oWin" create a bottom Bar that
override the status bar. How could I display it correctly?


If you already have a status bar then you can not place the button bar at the bottom.
The solution is to use a TPanel object as the oClient data, and then place a TButtonBar as the oBottom data of it.
Have a look at samples\TestAlig.prg for a working sample.





--------------------------------------------------------------------------------


Is it NOT possible to implement a menu and buttonbar definition inside of a dialog box? I can use the @row,col BITMAP for the display but I would like to use tooltips in conjunction with the buttonbar.
I'm still new to Fivewin - please forgive my ignorance.


Have you tried assigning cTooltip instance variable:
oBmp:cTooltip = "My tooltip message"

YOU must digit this :
...... activate dialog oDlg ;
ON INIT MENUBAR(ODLG)
RETURN NIL
FUNCTION MENUBAR(ODLG)
lOCAL oBAR
.. DEFINE BUTTONBAR oBar 3D SIZE 26, 26 OF oDLG
.......
RETURN NIL





--------------------------------------------------------------------------------


can any one tell me how to add color to a buttonbar...
I am trying to compile with harbour and add color to the windows buttonbar...
DEFINE BUTTONBAR oBar _3D SIZE 117, 42 OF oWnd CURSOR oCrsHand


oBar:SetColor( , CLR_RED )





--------------------------------------------------------------------------------


Button bars in windows, without "3D" clause and using 0x4L, look broken. Howcan we get
normal button bar look, without using 3D clause while defining button bars please?


Sorry, I don't understand what you mean...
Could you please post some screenshoots (JPGs) and a little source code sample to test it here,
many thanks for your feedback,



The source code is :
DEFINE window oWndMain FROM 00,00 TO 30,60 ;
TITLE OemToAnsi( "SOLUTRONY - "+dtoc(pany)) ;
MENU MenuMain() ;
BRUSH oBrush ;
ICON oIco ;
MDI
DEFINE BUTTONBAR oBar SIZE 40,50 of oWndMain
DEFINE BUTTON OF oBar RESOURCE "clientes" ACTION cadcli() ;
TOOLTIP "Cadastro de Clientes";
NOBORDER
ACTIVATE WINDOW oWndMain MAXIMIZED ON INIT (DlgInicial()) ;
valid confirma("DESEJA SAIR DO PROGRAMA ?")
I`m sending to you the image of error...
P.S.: the error with Button bar is in a main window and no in a dialog... is this my error ????


As far as I know, 3D clause of buttonbar does not use ctl3d.dll, so you can use this clause without any problem. Also, buttonbars are not affected by 0x4L, since the buttons are painted directly by FW code, not windows.
BTW, Antonio, has you seen the last msg I sent to you? What is your opinion?


What about a drop down list box? Ours all look 2D when on buttonbars.


> What about a drop down list box? Ours all look 2D when on buttonbars.
try using my ctl3d.lib from http://www.fivewin.info/~jfgimenez It makes all controls to be 3D look everywhere (on buttonbar, MDI childs, windows, dialogs,...)


I agree with Jose.





--------------------------------------------------------------------------------


operating system win. me - xbase++ 1.7 - fivewin++ and fivewin 2.2 I have twice 2 problems 1 with MESSAGE Bar click with the mouse on the date or the time on the bar of the window the used memory appears. and the second problem is with BUTTON Bar in how much the message doesn't appear of TOOLTIP please know how to give me explanations? thanks and regards to everybody


The used memory is shown only if you click twice on the message bar.You may disable that behavior doing this:
oMsgBar:lInfoRes = .f.
oMsgBar:lCheckRes = .f.
> and the second problem is with BUTTON Bar in how much the message doesn't
> appear of TOOLTIP
That is a known bug just for FW++. We still do not have a solution for it :-(





--------------------------------------------------------------------------------


can any one tell me how to add color to a buttonbar...
I am trying to compile with harbour and add color to the windows buttonbar...
DEFINE BUTTONBAR oBar _3D SIZE 117, 42 OF oWnd CURSOR oCrsHand


oBar:SetColor( , CLR_RED )


thanks





--------------------------------------------------------------------------------


Is it possible to align one or two button at the right of the buttonbar and the rest at the left side if FW195?


Try using AT <nPos> clause of DEFINE BUTTON command.


The AT <nPos> doesn't work, with this you can give the postition,but this is the place-number of the icon and not the position. With this you can put the button in ex. fifth-position but if you give a number higher than the amount
of buttons, an array-error appears.


Sorry, I misinterpreted the mean of that clause.


I use this:
nRow := oButton:nTop()
nCol := oButton:oWnd:nWidth() - oButton:nWidth() - 5
oButton:move( nRow,nCol )


This works great!!!





--------------------------------------------------------------------------------


Is it possible to put a separator between buttons in a buttonbar? Is it possible to move these buttons, in order to make two groups of buttons separated by a separator or by some space?


Use the "group" keyword when defining a button to separate it a small distance from those to its immediate left.


Thanks a lot, Ray. My Fivewin manual is not so complete, so many thanks for your help.





--------------------------------------------------------------------------------


Is it possible to put a buttonbar in a dialog? I need some examples.


Just put TBtnBmp buttons on your DIALOG.

You have to do it with the ON INIT clause:
activate dialog oDlg on init buildBar(oDlg)
...
static function buildBar(oDlg)
local oBar
define buttonbar oBar of oDlg
...
return nil



You're right, but this way the result is not as clean as that on the WINDOWSs, from the graphical point of view.


So, what do you suggest?


If you are asking me, I already suggested to just put some TBtnBmp on
the DIALOG. Try my free EMAG Software IDE to see the result
(http://www.emagsoftware.it/ide.zip).


Looks good. Now we need to see some source example on how to do this.


As I said, just put some TBntBmp on your DIALOG. You don't need of a sample to do this.





--------------------------------------------------------------------------------


Has anyone an example about how to use menus in a button, inside a buttonbar?


Inside a button on a buttonbar? That's unusual... buttonbars are for "one-touch" functionality. I would think that a menu belongs... on the menu!
Incredulity aside, here is an actual (and even possibly useful ;) suggestion: You could place a popup menu at the coordinates of the button when it is pushed:
menu oPopup popup
menuitem ...
...
endmenu
...
activate popup oPopup window oBar at nRow, nCol



"buttonbars are for "one-touch" functionality. "
I agree with you. But in some unusual cases, the client want to have this kind of behavior. So, what can I do? Just learning.



Sample of dropdown menu on a buttonbar:
...
define buttonbar oBar size 26,28 of ::oWnd 3d
oBar:blClicked:= {|| .t. }
define button of oBar resource "new" noborder;
action dropInfo():add();
tooltip "New";
menu ::newMenu()
...
method NewMenu()
local oMenu
menu oMenu popup
menuItem "Mail Message" resource "newmail" action ::oMail:add()
menuItem "Event..." action ::oEvent:add()
menuItem "Contact..." action ::oContact:add()
menuItem "Charge..." resource "dollar" action ::oCharge:add()
menuItem "Note..." action ::oNote:add()
menuItem "Reminder..." action ::oReminder:add()
endmenu
return oMenu


Thanks, James,
You're always a good friend. I have learned many things with you and the rest of the FiveWinners.





--------------------------------------------------------------------------------
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Buttons and ButtonBmps

Postby Antonio Linares » Wed Aug 27, 2008 7:37 am

Buttons and ButtonBmps


--------------------------------------------------------------------------------


When I UPDATE() a Dialog, <Whenfunc> of a my Buttons is not updated; <Whenfunc> is controlled by an item of an array (empty or not empty) the array is evaluated every time I update my dialog. The item is rightly displayed on the dialog, but it doesn't change the button enabled/disabled property. Do somebody know why it?

There is a Method

AEvalWhen() from TWindow

Just do

oYour_Bar:AEvalWhen()

on all the places you needto refresh the buttons.



--------------------------------------------------------------------------------




does anyone knows how to change the button colors? ...


For the normal TBtn Class you can't as I know without changes in FW. But for TBtnBmp you can do it with SetColor().


I need to change the normal TBtn :}}} But i guess i have to change them on bitmap buttons...



--------------------------------------------------------------------------------






I've started playing with TBtnBmp class, and I wonder... is there a way to tell te control where to place the bitmap ?, I mean, align the bitmap to the left or to the right ?


I have had quite a problem with the TBtnBmp class starting with 1.9.5. Last night I pulled the fwbmp.obj out of the 1.9.2 FiveC and life came back to normal. As far as I can tell, ADJUST in 1.9.5 is simply broken, yielding a partial image, and failure to use ADJUST on a bitmap that is not perfectly sized gets you nothing. In 1.9.2 you could feed TBtnBmp an off-sized bitmap and it would force a fit. I need this as I have an application with some 5-600 bitmap buttons of varying sizes and user controllable colors. To avoid having to make over 100 bitmaps I simply have one for each color and let ADJUST do what it's advertised to do -- adjust the bitmap to fit the button. I'm having a similar problem with bitmaps in a tcbrowse in 1.9.5. It works fine in 1.9.2 but goes sour in 1.9.5. I have to move to 1.9.5 or possible 2.0 for TCP/IP support but may have to take some 1.9.2 objs with me. Sure wish Antonio hadn't fixed something that wasn't broken. Regarding your question about BMP placement, I think you will have to modify the ::paint() routine. I had to do so to place multiple text objects on the same button and found it rather straightforward.


The clause ADJUST of Btnbmp is not present anymore since version 1.95, the reason for that is due the display enhancement when the button is disabled, and also the enhancement that makess the buttons background color the same as your button face color on your windows desktop.


ADJUST is certainly present in my copy of 1.9.5. Do you mean 2.0??

Fivewin.ch 8/31/98

TBtnBmp.prg 9/16/98

But as I said, it doesn't appear to work.



--------------------------------------------------------------------------------







Does anyone knows how to build a button containing both icon and text (like the ones at the work bar at the bottom of the Windows 95 screen - the Start button, for example)?


Use PROMPT clause of REDEFINE BTNBMP command.


Take a look at the ::Paint() method in the TBtnBmp Class. That should give you the model.



--------------------------------------------------------------------------------






I've had this problem for so long I just forgot about it. Does anybody know why my disabled buttons (in a buttonbar) look this way ? Is there a way to fix it ?




ACTIVATE DIALOG oDlg ON INIT ( oBtn:Hide(), oDlg:UpDate())

Thanks, I will give it a try. I forgot to say that it only happens in my machine, in others where the program is installed it looks fine. I think it has something to do with some DLL, but I've checked and re-checked that there's only one version of CTL3D.dll in each computer.


Recheck APP directory and \windows\system,have CTL3D.dll ??



--------------------------------------------------------------------------------






i want to change caption of button, the problem is that button caption is "Ok" and then i press it i am change this with oButton:cCaption:="Save" but caption is not changed.


Try oButton:SetText("WhatEver") and then oButton:Refresh()


You have to use oButton:cTitle( "newtitle" ) not cCaption.



--------------------------------------------------------------------------------






How to change text of Button?? I try oBtn:cCaption := cText, oBtn:SetText( cText ), but, all fail!!


oBtn:cTitle := "Your_Text"



--------------------------------------------------------------------------------






The tButton.prg class creates buttons with a style that includes WS_TABSTOP How can I de-activate the tabstop property of a button created from source, after it is created??

Reassign nStyle in your source code like

oYour_Button:nStyle := nOr(what, ever, properties, you, need, here)

This won't work after the window has been activated.


Simply reassigning style is likely to make no effect.


OK, OK, I did not see that this is necessary to happen after activate the window/dialog. Of course it would not work just like :nStyle := (....) Attached is a little example with SetWindowLog and how to Deactivate / Activate button properties which of course would work not only for a button. ( T.PRG )


Thanks for the suggestions I will play with SetWindowLong and look up the various parameters in the MSDN


5. I don't know exactly, but the API SetWindowLong() allows to changeduring run-time some internal characteristic of the controls like style.



--------------------------------------------------------------------------------






I want to change BtnBmp button bitmaps,source code below:

Dialog

PUBLIC oBtn := Array(3)

Redefine BtnBmp oBtn[1] resource "NEW" of oDlg Action ChangeBMP()

Redefine BtnBmp oBtn[2] resource "EDIT" of oDlg

Redefine BtnBmp oBtn[3] resource "DEL" of oDlg

Function ChangeBMP()

oBtn[1]:LoadBitmaps("OK")

oBtn[2]:LoadBitmaps("Cancel")

oBtn[3]:Disable()

RETURN NIL

When I press first button "oBtn[1]",first button can change bitmap to resource "OK" and Third button can Disable itself.But only Second can't change bitmap to resource "Cancel".If I press Second button,it can auto change bitmap.Why??


ADD "UPDATE" after redefine BtnBmp ......



--------------------------------------------------------------------------------






I know FiveWin button style have two,one default windows button below:

redefine button ....... CANCEL

other bitmap button below:

redefine btnbmp .......

I want to add CANCEL function in BTNBMP button.How do I set? Please help me!



As I know you can. You have to change all your valid function to return true and in the function use the oGet:oJump to return to the get you are reading.Something like this:

IF Empty(cLiCodigo)

c5Stop('El código de libro es obligatorio, no puede quedar enblanco.')

oGet:oJump := oGet

SysRefresh()

Return .t.

ENDIF



--------------------------------------------------------------------------------







In my applications I use tbtnbmp for the dialog buttons, and I want to use 'direct accelerators' to them. I have accelerators to the tbtnbm buttons putting &Name to the control on Workshop, but when the user press ANT+N the button get the focus but is not pressed. I want if anybody knows how to do 'direct accelerators' to the btnbtm, that means that whr user press ALT-N the tbtnbmp exectures the action clause directly. It can't be done using bgotfocus because when the user select the buton using the tab key the action doesn't have to be done. Any ideas ?


You use button or buttonbar ?


I use tbtnbmp as buttons in my dialogs. You can see it in www.jsnsoftware.com


What exactly do you mean by "puttind &Name to the control on Workshop"? If you could explain that I'll be one step ahead in doing what you want.

I define a generic control, and in the name field on workshop I write '&N' if I want the accelerator key to be N - for Nuevo.


Didn't know that tip. Let me experiment with it and I'll let you know.


This thing works even with a browse...

----------------------------------------------------------------------------------------------------------------------------------





I'm using buttons from resources

DEFINE BUTTON oBTN1 ID 101 .....

my problem comes when it gets the focus: How can I change the Tbutton, Tcontrol and / or Twindow classes in order to avoid the black rectangle that surrounds it ? My problem is that I already have tons of code that I can't rewrite again. So the solution (if it exists) have to come on this kind of button....

Uncheck the 'Border' Attribute from resource editor on this button From source define the button bitmap with NOBORDER



thank you for your help, but I did a little mistake. The sentence I use isn't

DEFINE BUTTON

but

REDEFINE BUTTON

into the .RC it's declared in this way:

CONTROL "INDEX", 798, "BorBtn", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, coords...

so the class I'm using is Tbutton() and not Tbtnbmp(). Tbutton() doesn't have the ::lBorder property so I suppose I should change the style but I don't know how.



I think you mustbe use TBtnBmp button to solve your problem.Below:

REDEFINE BTNBMP oBtn RESOURCE "BITMAPS" NOBORDER OF ...

Try This ( BUTTON.ZIP )

you did an excellent job and it will be very useful. But my trouble still remain. I will write you privately explaining what I'm meaning.



:-( sorry, Giovi, that you will explain with private email... The result may be interesting for many peoples: bitmaps as buttons which dont have the behaviour of standard Borlands buttons.



--------------------------------------------------------------------------------


Does anybody know how to change the color of a button? (from a resource) I tried after

REDEFINE BUTTON oButMenu ID 203 OF oDlg the following:

SetTextColor( oButMenu:hDC, CLR_RED )

SetBkColor( oButMenu:hDC, CLR_RED )

and

oButMenu:SetColor(CLR_RED,CLR_RED)

and

oButMenu:nClrText:=CLR_RED

oButMenu:nClrPane:=CLR_RED

and

DEFINE BRUSH oBrush COLOR CLR_RED

oBut:oBrush:=oBrush

All without any effect!



You cannot change the color of a standard Windows button (TButton class), I think.


Have you tried these things In the INIT cluase of the ACTIVATE WINDOW or DIALOG?

ACTIVATE DIALOG ON INIT ..

¿ Are you using Borland Buttons ? (you know, the ones with bitmaps inside them), if so, I'm sorry, you cannot change color to Borland Style Buttons since they are based on bitmaps, you'd better use TBNTBMP class.


Thank you all for your replies. The ON INIT sugestion does not work, it seems that Tbutton simply does not allow changing its color. The Tbtnbmp works just fine (just do not specify a bitmap) with changing colors, there is only a problem with a refresh after a double click. But this is resolved by adding the method LDblClick(). Further more method LButtonUp() needed a refresh() and a releasecapture().



--------------------------------------------------------------------------------


In the process of removing Borland buttons, I'm looking to convert more of my Buttons into BtnBmp buttons (which I've never bothered using until now, as a Borland button + bitmap has been quite suitable).
What's the trend? Are you guys tending to favour BtnBmps more and more, or trying to use basic Buttons wherever possible? What are the benefits and disadvantages?
(I don't have XP, but a few sample XP screens I saw on Patrick's site seem to mainly have the traditional buttons, albeit with rounded corners).


The only one I've used is a calendar in a third-party button get control. I tend to emulate Microsoft's interface styles. Granted MS doesn't do
everything the best way, but almost all computer users use MS products so the closer your program is to what they are used to, the better accepted it will be.
MS doesn't use many bitmap buttons.
I think you might find the following article on interface design quite interesting:
http://joel.editthispage.com/stories/storyReader$51
I also HIGHLY recommend Alan Cooper's book, "About Face" on interface design. I consider this to be the most important book on programming that I have. It is available at www.Amazon.com.



--------------------------------------------------------------------------------


updating from fw 2.0 to 2.3, Buttons from source code are non displayed on dialogs. Obviously I'm doing something wrong, but I don't know what ! Here's the code :
DEFINE DIALOG oDlg1 FROM 00,00 TO 50,128 ;
OF oWnd ;
TITLE c_titolo ;
COLORS c_col_txt,c_col_bck
.........
@ 25,xB1 BUTTON oButCancel PROMPT cPrmCancel OF oDlg1 ACTION CARTELLE_D()
SIZE xBut/2,yBut/2
.........
ACTIVATE DIALOG oDlg1 CENTERED


On 2.2 version we had to change the buttons coordinates, to properly adjust to the new fonts management system.
You may use previous include\constant.ch and rebuild source\classes\button.prg, or change some contant.ch buttons related values to get a similar look.
We apologize for those changes, but there was the only way to implement fonts reuse on FW.





--------------------------------------------------------------------------------


Does anybody know how to use a hotkey for a BtnBmp like "&Close" with Alt-C without using the prompt-clause ?


If there is a menu, you can make it a menu choice. If it is on a dialog you can put an invisible button on it.


Good idea, but how can i disable these hidden buttons from tab in a selfdefinded dialog?


Just uncheck Tabstop on button properties.





--------------------------------------------------------------------------------


Please help me solve the problem. I have the dialog with LISTBOX and two BUTTONS created. The LISTBOX browses a databse file. I need to
enable/disable the button2 depending on the value of the field in the actual record, but it doesn't work. The button2 is
described this way:
REDEFINE BUTTON oBtn2 ID 140 OF oDlg ACTION MsgInfo('Button2') WHEN davka->pocet=0 //This should disable button depending on the value of the field
The ON CHANGE part of the listbox refreshes the oBtn2, but the button2 is always enabled.


Add the following to the ON CHANGE clause:
oDlg:aEvalWhen()





--------------------------------------------------------------------------------


Hello ! I'm using this class is some dialogs . I know that can assign to oBtnbmp:lCancel := .t. . In some cases I need default , but oBtnbmp:lDefault := .t. doesn't work . What to do in this situation ?


Try to trap Enter key.


Thank for your reply ! I tried your advise , but unsuccesfull .
At first I tried oGet:KeyDown := {|nKey| if( nKey == 13 , ... }
But I get an error : "No exported method : _Keydown
Then I wrote oDlg:bKeyDown := { |nKey| if( nKey == 13, ... }
But this can't to trap Enter ! What I'm doing wrong ?
Here is my source :
function MsgGet( cTitle, cText, uVar, lMask, uPict, oFont )
local oDlg, oBut1, oBut2
local oGet := uVar
local lOk := .f.
local nK1 := nK2 := n := j := m := nWd := nBt := 0
local nRg := 8
local nK3 := nK1 + 50
local nK4 := nK2 + 50
local oFnt := if( !empty( oFont ), oFont, oFont_pagr )
local nFh := oFnt:nHeight
local nFw := oFnt:nWidth
local nRw := nFh - 1
DEFAULT lMask := .f.
DEFAULT cText := if( lMask, if( cLg == "L", "Kodas :", "Code ( ID ) :" ), if( cLg == "L", "Kintamasis :", "Variable :" ) )
DEFINE DIALOG oDlg FROM nK1, nK2 TO nK3, nK4 PIXEL ;
TITLE cTitle FONT oFnt STYLE DS_MODALFRAME
j := oDlg:GetWidth( cText )
m := oDlg:GetWidth( strtran( uVar, " ", "W" ) )
nWd := j + m + 40
j := j / 2
m := m / 2
@ nRw, 3 SAY cText SIZE j + 2, nFh PIXEL FONT oFnt OF oDlg
if lMask == .t.
@ nRw, j + 10 GET oGet SIZE len( uVar ) * nFw, nFh PIXEL PASSWORD FONT oFnt OF oDlg
else
if !empty( uPict )
@ nRw, j + 10 GET oGet SIZE len( uVar ) * nFw, nFh PIXEL FONT oFnt PICTURE uPict OF oDlg
else
@ nRw, j + 10 GET oGet SIZE len( uVar ) * nFw, nFh PIXEL FONT oFnt PICTURE "@!K" OF oDlg
endif
endif
nRw += nFh + 4
@ nRw, nRg BTNBMP oBut1 SIZE nBut_w, nBut_h ;
NAME "Ok" OF oDlg ACTION ( lOk := .t., oDlg:End() )
oBut1:cToolTip := cGerai
nRg += nBut_w
@ nRw, nRg BTNBMP oBut2 SIZE nBut_w, nBut_h ;
NAME "Cancel" OF oDlg ACTION oDlg:End()
oBut2:cToolTip := cCancel
oBut2:lCancel := .t.
nBt := ( nRw + nBut_h * 2 ) * 2 + 10
oDlg:bKeyDown := { |nKey| if( nKey == 13, ( lOk := .t., oDlg:End() ), ) }
ACTIVATE DIALOG oDlg ON INIT ;
( oDlg:Move( nK1, nK2, nWd, nBt ), oDlg:Center() )
if lOk == .t.
uVar := oGet
endif
return lOk
Many thanks for any help !


There are some errors in your code. This is a working version:
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL cVar := SPACE( 20 )
LOCAL oFnt
DEFINE FONT oFnt NAME "Arial" SIZE 0, -10
MSGGET( "Prova", "Testo", @cVar, .T., , oFnt )
RELEASE FONT oFnt
RETURN NIL
function MsgGet( cTitle, cText, uVar, lMask, uPict, oFont )
local oDlg, oBut1, oBut2
local oGet
local lOk := .f.
local nK1 := nK2 := n := j := m := nWd := nBt := 0
local nRg := 8
local nK3 := nK1 + 50
local nK4 := nK2 + 50
local oFnt := if( !empty( oFont ), oFont, oFont_pagr )
local nFh := oFnt:nHeight
local nFw := oFnt:nWidth
local nRw := nFh - 1
DEFAULT lMask := .f.
DEFAULT cText := if( lMask, if( cLg == "L", "Kodas :", "Code ( ID ) :" ), if( cLg == "L", "Kintamasis :", "Variable :" ) )
DEFINE DIALOG oDlg FROM nK1, nK2 TO nK3, nK4 PIXEL ;
TITLE cTitle FONT oFnt STYLE DS_MODALFRAME
j := oDlg:GetWidth( cText )
m := oDlg:GetWidth( strtran( uVar, " ", "W" ) )
nWd := j + m + 40
j := j / 2
m := m / 2
@ nRw, 3 SAY cText SIZE j + 2, nFh PIXEL FONT oFnt OF oDlg
if lMask == .t.
@ nRw, j + 10 GET oGet VAR uVar SIZE len( uVar ) * nFw, nFh PIXEL PASSWORD FONT oFnt OF oDlg
else
if !empty( uPict )
@ nRw, j + 10 GET oGet VAR uVar SIZE len( uVar ) * nFw, nFh PIXEL FONT oFnt PICTURE uPict OF oDlg
else
@ nRw, j + 10 GET oGet VAR uVar SIZE len( uVar ) * nFw, nFh PIXEL FONT oFnt PICTURE "@!K" OF oDlg
endif
endif
nRw += nFh + 4
@ nRw, nRg BTNBMP oBut1 SIZE 20, 20 ;
NAME "Ok" OF oDlg ACTION ( lOk := .t., oDlg:End() )
oBut1:cToolTip := "Tooltip"
nRg += 20
@ nRw, nRg BTNBMP oBut2 SIZE 20, 20 ;
NAME "Cancel" OF oDlg ACTION oDlg:End()
oBut2:cToolTip := "Cancel"
oBut2:lCancel := .t.
nBt := ( nRw + 20 * 2 ) * 2 + 10
oGet:bLostFocus := { |nKey| if( GetKeyState( VK_RETURN ), ( lOk := .t., oDlg:End() ), ) }
ACTIVATE DIALOG oDlg ON INIT ;
( oDlg:Move( nK1, nK2, nWd, nBt ), oDlg:Center() )
if lOk == .t.
// uVar := oGet
endif
return lOk


Thank you ! Now this is working OK .


you missed the "b" oGet:bKeyDown := ...





--------------------------------------------------------------------------------


I need emulate an CLAUSE CANCEL of button class without button, or an function with send an cancel (Gets) of dlg.


You may set any control <oControl>:lCancel = .t.





--------------------------------------------------------------------------------


how to change the button text color ?
==> oBtn:cTitle


Have you tried oBtn:SetColor( nForeground, nBackground )?
Do it in the On init clause in the Activate Dialog command





--------------------------------------------------------------------------------


I try to DISABLE button when user empty edittext and ENABLE while they type something in edittext. But the button did not ENABLE.
DEFINE DIALOG oDlg RESOURCE 'TEST'
REDEFINE GET oGet VAR cText ID 101 OF oDlg
REDEFINE BUTTON oBtn ID 102 OF oDlg WHEN !empty(cText)
ACTIVATE DIALOG oDlg
Thanks in advance for any idea,


Try calling oDlg:aEvalWhen() inside the ON CHANGE clause of the REDEFINE GET command.


Thanks Enrico, but it's still not work. I don't know why?


The problem lies in the fact that ON CHANGE clause is evaluated *before* the pressed key is assigned to the GET variable. TGet class would need a fix. Anyway, this is a (ugly!) workaround:
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
LOCAL oGet, oBtn
LOCAL cVar := SPACE( 10 )
DEFINE DIALOG oDlg
@ 1, 1 GET oGet VAR cVar OF oDlg;
ON CHANGE ( oGet:Assign(), IF( nKey >= 32 .AND. nKey <= 126, oBtn:Enable(), IF( EMPTY( cVar ), oBtn:Disable(), oBtn:Enable() ) ), .T.
)
@ 3, 1 BUTTON oBtn PROMPT "Button" OF oDlg;
WHEN !EMPTY( cVar )
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL


Try this instead:
REDEFINE BUTTON oBtn ID 102 OF oDlg WHEN !empty(oGet:oGet:varget())
Note that there is a double oGet (because there is a Clipper get object inside the FW get object). I think you need to use this to get the data from
inside the get buffer. I don't think cText is updated until the get is exited.


Tried. No difference at all. Anyway, I use cVar in my sample, notoGet:cText() method.
> Note that there is a double oGet (because there is a Clipper get object
> inside the FW get object). I think you need to use this to get the data from
> inside the get buffer. I don't think cText is updated until the get is
> exited.
As far as I know, the GET variable is constantly updated. Using cVar (the GET variable), oGet:cText() or oGet:oGet:VarGet() should get to the
same result.


Sorry, I meant to address my message to Dutch instead of to you.
> As far as I know, the GET variable is constantly updated. Using cVar
> (the GET variable), oGet:cText() or oGet:oGet:VarGet() should get to the
> same result.
I tried your example as posted and it worked perfectly. Good work.


No problem. I learned a lot from your messages.
> > As far as I know, the GET variable is constantly updated. Using cVar
> > (the GET variable), oGet:cText() or oGet:oGet:VarGet() should get to the
> > same result.
> I tried your example as posted and it worked perfectly. Good work.
Thanks, but it's really not a solution as clean as I would want to write. My personal TGet class have a better solution inside it.


Thanks a lot Enrico and Jame, It's work perfect.


I use (in similar cases following:
redefine button ........ when edtmode
edtmode is set to .T. or .F. depending on when the button should be enabled.
Works perfect.


I think so, but first step BUTTON is DISABLE because edittext is empty. When I type something BUTTON should be ENABLE but it's still DISABLE. I don't know why?





--------------------------------------------------------------------------------


How can I put a text consisting of 2 lines on a button?


Add to Style Button the number 8192
----------------------------
#define CR Chr( 13 )
//
FUNCTION uMultLineBtn_Test()
local oDlg, oBtn
local cCaption := 'Botones con...' + CR + ;
'caption multilínea.-' + CR + ;
'Para conseguirlo basta con emitir la sencilla sentencia...' + CR + ;
'oBtn:nStyle := ' + CR + ;
'nOr( oBtn:nStyle, 8192 )'
DEFINE DIALOG oDlg ;
FROM 00, 00 TO 17, 100 ;
TITLE cCaption
@ 03, 03 BUTTON oBtn PROMPT cCaption ;
OF oDlg ;
SIZE 100, 070
oBtn:nStyle := nOr( oBtn:nStyle, 8192 ) // this works fine!
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL


Thank's James, i needed this too.
Do you know how to do this with a button from resources.... ?


I tried (obt:nstyle:=nor(obt:nstyle,8192); obt:settext('Regel 1'+CR+'Regel
2')) but with resources it does not work. The CR (I tried 13 & 141) are
shown as straight thick lines.
Any other ideas?





--------------------------------------------------------------------------------


I am still looking for a solution which enables me to put 2 (or even more) lines of text on a button which is created from a .dll resource. I've tried several things but still haven't found a working solution.


Haven't tried it, but maybe you can create the buttons as "generic controls" (ie like a TWBrowse or TCBrowse is handled), Then you could
add the BS_MULTILINE style there, ie, from inside Workshop
a) click on the "key" icon on the Tools floating window (third column,
at the bottom)
b) In the Class field enter (with quotes): "TButton"
c) In the Style field enter (without quotes): 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_MULTILINE
Let us know it that works.


You have to:
1. Open your DIALOG resource and go to Edit as text mode.
2. Add the value 8192 at the end of the PUSHBUTTON statement (separate it by a comma).
3. Inside the ON INIT clause of the DIALOG command use oBtn:cTitle() method to set the caption of the button (separate the lines by a CHR( 13
)).
That's all.


Thanks, works great! Gives a great addition to make-up dialogs


Certainly Enrico's code is simpler than my suggestion, mainly because I tried entering BS_MULITLINE instead of 8192, but BRW didn't recognize that constant (just like it doesn't reconginzes SS_SUNKEN).


> Certainly Enrico's code is simpler than my suggestion, mainly because I
> tried entering BS_MULITLINE instead of 8192, but BRW didn't recognize
> that constant (just like it doesn't reconginzes SS_SUNKEN).
The weird thing is if you enter 8192 and recompile then BRW replace it with BS_MULTILINE. But if you directly enter BS_MULTILINE then BRW won't recognise it. :-?


Exactly. The same happens with SS_SUNKEN. You have to enter 0x1000 and when saved BRW translate it to SS_SUNKEN. Go figure!


How can you resolve this if you do not use Workshop?


Just using STYLE clause of @ row, col BUTTON command.


Thanks for your answer, Enrico. How do you use STYLE Clause?


A working sample follows:
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
LOCAL oBtn
DEFINE DIALOG oDlg
@ 1, 2 BUTTON oBtn PROMPT "Multiline" + CHR( 13 ) + "button" SIZE 50, 50
oBtn:nStyle = NOR( WS_CHILD, WS_VISIBLE, WS_TABSTOP, 8192 )
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL



Enrico, do you know if it is possible to change the background colour of a button?


No. As far as I know, background color of standard Windows pushbuttons can't be changed. Maybe you can paint your own color over the existing one during ON PAINT event (not tested).


You can't. That's why Manuel Mercado (among other reasons) created the TSButton class.





--------------------------------------------------------------------------------
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

C code in FiveWin

Postby Antonio Linares » Wed Aug 27, 2008 7:38 am

C code in FiveWin


--------------------------------------------------------------------------------


Does anyone know what the TC.EXE command line parameters are for createing OBJ's that work with Fivewin?

With my old TurboC++ 1.01 I use the following syntax that seems to work perfectly:

tcc -2 -G -Iinclude -K -O -Z -c -d -f- -ml -w your_C_source

Oops. I meant BCC.EXE command lines.


I am simply doing that :

bcc -c -ml my_source.c

and it works just fine. You could obtain a list of all the possible options by just typing bcc on the command line.


Also test

bcc -ml -c -Iyour_include_directory yourcfile.c



--------------------------------------------------------------------------------





Does anybody has a sample project for Visual C++ 6 that builds a DLL that is accesable by FiveWin. Or a Borland C++ Builder 4 project?

I use borland 5.4 now, but not the IDE, i wanne build the DLL's in a IDE.


There is a full working sample at SAMPLES\DLLS\C_LANG\32BITS (for Borland 5 C/C++).


Yes I know. And I have managed to build some C functions into a DLL and acces them via FiveWin. Works great! But I want more...<g> I want to build my DLL's with the IDE interface of CBuilder or even better, Visual C++. So If someone has build a DLL accessable via fivewin win the IDE of CBuilder or Visual C++ I wouild love to see the project files.


I know you have the Visual C++ Bible from Richard C Leinecker & Tom Archer. Now, if you will turn to page 839, we will begin the lesson. It's precise and to the point, should take you 20 minutes to get a dll up and going. And don't tell me your dog ate your book.


I was already at page 840! So I'm gonna read further. Hey man, thanks for the tip!<g>


Its been a while since we have done one but we create a DLL in MS Dev Studio 6.0 that we use in Fivewin for accessing the DUN entries. If you are still having trouble let me know and I will look up my settings. The trick is getting the DLL define file correct if I remember.



--------------------------------------------------------------------------------






Can anyone send me a resource compiler that works with FW and Clipper? Thanks. i don't have the money to buy Turbo C++ or Visual C++ 16 bits, and is a waste of money since i won't use the C compilers...

Somebody sometimes ago asked about it and I've already attached the MS RC.exe as answer to his request. You should be able to find it if you will search for this message. If you won't find it write me and I will send you something. "TOP System srl" topsyst@alpcom.it

You can go to the Borland site, register and download the Borland C/C++ 5.5 compiler All for free!!! :-)



--------------------------------------------------------------------------------






I'm looking for Xbase++ & Fw++ Compatible C Compiler, because i have some modules coded in .C for Clipper5.3 and I must porting to 32 bits under Xbase ++. I used Bcc55 with the flags Bcc32 xxx.c -a1 -c -u- but alink reports that ' the current xxx.obj is invalid or corruted' is there other free compiler such as Dgjcpp or similar that works with alaska?


You may use BCC32.exe -it is the one we use at FiveTech to build FiveWin++- The trick is that as Borland generates OMF OBJs format you do need to turn them into COFF OBJs format. To do so, we do use Microsoft LIB.exe 32 bits that makes it automatically. Then you link the resulting library. If you need it we may provide you the exact syntax we do use with LIB.exe 32 bits.



--------------------------------------------------------------------------------





El compilador C que te puede servir es el de Microsoft Visual C++ version 4.0 o posterior. al parecer existen algunos problemas con el de borland.

You may use BCC32.exe -it is the one we use at FiveTech to build FiveWin++- The trick is that as Borland generates OMF OBJs format you do need to turn them into COFF OBJs format. To do so, we do use Microsoft LIB.exe 32 bits that makes it automatically. Then you link the resulting library. If you need it we may provide you the exact syntax we do use with LIB.exe 32 bits.


If you can say me the correct sintasix please .


I'm interested in the syntax too. Please send them to me also.


First step is to create the 32 bits LIB:

c:\msdev\bin\lib /DEF:lib\YourLib.def /OUT:lib\YourLib.lib

where YourLib.def is an ascii file with these contents:

LIBRARY MYLIBNAME

EXPORTS

dummy @1

Next, you start adding OBJs to it (compiled using Borland bcc32.exe):

c:\msdev\bin\Lib YourLib.lib /OUT:YourLib.lib YourObj.obj

The syntax we use to call Borland is:

bcc32 -c -u- -w-dup -Ic:\FiveWin\include;c:\alaska\xppw32\include YourFile.c



--------------------------------------------------------------------------------






As we have explained previously, XBase++ requires OBJs in COFF format. As Borland just generates OBJs in OMF format, we do use Microsoft LIB.exe 32 bits to turn OMF into COFF OBJs. Here it is the way to use it:

First step is to create a 32 bits LIB:

c:\msdev\bin\lib /DEF:lib\YourLib.def /OUT:lib\YourLib.lib

where YourLib.def is an ascii file with these contents:

LIBRARY MYLIBNAME

EXPORTS

dummy @1

Next, you start adding OBJs to it (compiled using Borland bcc32.exe):

c:\msdev\bin\Lib YourLib.lib /OUT:YourLib.lib YourObj.obj

The syntax we use to call Borland is:

bcc32 -c -u- -w-dup -Ic:\FiveWin\include;c:\alaska\xppw32\include YourFile.c



--------------------------------------------------------------------------------






I have some problems when i try to merge xbase code & c code, i have a function created in C makes a simple call to a winapi function ( MessageBox ) and I'd like to execute under xbase. f.e.:

Function is called IATest()

MessageBox(NULL,"Hello world","Hello",MB_OK);

....

I put IATest.obj in a 32 lib file with Microsoft lib32. (MyLib.lib)

I Link with

aLink test MyLib.lib User32.lib

(User32.dll provided in \alaska\xppw32\lib says that _MessageBoxA is not declared in user32.dll, but i create and import lib, extracting def file from user32.dll with borlands bcc55 (impdef -a ) and next creating the lib with aimpdef , this time links goes ok.) but when i execute the source a windows dialog box says that not exists a function _MessageBoxA vinculated to the library User32.dll, The mistake is that if i used MessageBeep() , everething is ok. in some winapi functions go and in others nothing. whats wrong.



You have use Borland 32 bits this way (for XBase++)

c:\bc5\bin\bcc32 -c -u- -w-dup -Ic:\alaska\xppw32\include Yourfile.c

And don't forget to include <WinTen.h> Winten.h keeps inside a long list for XBase++. Check that the function you need to call is there. If not, place it yourself.



--------------------------------------------------------------------------------






sometimes I wish to compile C source code in order to get a clipper compatible OBJ but really I don't know how to do since I don't know C compiler. I have MS C++ 5 (Visual Studio). Does anybody can tell me basic steps in order to make a new file into Visual Studio, compile it and get a clipper Obj ?


If you mean MS C++ from Visual Studio 5 it is no going to help you much with clipper + fivewin as it does not create 16 bits obj any more. But with Borland 5.01 I am just using for quick access

bcc -c -ml myfile.c

from the command prompt or for help just bcc and it will show all the options. For BCC 5.5 I am not sure. Patrick, Antonio, anybody else....


I know that up to version 5.5 it is possible to compile 16 bits, but what about 5.5 ?


5.5 does not provide a 16 bits compiler. This is why we use Borland 5.2 for that. Anyhow, soon we all will be using Harbour :-)


Yes, I thought so. I am using Borland 5.01.

> Anyhow, soon we all will be using Harbour :-)

I really would like to see a proper OLE implementation in FWH. There are so many things we could do with it.


We are actually working on enhancing and completing the existing one.


Cool, need a tester ?



--------------------------------------------------------------------------------


What I do to implement the next code in C ? I don't understand how I send a 2d array to C and use it. This is a simple sample:
-----------------------------------------------------------------------
aArr = {}
AAdd( aArr, { 1, 2, 3 }
AAdd( aArr, { 4, 5, 6 }
AAdd( aArr, { 7, 8, 9 }
? NewSay( aArr ) <- this is the C code that I need.
-----------------------------------------------------------------------
function newsay( aArr ) // This is the clipper code.
local x, y // I need it in C code.
local nLenX := len( aArr )
local nLenY := len( aArr[ 1 ] )
local nRet := 0
for x := 1 to nLenX
for y := 1 to nLenY
nRet += aArr[ x, y ]
next
next
return nRet


You need this using Harbour Api? if yes I can help. I use this on hbzlib


No. This code is for pure clipper+fivewin application. I made a class to draw buttons like windows XP style, but I need use C wrappers to
improve speed. I don't know how I can read, in C, an 2D array passed for clipper as parameter.
-----------------------------------------------------------------------
aArr = {}
AAdd( aArr, { 1, 2, 3 }
AAdd( aArr, { 4, 5, 6 }
AAdd( aArr, { 7, 8, 9 }
? NewSay( aArr ) <- this is the C code that I need.
-----------------------------------------------------------------------
function newsay( aArr ) // This is the clipper code.
local x, y // I need it in C code.
local nLenX := len( aArr )
local nLenY := len( aArr[ 1 ] )
local nRet := 0
for x := 1 to nLenX
for y := 1 to nLenY
nRet += aArr[ x, y ]
next
next
return nRet


Can't you pass each single array item to the function? Something likethis:
? NewSay( aArr[ 1 ], aArr[ 2 ], aArr[ 3 ] )


Hmm... its an idea... a good idea. I'll try it. Thank you for the hint.


Try _itemArrayGet() it retrieves an element of an item of type array, see the "Clipper Technical Refrence"


I found the solution:
AAdd( aArr, { 1, 2, 3 }
AAdd( aArr, { 4, 5, 6 }
AAdd( aArr, { 7, 8, 9 }
1) Convert the 2D array to 1D array
aArr = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }
2) Use a function to converte x, y parameter to an index:
static WORD Array2D( WORD x, WORD y )
return ( ( x - 1 ) * 3 ) + y; // 3 is the len of each element of 2D array
3) Extract the parameter with:
_parnl( 1, Array2D( x, y ) )
Its working fine here. Thanks for all help.





--------------------------------------------------------------------------------


I have a question: I made a function with some moveto(), lineto() functions to draw a folder with windows XP style write in pure clipper
and it is working fine. Now I have a question: using moveto() and lineto() in a C function, I improve the speed or no?
Simplifying: The moveto() and lineto() have the same speed in C and clipper functions ?
My tests here have the same results and I'm very confused...


The API in themselves have the same speed without regard to the laguage used. Clipper statements eventually used can be much more slow than the C counterparts.


Clipper is VERY fast! ;-)


Since the Clipper was made in C language and both all the commands and functions, the speed difference is almost zero, specially if you're using low level functions in Clipper, you maybe cannot see the difference.


You are right, my tests here say me that clipper sometimes is more fast than C, specially if I use low level functions.
I convert foldtool.c in clipper code and if I call the function that draw the folder inside an for/next structure to measure the time, I
don't see differences with clipper and C, but sometimes, clipper is more fast than C.


In my opinion C is more fast than Clipper API Codes As you know or not I made many 3rd pary for FiveWin by myself, which is
Related Graphics....
And I reached at a Result, and That is C API code is more faster than Clipper WinAPI code! It is why Anonio use C code for his Graphic working for FiveWin


I agree. And the best result is to write the rutine directly in C.


Ok. I'll convert my clipper code thar paint my folder to C code and when I finish I display the result here.




--------------------------------------------------------------------------------


I am trying to Create a C program that I what to place inside a DLL. To be able to call from my Five Win program. Can someone tale me
how to Create the DLL and then Call it from FiveWin. I have bend able to Call other Functions from DLL with the DLL32 Function Command
but I want to Create A C program and place it inside the DLL the C program Uses the Shell32.DLL and the User32.DLL or the *.Lib from
C. I can Compile and Run the C program as a *.exe file.


You have a several working samples at fw\samples\dlls\c_lang



I am using Fivewin Version 1.9.2 and I don't have the Directory (Fw\samples\dlls\c_lang) on my version. Can you with a copy of
that directory.





--------------------------------------------------------------------------------


I need use float numbers in my fivewin C functions, but if I try to use float, an error occur when I link my application. What I do:
example:
CLIPPER XPDEG( PARAMS )
{
int val1 = _parni( 1 );
int val2 = _parni( 2 );
float val = val2 / val1;
...
}


"float" is not a valid typedef in C
You better use
signed long
or
unsigned long
The floating point routines are automatically searched from the library model you are using

These are integer numeric types not floating-point.
> The floating point routines are automatically searched from the library
> model you are using
???


> > "float" is not a valid typedef in C
I should have said C++ (sorry)
> What? float is a native C type.
Yes, in ansi C



> > > "float" is not a valid typedef in C
> I should have said C++ (sorry)
float is a native type for C++ also.
> > What? float is a native C type.
> Yes, in ansi C
And C++ also. BTW, the correct names are ISO C and ISO C++.
> > > The floating point routines are automatically searched from the library
> > > model you are using
> > ???
> Here I reproduce a part of Borland C++ Programmer's Guide:
> long [int] <identifier> ;
> [long] double <identifier> ;
> Description
> When used to modify an int, it doubles the number of bytes available to
> store the integer value.
> When used to modify a double, it defines a floating-point data type with 80
> bits of precision instead of 64.
> The Borland C++ IDE links the floating-point math package if you use
> floating-point values or operators anywhere in your program.
> Borland C++ 5.0 Programmer's Guide
You said something referring to library models. That is an obsolete concept that have nothing to do with floating-point math.


You need Microsoft C of a certain version (5.5?) to succesfully use floating-point math with Clipper.


You can not use float types with fiwewin on a C code,directly, whatever the compiler you use. What I do is to make c functions that returns the float number like a string .This functions has to be on a dll.


Uhm... I think you're right.


Thanks to all for your support.
I find in \fw22\source\function\DRIVES.C an use of float in function CPUSPEED. What version of C I need to compile it ? I have BCC 5.0


Well, this demonstrates that it is possible, right? Sorry for myprevious incorrect statement.
> What version of C I need to compile it ? I have BCC 5.0
I think you need Microsoft C. Maybe version 5.5 but I'm not sure.


No problem. I try to use BCC50 and it compile fine. Thanks to all for your help.


Maybe only DOS apps need MSC to compile floating-point math operations...





--------------------------------------------------------------------------------


I made an small sample in C that use double ( can be float ) but I receive an error when I link my application:
F_FTOL@: unresolved external
What I need to compile it ? I have BCC 5.0
// This is only for sample, do nothing. I need only way to compile and use float or double and convert it to long or int.
CLIPPER FLO1()
{
double nInt;
double nDblR;
nDblR = _parnl( 2 ) / _parnl( 3 );
nInt = nDblR;
MoveTo( ( HDC )_parnl( 1 ) , nInt, nInt );
}


I think you have to link the BCC 5.0 math library.


Yes, you are right, linking MATHS.LIB its works. Thanks Enrico.





--------------------------------------------------------------------------------


I had to reformat my computer's hard drive and I forgot to backup the Borland C++ 5.5.1 free compiler. Now I can't dowload it from the Borland's web site (don't know why).
Does somebody know any other web site where can I download it ?


I am able to download it from this link without any problems,
ftp://ftpd.borland.com/download/bcppbui ... etools.exe
If you can't get it, I may email it to you.


I got it :-)) Thanks a lot.


Remember you have to create these files yourself in order to get it properly running :-)
BCC32.CFG ILINK32.CFG





--------------------------------------------------------------------------------


Can anyone guide me what flags I should use with brc32.exe to compile C-code to make 16bit obj files for linking with FW/Clipper applications please?


brc32.exe is not a C compiler, is a resource compiler. bcc32.exe is a C compiler but is a 32 bit one and can't compile in 16 bit mode (as far as
I know).


Thanks. I am sorry, I meant bcc32.exe but not brc32.exe. That was a spelling mistake.
So, now I need to hunt for bcc.exe


bcc -c -ml yourcode.C >errorc.log


Thnaks. I have bcc32.exe but not bcc.exe. I shall try to get bcc.exe. Meanwhile, if you can advise me where can I find if free, I shall be
grateful


You can get Borland C++ for FREE from:
ftp://ftpd.borland.com/download/bcppbui ... etools.exe


This is bcc32.exe (32 bit) not bcc.exe (16 bit).



Thanks. You are right. Can you please advise me where can I get bcc.exe (16bit) or how to produce 16bit obj files with bcc32.exe ?


Sorry, I don't know. If I remember correctly, the old TurboC, that you can use to produce 16 bit OBJ for Windows (even if it is only a DOS
compiler), has been released as free software.
> or how to produce 16bit obj files with bcc32.exe ?
I think that it is not possible.



I have downloaded and installed. But the installation produced bcc32.exe only and NOT bcc.exe/ Can I not produce 16-bit .obj files with bcc32.exe? I could not find any help from the documentation about it. Any help please?


´ll have Bcc.exe(Borland C++ 5.01) and i can compile the files for you


Is it not possible at all to generate 16-bit obj files with bcc32.exe?





--------------------------------------------------------------------------------
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Canal Five Utilities

Postby Antonio Linares » Wed Aug 27, 2008 7:39 am

Canal Five Utilities


--------------------------------------------------------------------------------


I'd like to get some feedback from anyone using CanalFive Grid. Can you do Excel type editing? Is it stable?

Yes, it is and work fine. I tested the 2.0 w demo version to edit like excel a array of 5 columns and 10 rows without press enter to edit a cell. You must use the clause oGrid:lEditLine := .t. to edit like Excel I use fw195, clipper 5.2e and comix 3.0


Thanks for the feedback. I'm looking at the demo now...


I am using c5grid since a couple of years for some browsing. The essential feature is that it allows multiline browsing and editing. You can edit like excell, add bitmaps into headers. Too many coding to define a browse, columns, headers ... It is almost stable. A little buggy (Refresh problems) when they are few records in your database, specially when you delete records or append. As soon as you have more than one page browse, it's Ok.

You only use it for some of your browses?

<<Too many coding to define a browse,

> columns, headers ...>>

What do you mean by this?

> It is almost stable. A little buggy (Refresh problems) when they are few

> records in your database, specially when you delete records or append. As

> soon as you have more than one page browse, it's Ok.>>

Almost stable is not a good sign. I have a number of browse/grids where there is fewer records than will fill the browse, this could be a problem. Are they working to fix it?



yes i only use it for very few browses where mostly i need multiline . I prefer standard fivewin browses much more stable. I will send you by e-mail a sample of a program using c5grid.


How can you market a product when the default browse behavior is considered more stable? <g> I don't see many msgs concerning CanalFive grid, I though they had a newsgroup or forum somewhere... I have my problems with the standard browse as it is. The problem you mentioned with C5Grid I also have with standard browse. Thanks again and I look forward to your example,


i need to buy the grid add-on to fivewin, last week we send you the credit card number and we don't receive anything from you. The name of my compagnie it's Multi-Spheres Informatique could you answer as fast is possible.



--------------------------------------------------------------------------------






trying the evaluation version of C5Grid I hit several walls:

1. In a dialog defined from resourses I can not set the focus to the tgrid control. Tab-key doesn`t work and adding oGrid:Setfocus() has no effect.

2. I don`t what the menu which appears when I click on the grid control with the right mouse button. How can I avoid it?

3. I use Comix and when C5Grid has to show a filtered database the first raws are frozen.

C5Grid seems to be a great tools, or has anybody bad experiences?


what I did:

kDlg:bStart = { || kurzList:SetFocus() }

kDlg:bGotFocus = { || kurzList:SetFocus() }

> 2. I don`t what the menu which appears when I click on the grid control with

> the right mouse button. How can I avoid it?

take the source-code, change whatever you want and compile and link yourself

> 3. I use Comix and when C5Grid has to show a filtered database the first

> raws are frozen.

//not only for ntx!!

FUNCTION ntxpos()

RETURN ordkeyno()

many thanks for your answer. Everything works except the Comix filter. I use

FUNCTION NtxPos()

RETURN cmxkeyno()

but the grid only works proper with SET ORDER TO 0



--------------------------------------------------------------------------------






I have noticed that all CanalFive controls except CanalGrid ( because involves database functions ) are ready to be ported to FWH compatible ( 32 Bit ) ! Rene ?


Sure !, in fact, since all the source code is included (in the most of the products), teorically if you are using Fivewin++ with Xbase++ you just have to recompile the sources for 32 bits and you are done. Same happends with C code (there only a couple of functions written in C), CanalFive provides you with the C sources in Borland C++ 5.0 the only thing you have to do is recompile it to be 32 bits compatible..



--------------------------------------------------------------------------------


Atached to this post is a file that solves the problems with Canalfive Calendar, Canalfive Meter and CanalFive folders working with Fw2.2 and Fw2.3. After the changes with the Bitmap class, all CanalFive controls weren't working properly when displaying bitmaps. You have to link this obj prior the libraries and C5 Calendar, C5 Meter and C5 Folder will work with the mentioned versions of Fivewin.
Regards, José Luis Sánchez C5BMP.OBJ





--------------------------------------------------------------------------------
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

SCREEN CAPTURE and ClipBoard

Postby Antonio Linares » Wed Aug 27, 2008 7:39 am

SCREEN CAPTURE and ClipBoard


--------------------------------------------------------------------------------


Is it possible to do a screen capture in Fivewin 2.2c and then print thecapture ???

You may use <oWnd>:HardCopy( <nZoomFactor> ), where oWnd it may be a window, a dialog, or a control.
or save the image to disk:
DibWrite( "screen.bmp", DibFromBitmap( WndBitmap( <oWnd>:hWnd ) ) )

I often do a SHIFT-PRINT SCREEN or a ALT-PRINT SCREEN.
This is standard Windows stuff. Then the actual screen is in the clipboard.
You can use Word and add some comments to the screen.


Good! I didn't know that. It saves the active window to the clipboard while PRINT SCREEN alone saves the whole screen, right?





--------------------------------------------------------------------------------


Has anyone taken clipboard bitmap data, and saved that to a file? Also, how do you know if the clipboard has a bitmap on it?


Use this example :
#DEFINE CF_BITMAP 2
oClipBoard := TClipBoard():New( CF_BITMAP )
oClipBoard:Open()
hBmp := oClipBoard:GetData()
oClipBoard:Close()
hDib := DibFromBitmap( hBmp )
If Empty( hDib )
MsgInfo("I can't create Bitmap","I'm Sorry")
RETURN
EndIf
DibWrite( cBmpFile, hDib )
GlobalFree( hDib )
DeleteObject( hBmp )
Clipper 5.3b , Blinker 5.1 and FW23






--------------------------------------------------------------------------------
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

CD ROM with FiveWin

Postby Antonio Linares » Wed Aug 27, 2008 7:42 am

CD ROM with FiveWin


--------------------------------------------------------------------------------


Anybody got any routines that can open and then write to a CDR. Would be much appreciated.

This is an old story.....

a) Use easy cd creator with direct-cd tool .... direct cd is a tool who recognize the cd-rw (not cd-r) as simple drive/hard disk and can read/write/delete data from the cd...

b) Use a cd-r program with script support. From your fivewin you can create the script with data (Files/Directory etc..) and then run the application trought winexec() function to start the session... hope this info to help you..



--------------------------------------------------------------------------------


Download Zip Backup to CD by clicking here. http://www.dh.dk/zipbackup/download.htm





--------------------------------------------------------------------------------
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Chart FX

Postby Antonio Linares » Wed Aug 27, 2008 7:42 am

Chart FX


--------------------------------------------------------------------------------


Dear friends, I'm trying to use CHART2FX.VBX but I don't know how to set data. This is the code I tried:

oVbx:OpenData( COD_VALUES, 1, 12 )

oVbx:ThisSerie( 1 )

FOR i = 1 TO 12

oVbx:Value( i, i * 10 )

NEXT

oVbx:CloseData( COD_VALUES )

Any suggestions?


Try this, works for me ! :

// 1 serie, 12 values, values must be supplied as long

oVbx:OpenData[ 2 ] := nMakeLong( 1, 12 )

// Series are zero-based, so the first is 0, second is 1, // etc.

oVbx:ThisSerie := 0

FOR i = 1 TO 12

// values must be double, that's why we use nDbl2Flt()

oVbx:Value[i] := nDbl2Flt( i * 10 )

NEXT

oVbx:CloseData[2] := 0

Methods and instance variables are pretty well documented in ChartFx manual.





--------------------------------------------------------------------------------



I tried to compile and link Chart2fx on the sample but it need this one: rcpp Where can I obtain it? Thanks for the info. P.S. I want to include a simple graph for my application.

If I'm not wrong, it's part of the Microsoft Resource Compiler distributed with Win16 SDK.


I found these files in my \clip5\bin-directory.



--------------------------------------------------------------------------------
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Check Boxes

Postby Antonio Linares » Wed Aug 27, 2008 7:43 am

Check Boxes


--------------------------------------------------------------------------------


I'm use resource define CheckBox, But, I can't change CheckBox caption!! Please, How to change?

First you do :

DEFINE CHECKBOX oChkBox VAR lVariable ID 101 OF oDlg

Later:

oChkBox:SetText("New caption")



Thank you, already solution!! But, have other question, Hide CheckBox!! I try use oChk:Hide(), but, this method is not use!! How to Hide CheckBox??



If you want oChk:Hide() when first activate time Use with ON INIT oChk:Hide()



oChk:Hide() works perfectly for me. Where did you put the call?


I have been put this code to ON INIT oChk:Hide(), but....fail!! or, put to:

DEFINE DIALOG....

:

DEFINE CHECKBOX ......

oChk:Hide()

ACTIVATE DIALOG .....

and fail too!! CHECKBOX alway "SHOW"!! Why?? I will crazy....

try

odlg:bstart := {||ochk:hide()}



--------------------------------------------------------------------------------






Somebody in the group are using 3 state checkboxes ? (defined in BWS) The ´checked´ state goes to .F. or .T. depending how many times the checkbox is ´clicked´

This is the technique I used:

LOCAL oDlg

LOCAL oChk

LOCAL lVar := .F.

LOCAL nVar := 2

REDEFINE CHECKBOX oChk VAR lVar;

ID xxx OF oDlg;

ON CLICK nVar := oChk:SendMsg( BM_GETCHECK )

...

ACTIVATE DIALOG oDlg;

ON INIT oChk:SendMsg( BM_SETCHECK, 2 ) CENTER

The value of nVar will be 0 - for not checked, 1 - for checked and 2 - for don't care state.



--------------------------------------------------------------------------------




How do you change the label of a Checkbox when using a resource? The following doesn't seem to work?

REDEFINE CHECKBOX oChk VAR lMyVar ID 101 OF aDlg

oChk:cCaption := "This is new text"

oChk:Refresh()

ACTIVATE DIALOG aDLG


Redefine CheckBox oChk1 .... blah blah blah

Activate oDlg On Init oChk1:SetText( "Who's your daddy")

Actualy you should use oChk:SetText( "whatever" ) but for some reason (I don't know if it's a WinAPI or FW bug) it doesn't work either. You would need to tweak TCheckbox class.



--------------------------------------------------------------------------------





I want to create a listbox of checkboxs. I know it's possible (the windows has it, when we install the thing that come with windows). Is to possible in Fivewin ? If yes how ?

Just use two bitmaps--one checked and one unchecked, then do an ON CLICK. See \samples ownerdra.prg for some examples of using bitmaps in listboxes.



--------------------------------------------------------------------------------


Anyone has some prg with an example of using CHECKBOX? I am making a procedure to control all accesses in my system, but I didn't get any success with using this. Please, it's URGENT to me. I need to finish this system today.


There are 32 sample files using checkbox in the fw\samples\ directory. What exactly is the problem you are having?


I'm concluding a system and I have a procedure to manage all users and passwords. So, I need to put checkboxes in order to give to user the
possibility to choose which menu items will be available (using checkbox) and write them into a dbf. My doubts are about how to create all the fields in the dbf, if they have to be logical or character or just number. Second, how to control this in the clause ON CHANGE in the checkbox command. I am using Resource Workshop to create the dialog. The dialog is below. If you can help me, please...


I do like this. I have 48 list of checkbox and break down into 3 part on a single field on my dbf using char as type. Each char evaluate and save as '1' or '0'. if '1' means .t., otherwise .f.
So everytime I change something on the checkbox, I evaluate the codeblock to transform the locigal arrays (checkboxes - arr[1]-[48]) into '1' and '0' and save it on a single variable. Works fine with me.


You have a very nice button... Are you using TSButton of Manuel Mercado??
To Manuel Mercado, sorry if I haven't send my contribution yet. I found that my
card could not be use on International transaction like on the internet :-( . I
already upgraded it and waiting for the approval of the bank. I will send it as
soon as I received it. Western MT, here charges 35% of the amount being
transfered to Mexico.


The buttons were made here in my office by a Web Designer. I'm intending to put all these buttons on a class like TSButton.


How can you put a self made button into the application ? (I also use Workshop ?)


First you have to design two buttons. Example:
You want to define the button NEW. So, you have to create the button in normal state and the second button as pressed (BMP files). After this, you must use Resource Workshop, in the option File, Add to Project and choose BMP files and choose each bitmap file. At this time you rename the button in the normal state as 1100, for example, and the other one, 3100. When you create the dialog, you can use Borland Button Style and in the ID you must put 100 and that's it! Any other questions, I'll be here.


The checkbox is a logical field. You can translate this to whatever youwish, but why bother?
I would use one record per user and one field per item.
I'm not sure what you wish to control using the ON CHANGE command?
If you are referring to controlling access to menus, etc. I would create a user class. Then you could use the database to create a user object which you can store as a static var in a function. Then you can do something like this:
menuItem prompt "Edit" action ::edit() when user():lEdit
This syntax may not be clear. The function user() returns an oUser object and one of the variables of that object is lEdit. Thus user():lEdit is the
same as oUser:lEdit. The reason for storing the oUser object in a function is that you don't have to pass it around or declare it as a public.


That's exactly what I need. I solved the problem of my checkbox, and I'll put the idea to control all menus using your suggestion. I'll tell you
soon.


What I need to know now is how to enable/disable a menuitem at realtime. Something like this:
MENUITEM "&Edit" ENABLE | DISABLE
This is the command. I'd like to know how to put a logical variable that sees the user privilegges and enable/disable the menuitem according to the privilegge. Thanks again,


Use oMenuItem:Enable() or oMenuItem:Disable(). MenuItem objects can be retrieved using oMenu:aItems instance variable.


That is what this is (I did leave off something in my previous message):
menuItem prompt "Edit" action ::edit() when user():lEdit==.t.
When user():lEdit returns .t. the menu is enabled, otherwise it is disabled.


That's what I want. I have already done now, but I didn't tried to use TSButton. I have downloaded this and I'll try.


Would you like to tell me how to put this browse using Resource Workshop?





--------------------------------------------------------------------------------


Dear friends, do you know how to make checkboxes and radio buttons transparent?


You must go to th eSpanish forum and see all the messages of VAgner


Sorry, I can't read Spanish... :-(


Hi Enrico. There are the latest ;) files made by Vagner. TRCHKBOX.ZIP


Many thanks, Toninho!





--------------------------------------------------------------------------------


How to redefine the caption from an checkbox defined on an resource


In the ON INIT Clause of the dialog:
REDEFINE CHECKBOX oBox VAR ...
ACTIVATE DIALOG oDlg ON INIT oBox:SetText("my text")


Many Thanks.
Btw, I think that this weekend I have the first Beta of Hbmake for windows





--------------------------------------------------------------------------------


How to disable an checkbox already checked
Ie: is I have FWH checkbox checked and i click on Minigui Checkbox to enable. FWH needs to be unchecked
My code is
REDEFINE CHECKBOX och var oMake:lFwh ID IDC_FWH of oDlg when (nOp=1 .and.
nOp2<=2) valid Setfwh(@oMake,och) UPDATE
REDEFINE CHECKBOX och1 var oMake:lCw ID IDC_C4W of oDlg when (nop=1 .and.
nOp2<=2) valid Setcw(@oMake,och1) UPDATE
REDEFINE CHECKBOX och3 var oMake:lmini ID IDC_MINIGUI of oDlg when nop==1
valid Setmini(@oMake,och3) UPDATE


oMake:lFWH:=.f.
och:Refresh()


oCh3:bChange := {|| If( oMake:lMini .AND. oMake:lFwH, oCh:Click(), ) }


Does this line must be valid clause


The codeblock "bChange" is the same than the event ON CHANGE. You have two ways to do this :
The first one :
...
REDEFINE CHECKBOX oCh3 ...
oCh3:bChange := {|| If( oMake:lMini .AND. oMake:lFwH, oCh:Click(), ) }
...
The second one :
...
REDEFINE CHECKBOX oCh3 ... ON CHANGE If( oMake:lMini .AND. oMake:lFwH, oCh:Click(), )
...



I am not sure if I understood you well, but I use the approach something like this:
...
REDEFINE CHECKBOX oChk1 VAR lChk1 ON CHANGE Set_Others(1)
REDEFINE CHECKBOX oChk2 VAR lChk2 ON CHANGE Set_Others(2)
REDEFINE CHECKBOX oChk3 VAR lChk3 ON CHANGE Set_Others(3)
REDEFINE CHECKBOX oChk4 VAR lChk4 ON CHANGE Set_Others(4)
REDEFINE CHECKBOX oChk5 VAR lChk5 ON CHANGE Set_Others(5)
...
FUNCTION Set_Others(n)
*---------------------------
MEMVAR oChk1, oChk2, oChk3, oChk4, oChk5
MEMVAR lChk1, lChk2, lChk3, lChk4, lChk5
lChk1 := .F. ; oChk1:Refresh()
lChk2 := .F. ; oChk2:Refresh()
lChk3 := .F. ; oChk3:Refresh()
lChk4 := .F. ; oChk4:Refresh()
lChk5 := .F. ; oChk5:Refresh()
DO CASE
CASE n == 1
lChk1 := .T.
oChk1:Refresh()
CASE n == 2
lChk2 := .T.
oChk2:Refresh()
CASE n == 3
lChk3 := .T.
oChk3:Refresh()
CASE n == 4
lChk4 := .T.
oChk4:Refresh()
CASE n == 5
lChk5 := .T.
oChk5:Refresh()
ENDCASE
RETURN NIL
Hope I understood you weel and this might helps





--------------------------------------------------------------------------------


It seems that checkbox have no readonly possibilities.


They do in a sense. When disabled (either by oCheckbox:Disable() or "when .F.") they can't be changed, but they do turn gray.


What you might have to do (not tested) is to modify the new method to take nstyle as parameter, and exclude BS_AUTOCHECKBOX from it.


Thanks Alex, i found a workaround using the WHEN clause.




--------------------------------------------------------------------------------
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Fivewin Classes

Postby Antonio Linares » Wed Aug 27, 2008 7:44 am

Fivewin Classes


--------------------------------------------------------------------------------


I first use CLASS code writing my source code.When I write about Button CLASS appear Error Info below:

Method ReButton()

Redefine Button ::oMainBut[1] ID 600 of ::oDlg ....

Redefine Button ::oMainBut[2] ID 601 of ::oDlg ....

......

RETURN nil

If it will add in my source code, it will appear Error Info below:

Error Objects/6 No Exp Method TBUTTON:DEFCONTROL

If it will not add in my source code,it will run,but not use Button option function. Do someone have any idea or suggestion for me?

You have to define u method in this way

Class myclass

Method myMethod()

....

Endclass

Method myMethod Class myClass

.....

RETURN



--------------------------------------------------------------------------------






I have implement new internet function to Wininet.prg those function are: ( SYLNET.ZIP )

InternetGetConnectedState

InternetAutodial

InternetDial

InternetHangUp

InternetAttempConnect

In the zip file you have Wininet.prg, Wininet.H (all predefined value for flag), Sylint.prg the samples who test all function. I comment as most as possible each new function in the Wininet.prg, please be aware that some function need specific version of explorer and are also ocumented.

The next step will be the implementation of secure FTP HTTP connection VIA InternetExplore OLE OBJECt ! Have fun !



--------------------------------------------------------------------------------




When I test samples\TestOut.prg and close this file,it will appear error message.This error message already appear from FW195sp5.But FW2.0a not fix it.Do someone else offers or suggestion it?Help

Change hBmpPal with hBitmap in method destroy()



--------------------------------------------------------------------------------




I have having a strange problem with the TFTP class that is based on WinINet.DLL. I am doing something like this

Function Getfiles()

oInternet := TInternet():New()

oFTP := TFTP():New( cFTPIP, oInternet ,cUser, cPassword)

aFiles = oFTP:Directory( "out/*.out" )

SysRefresh()

nFiles := 0

for n = 1 to Len( aFiles )

SysRefresh()

if aFiles[n,2] > 0

aFiles[n,1] := left(aFiles[n,1],at(chr(0),aFiles[n,1])-1)

hTarget := FCreate( aFiles[ n,1 ] )

oFile = TFtpFile():New( "out/"+aFiles[ n, 1 ], oFTP )

oFile:OpenRead()

SysRefresh()

while ( nBytes := Len( cBuffer := oFile:Read( nBufSize ) ) ) > 0

FWrite( hTarget, cBuffer, nBytes )

SysRefresh()

end

FClose( hTarget )

oFTP:DeleteFile("out/"+aFiles[ n, 1 ])

oFile:End()

nFiles++

endif

next

endif

oFTP:end()

oInternet:End()

When I run this on Win 98 if there are files it retreives them and deletes them and any more calls to the function return no files. When I run it on NT 4.0 the files multiple calls to the function keep returning the files and they are downloaded but never deleted until I exit the program and then the calls to the function show no files? It is almost like NT 4.0 buffers the session and until you exit the application does it actually update the FTP site??? Any ideas, experience or help would be greatly appreciated!

*

I posted a message last week about the TFPT class not returning the correct directory information running under NT 4.0. I have found the problem and I wanted to pass it along. In the Directory() method you need to pass a parameter to the

FtpFindFirstFile(::hFTP,cMask,@cBuffer,INTERNET_FLAG_RELOAD,0)

where the define is

#define INTERNET_FLAG_RELOAD 2147483648 // 0x800000000

What was happening is each FtpFindFirstFile() was returning the same directory from cache instead of going out the FTP server and getting the actual directory. I was doing a directory deleting the files and then logging back on an doing another directory but the directory was returning the contents from the first one even though the files were deleted. If you force it to "RELOAD" then you always get the correct information.



--------------------------------------------------------------------------------




Eu preciso executar um comando quando ocorrer um DoubleClick sobre um ítem da árvore. I need to execute a command when to occur a DoubleClick on an item of the tree.

Try this: ( NEWTREE.ZIP )


thanks for the feature ACTION(...) - thats one part I looked for. The other part is this: How would you create a treeview if you dont know the structure of the tree in advance. Think on a patient in a hospital. All the tests on him are in databases. Now you query the dbf´s an find:

Endoscopie - Gastoscopie- Dtae

Coloscopia - Date

Cardiologie - Coronarographie - Date

Echocardiographie - Date1

Echocardiographie - Date2

ECG - Date1

ECG - Date2

and so on. You put all the informations in an array and then you create the teeview. The ACTION or ON CHANGE method has to show in a second window the result of the test. Has anyone done this? I dont like to invent the wheele....



--------------------------------------------------------------------------------




New version of TTXTEDIT CLASS with REDEFINE for DIALOG usage and enhanced

function ::Save, ::Load and ::Paint

you can download it from www.htcsoft.freeservers.com



--------------------------------------------------------------------------------





Does anyone know of any RTF class for use with fivewin? All advice and comments welcome

Test attach. ( TESTRTF.ZIP )

gracias, your code works fine and is exactly what i´m looking for. Do you have also a editor-prg for formatting your plain ascii ({negritas}, &cursivas!, [subrayado].)? Under Dos i used "CLTEXT.LIB" as a Editor for my memofields. The formating is done by char(0)-char(32). Now i´am looking for a similar solution under fivewin.


Here is what I found in former news: ( CLRTF.PRG ), ( RCHTXT10.ZIP )



--------------------------------------------------------------------------------




I'am new to use the database object. For display of a 12 month o a year, I use a FOR-NEXT loop but how to do it with Objects

Dbf : omzet1, omzet2, omzet3 ... omzet12

Odbfklant = all OK that works.

ONLY THE LOOP IS A LITTLE PROBLEM

for i = 1 to 12

jaar1 = "oDbfklant:omzet"+alltrim(str(I))

REDEFINE GET &jaar1 ID (2990+i*10) OF oDlg

next


How about make a function for your problem Now your Code

for i = 1 to 12

jaar1 = "oDbfklant:omzet"+alltrim(str(I))

REDEFINE GET &jaar1 ID (2990+i*10) OF oDlg

next

New code for you

for i = 1 to 12

ReGet ( nI, oDlg )

next

Static Function ReGet ( nIDPlus, oDlg )

Local = "oDbfklant:omzet"+alltrim(str(nIdPlus))

REDEFINE GET &jaar1 ID (2990+nIdPlus*10) OF oDlg

Return NIL



This code is not working ? Not for the nI in the loop.


Just remove the "n" from "nI", but is not enough....Do this :

for i = 1 to 12

ReGet ( i, oDlg )

next

Static Function ReGet ( nIDPlus, oDlg )

Local temp = "oDbfklant:omzet"+alltrim(str(nIdPlus))

REDEFINE GET &temp ID (2990+nIdPlus*10) OF oDlg

Return NIL



Sorry :-) Almost My code use nI when Using FOR NEXT loop Please modify nI to i



--------------------------------------------------------------------------------





Class TBitmap - Method VScroll / HScroll - Case nWParam == SB_THUMBPOSITION is not active. Can anybody help me to activate it ?

Here the tips

case nWParam == SB_THUMBPOSITION

::nX = - nLParam * (::nXExtra()+If(::oHScroll:nMax!=0,GetSysMetrics(3),0)) / ::oVScroll:nMax

::Refresh()

::oVScroll:SetPos(nLParam)




--------------------------------------------------------------------------------





Just a general question. Is anyone thinking about or perhaps want to collaborate on a FiveWin Class for XML-

1. format/write

2. read in as data

3. convert to HTML

4. display as FiveWin tree-view

5. sub-class for external sources, i.e. Excel/Oracle


Stan - great idea. Actually, I would want something that is SIMPLE - conceptually simple to create/change/maintain -> yet as powerful as xml can be. Additionally, I see it as a method for fivewin and harbour to communicate with java and other data-based systems as WELL as direct web page usage. This means that we MUST go beyond the level that, for example, the rtf class went. Finally - by helping, I'll have learned even more about xml, I'm certain. Let me know -> I'm doing things java as well as fivewin and am interested!=) -Jim


I'd be interested in making GX write out XML for reports. Count me in!



A good starting place for the 'big picture' is probably www.odi.com/excelon and I have seen several Java scripts for parsing Oracle Tables into XML. I am specifically looking at taking a given FiveWin Table (dbf, I assume) and writing a Standard DTD (Data Table Definition) to output to XML and or import from XML/ASCII. Years and years ago I worked with a guy here in Raleigh to generate CDF's Complete Definition of Fields) for Clipper and I later used it in FiveWin with something I posted called Winparse. A CDF was an ASCII file like

ID |C| |10| |0| substr(cRec,27,10)

where ID=field name followed by Field Type,Length,Decimals, and parsing 'code-block'. Not a big deal, but I think the same principle as one would need for XML. You would need to add definitions for Data, Export Translations (i.e. would date be exported as YYYYMMDD or MM/DD/YYYY, logicals as -1=True, 0=False)

I am hoping that perhaps a group of us could come up with a DTD format, then a generic 'class' to read/write and associate DTD's with tables. Then this class could be sub-classed for say Oracle (so that rather than restricting the Field Type to C,N,L,D,M you could account for Blob or TimeStamp). Right now, just an exciting prospect, so excuse my babbling. I will be seriously working on this by mid-December, as our Company may need to provide select 'call detail' (grouped information on how calls terminate) to major carriers. We have already received requests for Excel.Access,ASCII, EMI,and even XML. Thanks for your interest - more to come



--------------------------------------------------------------------------------





I am having a strange problem when using the TPages class. Right after I have saved my resources (.DLL file), and recompiled the application, the dialog using the tpage control loads correctly. However, If I reboot the computer, and try to load the same dialog again, the application goes into an error, with thefollowing error message:

Application

Path and name: C:\PCWIN\PC.EXE

Size: 1,833,600 bytes

Max files handles permited: ( SetHandleCount() ) 150

Error ocurred at: 03/12/1999, 15:36:25

Error description: Error FiveWin/3 Cannot create Dialog Box:

Resource: Cliente

Stack Calls

===========

Called from LOCKERRHAN(0)

Called from (b)INITHANDL$(0)

Called from CREATEDLGE(0)

Called from TDIALOG:ACTIVATE(0)

Called from CAD_CLI(485)

Called from (b)LISTCLI(34)

Called from TWBROWSE:LDBLCLICK(0)

Called from TWBROWSE:LDBLCLICK(0)

Called from TWBROWSE:HANDLEEVEN(0)

Called from WINRUN(0)

Called from TMDIFRAME:ACTIVATE(0)

Called from MAIN(1138)

System

======

CPU type: 486

Hardware memory: 30464 (29 megas)

Free System resources: % 92

GDI resources: % 93

User resources: % 92

The same occurs when I try to load the program thought the network. What can be wrong?


Try adding the following to your startup code:

hBorland := LoadLibrary( "BWCC.DLL" )

and then:

FreeLibrary( hBorland ) in your exit code.

Someone in this NG has figured out how to run controls from resources without requiring BWCC.DLL, maybe they can chime in here and explain how it is done. I am not using Borland custom controls, yet for some reason, my programs won't run without loading the DLL.


I have included the suggestion, and now everything works fine. Thank you very much! In the meantime, I discovered another anomaly, which occurs if you do not load the librady BWCC.DLL: The dialogs using the TPages code only runs if you load Borland Resource Workshop, what, perhaps, loads anything into memory that allows the program to "find" something. Perhaps the use of the BWCC.DLL library should be better explained in the help files, the samples, and in the Fivewin manual. I believe that many people are having the same problems that I did.


>The dialogs using the TPages code only runs if you load Borland Resource

>Workshop, what, perhaps, loads anything into memory that allows the program

>to "find" something.

This is because Workshop loads BWCC.DLL into memory. Only one copy of a DLL is loaded into memory at a time. If a program requests a DLL that is not already loaded, then it is loaded and the counter for that DLL is set to 1. If the DLL is requested again by another program then the counter for that DLL is incremented by 1. When the first program that quits and requests that the DLL be unloaded, the counter is checked. If it is greater than 1, then the counter is merely decremented by 1. If the counter is 1, then the DLL is unloaded.

>Perhaps the use of the BWCC.DLL library should be better explained in the

>help files, the samples, and in the Fivewin manual. I believe that many

>people are having the same problems that I did.

Granted it should be. You might find some useful information in my "Introduction to FiveWin" article available on the FiveWin pages of my web site at http://ourworld.compuserve.com/homepages/jbott It has some information about BWCC.DLL.


I quit using bwcc.dll some time ago because it caused me too many problems. A lot of weird problems went away when I quit using it. I just don't use any borland controls. If you have one borland control in your .dll then you need bwcc. I don't recall if it something in the STYLE line or what but you can probably edit your .rc file in an editor and do a search for Bor or BS_ in the style. None of the standard controls are borland, only the custom ones I believe.



--------------------------------------------------------------------------------





More than once i read in this NG about changing the CLASSES ? What should be done with a changed class, and how ? Is it something like changing a function in clipper.lib ?


Marc, I think the ng means change the FiveWin classes. As you probably know, FiveWin is heavily based in Objects, the object engine of FiveTech. A class is the base of Object oriented programming. A class is a template where you derivate or create objects. Usually you never touch the code in a class, you derivate a new class from a existing one, a process called inheritance and then add the new features to the new class This process have nothing to deal with the Clipper.lib.


There is an introduction to FW OOP article on my website (see below).James Bott http://ourworld.compuserve.com/homepages/jbott


here is part II of the introduction located ??


Sorry, I haven't written it yet. There didn't seem to be enough interest to warrent it.



--------------------------------------------------------------------------------





I have created a class as of the class TBUTTON called TBDESP I have preceded 8 parameters before of the nId

METHOD

ReDefine(nTipo,cCampo,cExquie,cRutina,cRutf4,cExaminar,cCacebera,cCaja,nId, bAction, oWnd, nHelpId, cMsg,;

lUpdate, bWhen, bValid, cPrompt, lCancel ) CONSTRUCTOR

Then within method transfer 8 parameters to variable of instance as makes it the class original TButton

METHOD

ReDefine(nTipo,cCampo,cExquie,cRutina,cRutf4,cExaminar,cCacebera,cCaja,nId, bAction, oWnd, nHelpId, cMsg,;

lUpdate, bWhen, bValid, cPrompt, lCancel ) CLASS TButton

DEFAULT oWnd := GetWndDefault(), lCancel := .f.

::minTipo = nTipo // Tipo de desplaz

But upon executing leaves this Error .

Error description :Error Objects/6 No Exp. Method: TBDESP:_MINTIPO

Now if variable use static to the beginning of the program and I collect the value when there is 2 bellboy of this type both have the same values. Which is the solution


Have you defined

DATA minTipo

for your new class?



If you haven't already read it, I might suggest that you read my article "Introduction to OOP using FiveWin" on my website (see below). I'm not exactly sure what you trying to do. To create a subclass you need to do it this way:

create class TBDESP from TBUTTON

var minTipo // any new ivars must be defined here

method redefine constructor

endclass

// Initialize any new vars here, then call the parent method (super)

method ReDefine(nTipo,cCampo,cExquie,cRutina,cRutf4,cExaminar,;

cCacebera,cCaja,;

nId, bAction, oWnd, nHelpId, cMsg,;

lUpdate, bWhen, bValid, cPrompt, lCancel )

::minTipo := nTipo

return super:redefine(nId, bAction, oWnd, nHelpId, cMsg,;

lUpdate, bWhen, bValid, cPrompt, lCancel ) // call parent

>Error description :Error Objects/6 No Exp. Method:

> TBDESP:_MINTIPO

You get this error because you didn't define mintipo as a new instance variable. You must define any new instance vars in the class definition. Also, you cannot pass these new vars to the parent class because it doesn't know them. Note also that you cannot use the command syntax anymore, you will have to use OOP syntax:

oBtn:= TBDESP():new(...)



--------------------------------------------------------------------------------




I am trying to compile and run the "TSmtp with socket RASDial" sample I download from this news group. But, I need TReg32 to do this. There is no authors name in these files so I don't know who wrote it. If anyone could help I would appreciate it.

This class comes with fw 1.95 and only works with this version or newer.



--------------------------------------------------------------------------------






I've created a class that contains a Database-browser in a Window. It opens a database-object, a standard buttonbar, some messagebar-stuff, and a standard popup-menu. All I have to do is to call the function with the name of a dbf-file, and the standard behaviour like navigation, switching indexes, seeking, filtering,... goes quite well.

I've included the possibility to modify the standard behaviour, like fonts, columns ( width, freeze, bitmaps,... ), header, footer, ... via items in an associated ini-file. So far so good.

I thought to alter via the same way the behaviour of a button in the buttonbar by naming a function, that is outside the class-object itself, in the ini-file. This function should be compiled at runtime, instead of the build-in standard behaviour, but the only thing that's wrong is that I don't know how to give a reference to the window-object itself in that function. I need this reference since all the data of the dbf are contained into the class-object itself ( I need the so-called "Self" ). Can anyone help me ???

Suppose your app have "test.ini", your class reference is ob, and prototipe of the function SomeFunc(ob)

[some]

show = SomeFunc

Then you call from the button ACTION DoThis(ob)

Procedure SomeFunc(ob)

ob:ShowMessage("tralala")

return


You may be interested in my "Introduction to OOP using Fivewin" article available on my web site. James Bott http://ourworld.compuserve.com/homepages/jbott



--------------------------------------------------------------------------------





We have discovered something about Fivewin Objects that we didn't know.

oBj := MyObject():New()

for i=1 to len(oBj)

Msginfo(oBj[i]) // display all properties including inheritance

next

oBJ[5] := "test" // assign 5th property

Aeval(oBj,{|aval,x| oBj[x] := NIL }) // NIL out entire Object

An object can be treated like an array. Properties can be set and viewed by their index order? Does must mean that no Object can have more than 4096 properties? Knowing this we can scan the object looking for a certain property without knowing the name of it? There are probably other possibilities as well. Has anyone taken advantage of this feature?


There is also function, getDatas( oObj ) that returns an array containing all the objects properties.

>Does must mean that no Object can have more than 4096 properties?

I would offer, that an object that complex probably needs to be redesigned perhaps breaking it down into several smaller objects.

>Knowing this we can scan the object looking for a certain property without

>knowing the name of it? There are probably other possibilities as well.

>Has anyone taken advantage of this feature?

I haven't thought of a good use for it yet--other than object inspection for debugging. There is an object inspector somewhere in the sample code that you can link into your application for debugging work. I have done that before.



Yes, this is very useful if you do not know the properties (methods and data vars.) But if know the physical names you can call the properties by the names.



--------------------------------------------------------------------------------




Error in TPrinter Class?

I use a sentence like this one :

oPrn:CmSay( 1.0 , 1.0 , cName ,oFont , 20)

(syntax : <oPrn>:CmSay( <nRow>, <nCol>, <cText>, <oFont>, <nWidth>, <nClrText>, <nBkMode>, <nPad> ) )

If I understand well, this should result in printing cName with a maximum length of 20 cm. But if the cName is printed with its full length, even if it is longer than 20 cm. What can I do to just print the first 20 cm of cName ? Thank you very much in advance.


The cmSay() method in turn calls Say() method. But if you look at the code, nWidth is not ever used, so it won't work anyway. Maybe we need to check the TextOut() funcion there to see if it accepts a nWidth param.


I made the following changes to my 1.9.1 version of TPrinter:Say() method:

METHOD Say( nRow, nCol, cText, oFont, nWidth, nClrText ) CLASS TPrinter

local aRect

if oFont != nil

oFont:Activate( ::hDCOut )

endif

SetbkMode( ::hDCOut, 1 ) // transparent

if nClrText != NIL

SetTextColor( ::hDCOut, nClrText )

endif

if nWidth == nil

TextOut( ::hDCOut, nRow, nCol, cText )

else

aRect = { nRow, nCol, nRow + oFont:nHeight + 10, nCol + nWidth }

ExtTextOut( ::hDCOut, nRow, nCol, aRect, cText )

endif

if oFont != nil

oFont:DeActivate( ::hDCOut )

endif

return nil

The API ExtTextOut() cut the printing outside the given aRect.



We decided not to use ExtTextOut because it slowed the report considerably, BTW Enrico's way maybe the right solution. Please try to use Enrico's code and I will highly appreciate your feedback in case we can include it on Fivewin next release.



--------------------------------------------------------------------------------





find attached a ZIP with a new class to make rounded TGroup groups. You can set what controls you want to see "transparent" inside the box and which not. See the images. ( RGROUP.ZIP )




--------------------------------------------------------------------------------




Just to save you Time ! Be aware that if the Socket is in WSAEWOULDBLOCK state and you call the METHOD END() .or. CLOSE() of the class Tsocket you will go in an infinite loop in the Method End() or Close(). And the Closesocket will Never occured nor the Wsacleanup and probably the Application will Crash !

There is 2 workaround:

1- Always check Osocket:lsending before calling those method

2- Remove the While ::lsending from those method



--------------------------------------------------------------------------------


When i observe my EXE, i found there is a string TFOLDER, TPRINT, etc, but I am definitely sure that I did't use any of that classes. Is it
only a string or the class it self? If yes, why these classes linked-in even though I didnt' use it? How to avoid this?



All the classes and functions are contained in the Fivewin Libs. Maybe you dont use them, but they are inside those libs.
They dont produce any harm, but increase the space of your EXE. Maybe you can try to extract those modules with Librarian
Utilities from Borland, like Tlib and others.





--------------------------------------------------------------------------------



Can someone tell me what the INLINE function stated in a class realy does ? and how it works ?


INLINE just lets you create a method in the same line as you define it:
class TCustomer
method boo inline msgInfo("Boo")
endclass

This above is the same as:

class TCustomer
method boo
endclass
method boo
msgInfo("Boo")
return nil



Thnx James for the explanation !
but what if i make a class with the new as constructor but i want to activate it at a sertan point with letst say doit in my experience in the execution of doit() i cant retrieve the data like
DATA 1
.........
DATA 5
METHOD New( 1,2,3,4,5 ) Constructor
METHOD DoIt()
nTemp := ::1 + ::2 / ::5
cTemp := ::3 + ::4
It gives me an object message error
so to activate it an retrieving this parameter i have to pass the object
made with new eg oTest := Ttest():New( 1,2,3,4,5 )
DoIt( oTest )
Method DoIt( o )
Then i can retrieve o:1 etc.
there must be another way couse now i have to work with inline to pass some known data
hope this make some sence


I'm sorry, I don't understand what you are trying to do. Can you put together a small sample program that shows the problem?




--------------------------------------------------------------------------------


oMemo:

There is a method On Change that is evaluated every time there is a changein a memo. Is there also a possibillity to detect a movement of the cursor.


Have you tried with bKeyDown or bKeyChar code-blocks? Eventually you can trap cursor movement inside HandleEvent() method, I think.


I have tried the bKeyDown mehod and it works. I can execute a function on arrow down left and so on. But what I want is that de cursor also goes down or up,left and so on.
Now the function is called but the cursor stays on the same place.
I think I will have to learn to work with handleEvent(). I hope the sample dir contains enough examples.


Try sending a WM_KEYDOWN message with the appropriate VK_* as second parameter inside your bKeyDown code-block or using SetPos() method to move the cursor position. Or it could be enough returning NIL (not zero)
from bKeyDown.


Yes this works fine.


Pheraps after you call yourfunction() you return 0 (zero) from KeyDown(). To continue Fivewin perform standard behavior (moving cursor) after that you should return (nil)



--------------------------------------------------------------------------------


It looks like nobody other has troubles with the DbCombo class.
Perhaps anyone could tell me how to interpret the following lines from myerror.log
Error description: Error BASE/1070 wrong argument: ==
Args:
[ 1] = U
[ 2] = N
Stack Calls
===========
Called from TGET:DESTROY(0)
Called from TGET:DESTROY(0)
Called from TDBCOMBO:DESTROY(0)
Called from TDBCOMBO:HANDLEEVEN(0)
Called from DIALOGBOX(0)
Does this mean that my app crashes when trying to destroy a second get-object?
I don't know where to search this second get.


I don't have FW 2.2c and don't use dbCombo, but try to get a look at TGet:destroy() (in tget.prg) and see what this method is trying to compare since the expression on the left is nil. Then try to trace that value down the call stack.


thanks a lot for jumping in. Unfortunately the method TGet:Destroy() doesn't take any parameters
I think the cause of my crash is that the destroy method is called two times. ( i don't know why 2 times ? ).
The second call of course then gets an undefined value :-(
You said that you don't use TDbCombo. Could you tell me what you use instead?


I use a lookup table system I designed a long time ago with a friend. I assign a bitmap inside the get that in turns launches a dialog with a browse of the dbf, allowing the user to choose the code, as well as search and add/edit the table.


I attach with this message the corrected file to use.
Sorry for any inconvenience. (Ignazio Ortiz) window.ZIP



many thanks for your quick reaction. Now the dbCombo is destroyed without crash.





--------------------------------------------------------------------------------


Can anyone tell me how to use the getminmax method to control sizes of some dialogs.


I believe it only works on Windows, not Dialogs, but of course I could be mistaken.
I've only used GetMinMaxInfo on Windows and it works pretty neat.



--------------------------------------------------------------------------------


I need made my personal ::Paint() Method for TGet, but when I declare it, none appear in my gets. I need help, please. This is only a test, but don't work. Why ?
METHOD Paint() INLINE Super:Paint()
METHOD Display() INLINE ::BeginPaint(), ::Paint(), ::EndPaint(), 0


One simple solution could be to add something like this in the Paint() method of TWindow class:
if ::aControls != nil
AEval( ::aControls, { | oCtl | If( Upper( oCtl:ClassName() ) == "TCOMBOBOX", oCtl:Display(), ) } )
endif


Great Enrico, but no work like I need:
I need draw an box inside each get of an dialog. If I use:
METHOD Paint() INLINE ::Box( x, y, x1, y1 )
METHOD Display() INLINE ::BeginPaint(), ::Paint(), ::EndPaint(), 0
The box is displayed, but the get don't display his buffer...
If I use your hint, the box is displayed, but, if I open other small dialog inside first dialog, when I close the second dialog, the boxes in this region are cleared.
I don't understand why I can't use Display(), Paint() methods, like a lot of classes use ( ex: splitter class )...


Uhm... I think you can't draw a box *inside* the client area of a GET. You have to create a non-client area.
> I don't understand why I can't use Display(), Paint() methods, like a
> lot of classes use ( ex: splitter class )...
Sorry, I don't know exactly why... :-(


Ok. I think that I need make my personal TGet class. My intention is make skins for fivewin, I have implement skins in buttons and combobox, like windows XP style, but I need implement in TGet, radio and checkbox. Please, see attached picture. I was looking in the FGet class and have some ideas...





Hey, that looks GREAT!! Is this a FiveWin app?


Yes it is and is running in a windows me :) I'm try to make skins with five. There are a har job, but I have some
controls, like buttons, working fine. The problem is with TGet that don't use ::Display() and ::Paint() Methods...
Lets go to work! :)


If you are trying to create down arrow buttons within the GET then you need Ricardo Ramirez's (rramirez@landatech.com) TBtnGet. His website is:
http://www.landatech.com
You may find a copy on his website (I can't tell because it seems to be down right now). Ricardo is travelling right now, so it may be a couple of days before you hear back from him if you email him.


No. I don't need TBtnGet. I need draw a box inside client area of my gets, but the box is don't displayed...
The problem is that TGet or TBtnGet don't uses :display(), :paint() methods. I don't know why...


have you tried to create a box control belonging to the get? That is, ..... OF oGet


Yes its works, but my intention is redefine all style get, replacing 3D standard box of an get to my style box, to simulate the box displayed by windows XP. If you look the picture attached previous, you are see that I have success with buttos, folders and comboboxes, but the get... :(



I've never try it, but IMO you have to handle the WM_NCPAINT msg. Try to write a msg handler for TGet...
This info is from Win32s.hlp:
WM_NCPAINT
An application sends the WM_NCPAINT message to a window when its frame must be painted.
WM_NCPAINT
hrgn = (HRGN) wParam; // handle of update region
Parameters
hrgn
Value of wParam. Identifies the update region of the window. The update region is clipped to the window frame.
Return Values
An application should return zero if it processes this message.
Remarks
The DefWindowProc function paints the window frame.
An application can intercept this message and paint its own custom window frame. The clipping region for a window is
always rectangular, even if the shape of the frame is altered.
See Also
DefWindowProc, GetWindowDC, WM_PAINT


Thanks Jose, I'll try.


Try by sending the box painting on the ON PAINT clause of ACTIVATE WINDOW (or DIALOG)
ACTIVATE DIALOG oDlg ON PAINT Your_DrawBox()
Or:
odlg:bPainted := {|| Your_DrawBox() }


I think that is no a good idea because I neet the repaint automatically. Remember that my intention is made skins (see previous picture).
PS: I have a complete set of tsbrowse for harbour working, but with some problems. Do you have fwin for harbour to we finish this work ?


I am now starting my work with FWH and the main task will be to make TSBrowse Harbour compatible. Please send me what you have done, it'll be a great help.





--------------------------------------------------------------------------------


there is an error on talbum class with fivewin 2.2c Some has corrects this error :
C:\errori\album>blinker fi prueba, album, CES @\fw22\include\fivewin
__ __
(«») («») BLINKER DOS Extender and Windows Linker 5.10

___ Blink and you'll miss it !!
Copyright (c) Assembler Software Manufacturers, Inc. 1990-99
All Rights Reserved. Serial # BR-056596. Fax (804) 784-2357.
BLINKER : 1115 : ALBUM.OBJ(ALBUM) : 'PBMPHEIGHT' : unresolved external
BLINKER : 1115 : ALBUM.OBJ(ALBUM) : 'PBMPWIDTH' : unresolved external
BLINKER : 0 Warning error(s), 2 Fatal error(s)
PRUEBA.EXE (not created) (0.7 seconds)
C:\errori\album>if errorlevel 1 goto exit


This is extract from Whatsnew.txt in Fw22c:
* Important change: In order to turn FiveWin fully compatible with 32 bits architecture, we had to replace Class TBitmap's hBmpPal use with a two new DATAs hBitmap and hPalette. This should not break any of your existing code, except on those places where you may be accessing hBmpPal directly. Simply replace hBmpPal for hBitmap and it will be ok. Also notice that pBmpHeight() and pBmpWidth() no longer exist, and must replaced by nBmpHeight( hBitmap ) and
nBmpWidth( hBitmap ) calls.





--------------------------------------------------------------------------------



Everyone,
At long last I have published Part II of my "Introduction to Object-Oriented Programming Using FiveWin" article. You will find a link to it on this page:
http://ourworld.compuserve.com/homepage ... rogram.htm
Comments welcome.
James Bott


Good work! Only a note:
> According to OOP principles of information hiding, you should hide
> any data and methods that are only needed for internal use of the
> class.
Actually, OOP principles say that a class should only have hidden data. It should only offer "services" implemented as methods and never show implementation details to the client code (that is the code that uses the class).


In one line thanx for the fine contribution wich will help me ! and i'm convinced a lot of others 2.




This is what we needed


thanks a lot for your oop introduction. It reads very interesting a gave me lots of new insights to oop with FiveWin.
I got curious about your tdata class and tried the demo version. Unfortunately test05.prg does not run ( missing test.dbf ).
In test04.exe there is sopmething strange. If after double click I modify the name of a customer and say ok,
after I can't click on lines below this customer and the record remains at it's old location even if after editing it should appear as logical last one.
Perhaps I'm doing something wrong?



> I got curious about your tdata class and tried the demo version.
> Unfortunately test05.prg does not run ( missing test.dbf ).
Actually, test05.prg wasn't supposed to even be in the zip. Further, it was
test03.prg that was calling the missing test.dbf.
> In test04.exe there is sopmething strange. If after double click I modify
> the name of a customer and say ok,
> after I can't click on lines below this customer and the record remains at
> it's old location even if after editing it should appear as logical last
> one.
You spotted another problem here. I had forgotten to initalize ::lAdd to .f. so it was appending a record.
My apologies for all the problems. I have just uploaded a new version of TData.zip containing all the fixes and also the very latest version of TData itself. Hopefully everthing is working now.
Please download the new version and try the sample programs again.





--------------------------------------------------------------------------------


As I can modify the label of the TGROUP control ?
oGroup:cCaption: = " New title " or oGroup:SetText("New title") does not have effect.


You have to make sure you call ::SetText after the dialog has been activated, or nothing will happen, ie
Define Dialog oDlg ....
Redefine Group oGroup Of oDlg...
Activate Dialog oDlg On Init oGroup:SetText( "whatever" )





--------------------------------------------------------------------------------


I build testfget.prg from \fw22c\samples and when I try to execute it it freeze at startup can someone confirm that building and executing testfget on his FW2.2c version work !
If so I'll search my problem ! ;-( Fivewin 2.2c Clipper 5.3b Blinker 6.0


The problem is with the TEXT.DBF and TEXT.DBT file that came with Fivewin even the one that are in Fivewin 2.3 are corrupted !

You're right !, some kind of problem is with the packed version of FGET that comes with FiveWin.
Anyway you can download the latest version of the FGet from the "father of the baby" website Ramon Avendaño.
http://personales.mundivia.es/rar/SOBREFW.HTM
Look for the link to the FGET class and download the latest version (along with other nice controls).





--------------------------------------------------------------------------------


Has anyone a sample of the TS SyncChild Method ??? It is supposed to synchronise 2 browses.


I have not heard of anything like this.
Just use the bSkip codeblock of the parent browse to skip and redisplay the child browse.


What SyncChild() method does is to evaluate one or several code blocks (as many as "child" browses you have), every time the row changes in the main browse.
Here a little sample:
Lets suppose that you have a main browse with customers names and two "child" browses, one which shows the customer due balance and other which shows the transactional history of the refferenced customer.
Defining the browses:
REDEFINE BROWSE oMain ALIAS "Customers" OF oDlg
ADD COLUMN TO oMain TITLE "Name" DATA Customers->Name
REDEFINE BROWSE oChild1 ALIAS "CustBalances" OF oDlg
ADD COLUMN TO oChild1 TITLE "Invoice" DATA CustBalances->Invoice
ADD COLUMN TO oChild1 TITLE "Date" DATA CustBalances->Date
ADD COLUMN TO oChild1 TITLE "Balance" DATA CustBalances->Balance
REDEFINE BROWSE oChild2 ALIAS "CustHistory" OF oDlg
ADD COLUMN TO oChild1 TITLE "Transaction" DATA CustHistory->Transaction
ADD COLUMN TO oChild1 TITLE "Date" DATA CustHistory->Date
ADD COLUMN TO oChild1 TITLE "Import" DATA CustHistory->Import
bBlock := { | oChild | oChild:SetFilter( "CustCode", Customers->CustCode ), oChild:Refresh() }
oMain:SyncChild( { oChild1, oChild2 }, { bBlock, bBlock } )
And, that's all, every time the row changes in oMain, the child browses will be automatically set to show the proper data.
In this little sample I'm using ntx indexes, but you can also use cdx with scopes then, in the code block, you have to set the scopes. I hope this help you.



--------------------------------------------------------------------------------


I was just looking over my XBase++ 1.7 documentation and noticed a class called oThread. This allows you
to open an additional thread and run an app in. Is this available in Fivewin?


If you try to run an application from another application is a new thread by it self...
i guess oThread is something else...
as i can imagine ... oThread create a new session and assign a job to do ... for example to copy a file with out stop your application from running
for example in C++ i wrote a web server ... i start a new thread for every new connection, so if the remote user request something the server does not stop all other jobs ...
there is a limit on threads you can open only 2048 threads in one application but you can increase it by decrease the stack size ( default is 1M per thread ).


Not yet, but you can use a timer to do certain background processes.


How can I use threads with FW? Where can I find some examples using threads?


You can't - FW is 16bit.





--------------------------------------------------------------------------------


Toutlook Class - Is ther such a thing?


FW 2.3 has a nice TOutlook class with a lot of fancy improvements.


We are not (YET) upgrading to FW2.3 for some economic reasons. As you can see, our company sales drop to a huge percentage. If we recover, I may able to justify an upgrade.





--------------------------------------------------------------------------------


When doing:
redefine group oGRP id 800 of oDLG color "N*/W"
the color-clause will not be used. Same with a self defined group.
What can I do ?


In GROUP.PRG there's
::SetColor( nClrText, nClrPane )
::SetBrush( TBrush():New( "NULL" ) ) // Debe ser transparente [byHernan]
Remove SetBrush() call and colors will work again.





--------------------------------------------------------------------------------


Inc(), Dec()

Does anyone have an example of using these methods?


It the data type your using is either numeric or date, simply do a
oGet++
or
oGet--
To increment or decrement the value of the variable assigned to the TGet object
For example, to use the PLUS and MINUS keys to change a date
dDate := Date()
Redefine Get oGet Var dDate Picture "@D" ;
Spinner // (*) this will do the same as bKeyDown, only using a spinner
oGet:bKeyDown := {|nKey, nFlag| ; // method overloading in action:
If( nKey == VK_ADD, oGet++, ; // "+" pressed [TGet:Inc()]
If( nKey == VK_SUBTRACT, oGet--, Nil ) ) }; // "-" pressed [TGet:Dec()]
(*) Assumes you have the Vertical Scrollbar attrib check in your dll/rc


Thanks, I've tried this and it doesn't seem to work. I modified the keydown method of tget to call ::oGet:inc() and that didn't work either, no exported method.


What version of FW are you using? I have 2.1c and works just fine. This feature must have been added around FW 2.0





--------------------------------------------------------------------------------


am trying compile btnget in FW and FWH :
IN FW :
CLIPPER BTNGET\FWCAL /N/M/A/W
CLIPPER BTNGET\Btnget /N/M/A/W
CLIPPER BTNGET\Btndown /N/M/A/W
BCC -c -ml -O2 -G -B -I\wk_fw\_inc -oGetbtn.obj Btnget\getbtn.c
Tlib WLIB3_16 -+fwcal -+btnget -+getbtn
IN FWH
harbour BTNGET\Btnget.prg /n /i%Fwhdir%\include;%Hdir%\include/oBTNGET\Btnget.C
bcc32 -M -c -D__HARBOUR__ -I%Hdir%\include -oBTNGET\Btnget.OBJBTNGET\Btnget.C
harbour BTNGET\Btndown.prg /n /i%Fwhdir%\include;%Hdir%\include/oBTNGET\Btndown.C
bcc32 -M -c -D__HARBOUR__ -I%Hdir%\include -oBTNGET\Btndown.OBJ BTNGET\Btndown.C
bcc32 -M -c -D__HARBOUR__ -I%Hdir%\include;%Fwhdir%\include -oBTNGET\Getbtn.
OBJ BTNGET\Getbtn.C
tlib WLIB3_32.LIB -+btnget -+btndown -+getbtn
This is correct ???


I use the attached makefile for BCC5.5 to build TBtnGet32.lib
I hope this help MAKEFILE.DAT


Ricardo, thanks, and to fivewin 16????


Sure, here is TEST.LNK


when i compile getbtn.c i receive the error :
Error : unable to execute command 'tasm.exe'.
i am using borland c 5.2 (bcc.exe)
BCC -3 -c -ml -O2 -G -B -Tq -I\wk_fw\_inc -oGetbtn.obj Btnget\getbtn.c


Could you explain to me why each BCC modificator in your statement ?
Why -B ? (compile via assembler ?????)
Why -Tq ? (assembler option ??????)
Why -oGetBtn ? (it isn't necessary)


i am using make provide by ricardo ramirez, he´s using this modificator....


Erase the -B switch, that must work





--------------------------------------------------------------------------------


I am new to fivewin and don't konw how to subclass an existing class .
HOW TO CREATE A CLASS FROM EXISTING CLASS OR SELF CREATED CLASS ?
AND IS THERE ANY EXAMPLES ?


You can find a lot of samples on the SAMPLES directory. Keep in mind that many of the FW classes are inherited from TWindow or TControl (even inherited from TWindow).


This inherits from the FILEBASE class. It compiles in either Fivewin/Clipper, or Harbour without FiveWin.
I think it's an older version from a few months ago, but should compile ok.
*****************************************************************************
/* Optional output file for the Cellular Automata class */
#INCLUDE "Common.CH"
#ifdef __HARBOUR__
#include "hbclass.ch"
#else
#include "FiveWin.Ch"
#endif
CREATE CLASS CAOutFile INHERIT FILEBASE
DATA cChar INIT "." PROTECTED // Default output character for two-color mode
DATA nWidth INIT 500 PROTECTED // Default line width
METHOD New( strFilePath )
METHOD SetChar( cChar )
METHOD GetChar()
METHOD SetWidth( nWidth )
METHOD GetWidth()
METHOD EndLine()
ENDCLASS
//--------------------------------------------------------------------//
METHOD New( strFilePath ) CLASS CAOutFile
DEFAULT strFilePath TO "WhatThe.TXT"
IF File( strFilePath )
FErase( strFilePath )
ENDIF
Super:New( strFilePath )
::Create( strFilePath )
SetChar()
SetWidth()
return Self
METHOD SetChar( cChar )
DEFAULT cChar TO "."
::cChar := cChar
Return Self
METHOD GetChar()
Return ::cChar
METHOD SetWidth( nWidth )
DEFAULT nWidth TO 500
::nWidth := nWidth
Return Self
METHOD GetWidth()
Return ::nWidth
METHOD EndLine
FWrite( ::Handle, Chr( 13 ) + Chr( 10 ) )
Return Self


There are two articles on OOP programming using Fivewin on my website:
http://ourworld.compuserve.com/homepage ... rogram.htm





--------------------------------------------------------------------------------


I am so sorry to send this mail.
My English is poor. I just want to know some questions that is my doublts for long time.AND until now nobody had
talk about that. Maybe nobody knows that except original author! but I believe that someone have the ideas about that, right?
The question description :
Why The "MAIN()" is FiveWin program's main entry? and Fivewin how to direct the windows message on to the
o:HANDLEVENT() method, I had studied the book "WINDOWS++", I know the "subclassing" with the c++ but I don't know how does "c" function "GetWndProcess()" access the clipper's object method in FIVEWIN?
In "WINDOWS++" I know that THE class "WPApp" has one method "Main()". If FIVEWIN's main entry
function is the same as this Main()?
Could someone answer me these questions? Many many .... thanks!


> The question description :
> Why The "MAIN()" is FiveWin
> program's main entry?
It may be Main() or simply the first PRG start function. The name is not important. The application entry point
is routed to the PRG start function.
> direct the windows message on to the
> o:HANDLEVENT() method
When the windows procedure gets a message, it locates the related Clipper object to such window, and jump from
C level to PRG level.


Many thanks for your answer!
But I still don't understand What does means "jump from C level to PRG level" ?
Does C program can call the PRG program?
How to do? Could you teach me? For examples with pesudo code or any other else.





--------------------------------------------------------------------------------


I'm trying to use the trichedit class. It seems like the class in not included with the fw libs. I get an error from the linker stating that trichedit() is an unresolved external. So I tried to compile the .prg but there is an ambigous reference: "COLOR_BTNFACE'. Anyone using the Richtext class has an alternative or solution to this problem?


All the COLOR_xxxxx constants are in wcolor.ch. So just #include this file....


Thank you Luis. That was wcolors.ch not wcolor.ch but I was able to compile it with your help. However, I now have a new linker message related to the trichedi.prg source file: "resetchrf" : unresolved external. I see
the function being used, but not declared anywhere. Any more ideas?


Sorry, don't know what that function does or where is it supposed to be located.


Luis, parece que te contaminaron, no creo que ese sea tu nombre FUCK YOU SPAMMER !!!! ;-)))))))))))))


Mi querido hermano metio mano a mi PC así que disculpas al foro.


Class TRichEdit only works with Harbour and FWH. It is a Windows API limitation.





--------------------------------------------------------------------------------


Hello, I am very interested in using TDBF but like other single language
challenged people I can not read the history.txt
Well thanks to the web translators I converted the history.txt to an English
syntax.
I use the word convert because I did not translate it.

I hope this is helpful to the community and my apologies to the what I may
have don to the Spanish language. HISTORY.ZIP





--------------------------------------------------------------------------------
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Clipper Errors

Postby Antonio Linares » Wed Aug 27, 2008 7:44 am

Clipper Errors


--------------------------------------------------------------------------------


This is the story,

Long time ago we began to have error 667, for that reason we decided to change all STATIC variable for class DATA. We have 1 class for eachmdichild of our app and we have a general class oApp for all variable we need for all the execution. The 331/332 problem was caused because all DATA of the class will NEVER be destroy, we was thinking that leaving this program and closing the child window released all stuff that we don't need anymore (wrong assumption). Remember that our APPLICATION try to go over 16 meg, after adding a codeblock to our window to assing those DATA to nil and adding to the TWINDOW class method DESTROY the EVAL of our codeblock the 331/332 dissapear(we also have a memory(-1) to issue the garbage collection of clipper) and the memory used by our app is under 3 meg.

But there is still one major question, if it's the way OBJECTS work, we will have to clean up ALL standard classes of Fivewin to released that memory, because we are still loosing some memory after all those modification and looking to Logstatics() it's all DATA that consume that memory, and adding some DATA assignment to nil we regain that memory not all but a major part of it, it's sure that some STATIC of those classes can't be removed but why not the DATA ?. I think it will be a good programming technique to RELEASED ALL unnecessary information from memory. George there must be 2 reason why you didn't have this problem:

1- You never used class DATA for your static

2- Or you used it but you released it to !

In our application mdichild with over 100 controls (if we count static text control) is really common, that's why our application was bombing so rapidly. For now, I have sent all necessary information to Antonio to see what they will do with the standard class of Fivewin. I don't know if it's our lack of knowledge about how OBJECT works in Fivewin but I was really surprised to see that killing and object never released is DATA section ! I hope it will help other fivewin user in the futur !

If you want to see snapshots of our app that will be release on september you can go to www.logava.com and click on AVANTAGE VERSION WINDOWS (it's a french site) if you want to see the real picture size click on it !


> 1- You never used class DATA for your static

> 2- Or you used it but you released it to !

Number 2 is the correct answer. I can open all the MDI child windows in any of our programs without going even up to 2 MB (depending of the amount of the controls). Then close everything and get back about 97% of the memory used. And again what happens with the other few % I do not know.


Now we know why you didn't have that problem, because using DATA for your own static and releasing it manually was the solution, be we wasn't aware of that.

>>Then close everything and get back about 97% of the memory used.

>>And again what happens with the other few % I do not know.

The few %I remaining are DATA of the Fivewin class you used ! There was 1 array that will remain in memory and gow up until you used all class needed(If I'm wrong it will be a pleasure to know it), but logstatic give me that information.


Since class data is shared by all objects of the class, i.e. those already created and also those still to be created, I guess it makes sense that that data will hang around retaining its last assigned value forever................, unless you manually assign nil to it. Are you keeping track of the number of objects and then assigning all the class data to nil only when the last object of each class is ended ?????????, or how are you doing it ???? I wander if there is a function to dynamically unload/destroy a class, i.e. the opposite of .....


nClassH=_ObjNewCls(_AsStr_(<ClsNam>) [,_AsFunc_(<SupCls>)] [,\{|| _AsFunc_(<MoreSuper>)\} ] )

[extracted from objects.ch] That would solve the problem..............................

When you create an object, Fivewin create an Image on the original class, it's not creating a reference to the original DATA of the class that's why when you issue END(), that's mean you don't need that Image anymore, why not DESTROYING those DATA that you don't need anymore, not the STATIC variable of the class but really the DATA zone for this object only. Destroying those DATA of one object don't disturb ANY other object of the same class with is own DATA. Really don't know if this kind of function exist, Antonio can give us the answer to that one !

thanks very much for your info! Now, I'm changing all my class to delete all DATA at end of use.



--------------------------------------------------------------------------------





I wonder I never so this Clipper difference:

Public cAnyVar

..

Function MyFunc(cLocalVar)

cAnyVar :=MYFILE->MYMEMO // a memo Field

cLocalVar :=MYFILE->MYMEMO

? Valtype(cAnyVar) // Return "C"

? Valtype(cLocalVar) // Return "M"

I think you have to use Type() with Public and Private Vars.




--------------------------------------------------------------------------------




I have been trying to determine the status of the 332 error and have not seen a straight forward solution. Has anybody come up with a solution to this problem.

There is a lot of history to this problem................... and many mesages in this newsgroup about it. Some people have been plagued by it and many other not. I would search this newsgroup and related ones ........ In my case I think I got 332's due to having too many clipper objects hanging around in momory at one time. I solved my 332 errors / got them under control as follows:

* I converting from Clipper 5.2e to Clipper5.3B (Rev 338). This turned out to be very easy to do, I thought it would be a lot more difficult becuase we were using comix and clipmore with 5.2e, but they are effectively fully included in standard 5.3b.Clipper 5.3b probably has better object memory management as it would have needed it with the extra object stuff that was added to it in that version.

* Before changing to 5.3b I experimented heavily with 5.2e and ALLOC.OBJ and OM_TEXT.OBJ from 5.3B which helped a lot......

* I use blinker5.1 (provides 64K +-extra static space) and the latest FW2

* I went thru a looootttttttot of trial and error and headaches

I re-coded certain "very heavy object intensive" folder programming code to

a) store fewer clipper objects at one time and

b) to only create objects when they were needed

* We fixed some code that was storing certain objects unnecessarily in a higher calling module without us realising it.

* NB Remember, just because the visual dialog (window and related controls) has been ended / destroyed / no longer exists, this does not mean your clipper objects relating to that dialog no longer exist. They could well be hanging around using memory due to bad / incorrect programming style. Objects relating to a visual window and related windows controls should only be stored in variables created in the the routine / class that creates the visual dialog (not higher up), so that they automatically loose scope and release their memory when the visual window / dialog ends.

* You need to carefully check your code to ensure your top level code /classes are not storing objects that you think are destrtoyed but are in fact still in memory

* If your app uses MDI windows, you may also need to issue a few memory(-1)'s via a timer every (say 60 seconds) after closing a MDI window to release memory. We needed this, you may or may not, I think it depends on your coding style, but it is worth a try.

* Watch your memory consumpation (by dbl clicking the bottom message bar) as you open and close many windows repeatedly. You will get a feel for whether clipper objects are beiong released properly. I think a lot of the above depends on your programmong style....................................


I have had similar problem with 332 errors. In Clipper .NG file there is an explanation, that this is memory problem. It is proved that very large arrays and large strings can be the rason of this problem. Especialy if there are large arrays and strings at the same time in program active. As .NG stated, it is good practice to create neccessary arrays or strings every time we need them, rather then keep them alive all the time until the next use. They don't say if there should be another reason for this error. I solved my problem by following this .NG statements.


As far as I know I am doing this. After I use my large Array I am issuing the statement

Array :={}

Would this be the correct way of initializing the array after use.


If the array is a LOCAL variable I think it would be better to leave tothe garbage collector the responsibility of deallocating the memory.



--------------------------------------------------------------------------------





I saw your message in the CLC NG about R6003 error on PIII 500. Is this a pure clipper exe or it is done with FW ?

As far as I know, the problem with fast processors doesn't appear with FiveWin app, I have several apps running on PIII 500 and now with AMD Athlon 700 and the run very good. I have had the problem only with Clipper / DOS apps.


I supposed so, but I decided to ask.... It has got something to do I guess with Function Main in C lang - Clipper DOS and Function WinMain in VC++ for Clipper FiveWin, which is actually very nice.


The problem is with Catools 3 the wait_tic function of that lib ! WE already have __wait_4.obj linked in our app and it seem to crash 80% of the time at startup. And the problem is only with AMD and CYRIX not INTEL. I'm waiting for my new AMD 500 mhz computer to made test. I'll try __wait_b from blink inc to see if it's better !


We have a standing rule with our clients ... no Cyrix processors, and no older AMD CPU's. The problems are so numerous we won't try to modify the code. We had one company with massive data handling problems. Interestingly, the data was not corrupted when stored, but it certainly appeared that way when displayed on the screen or in a printout. We did tests ... showing the client the problems with the Cyrix processor in, then replacing only the processor with an Intell CPU, and seeing that everything was perfect. We swapped back and forth several times, and the results were totally consistant. We then left the Intel chips in, and never had another problem. Thereafter, whenever we have someone with Cyrix chips, they just call the one company, here the test results, and replace their CPU's, resulting in no more errors.


I already know that Cyrix an AMD aren't good, But the problem is that our software is sold by 350 VAR in we have over 20,000 of installation and it's very difficult to know when people change their computer and once they have change it the want us to solved the problem, with AMD 400 and lower there seem's to be no problem (if you're not on a network setup and the AMD or Cyrix is the server). Personnally I prefer Intel for sure but you know how customer's are !;-) Anyway, I appreciated your comment it is always wellcome !


I have seen this problem on PII 366, so it is not only on CYRIX and AMD. Can't you remove that CAtools.....


No we can't remove tools III we use to much finction of it in our DOS version. With __wait_4 there is no problem on PII 366 I have a PIII 450 from intel here and I'm running the software with no problem ! BTW, I contact IBM to know if they are welling to send me for a short time period an Aptiva with AMD 500 mhz for testing purpose, we will see !


It's a pure clipper 5.2e app, It our DOS version of our accounting package there is no PROBLEM with our FW app !



--------------------------------------------------------------------------------






I have an older clipper-prg and today it gives me the M 6104 error only on clients-computers. With my 500MHz computer it run ok. Can anybody tell me a workaround for this error.


Can you describe this error? I have quite extensive documentation about Clipper and its errors, but I haven't find the reference for this error. Can you describe in what part of program this error occurs, or in what situations?. It is not neccesary that some matematical operation causing this error of course, but I would like to know if you can detect in WHAT KIND of situation an error comes up. Be more specific if can. This error can be very annoying. Is there any network connected computers in your clients where your application is running? Maybe one of them in the network is veeeeeery old one? Or one of them has corrupted memory in some segment? Does the error occurs every time the program comes to certain point, or it occurs occasionaly? Did you do some unusual matematical operations when the error occurs?


I have found today, that this error came from novell-3.2 and it is not a hardware-error. I have changed all hardware parts!

The error-msg is : run time error M6104 : math

floating point error : overflow

But this error is created only from one program in his first loading phase and it came on the first working-day in 2000. I have run today a new upgrade for novell 3.2 and the clib-patch but no good news. The same program is running in the 1999 with the same hardware-software-configuration with no problem! I have another server with the same novell-upgrading and with this server no problem. I think, i must setting the novell-system new from ground?!



--------------------------------------------------------------------------------





Sometimes, I got this kind of error :

i.e. SETKEY(0) Unrecoverable error 667: Eval stack fault.

I need to enlarge my stack capacity. In my link-file I use right now :

STACKSIZE 12500

HEAPSIZE 8500

I already tried STACKSIZE 25000 but then I already got the error when starting my program. Does anyone now how I can maximize my stack ? I use FiveWin 2.0a, Clipper 5.3b and Blinker 5.1. I have a Pentium III 500 Mhz with 128 MB RAM.

It seems there is a recursivity problem: Setkey calls Setkey ....., if not then try to increase your stacksize a little.



--------------------------------------------------------------------------------






Please, can anyone tell me what I need to do to maximize my stack capacity ? I need to open at least 10 windows behind each other but after the sixth or seventh I always got a eval stack error. PLEASE HELP ME. Thanks a lot in advance.

What are your current settings?


My Stack Size is 9600 And heapsize is 16500 and I have no problem anytime when opening many windows Please Test it :-)


If you increase the stacksize on your link file, then you are reducing the space for static vars, etc. So as we said normally do not stack to many dialogs and do not abuse of static vars. BTW if you use the Natmsg file I attach with this message which does not consume any memory of Clipper you can highly increment your stacksize up to 1.5kb more. ( MSGENG.OBJ ) This problem does not happen with Fivewin++, nor with Fivewin for Harbour.


Can you give us more info on this obj file? Can it be used with clipper 5.2e? 5.3b? What exactly does it do? Do we NEED it?


By default all C compilers put string literals and static vars in the same DGROUP segment that CA-Clipper. To avoid this problem programers can create static far vars for every string literal they wrote in their code or use a switch that moves those literals to a diferent segment. You probabily heard about a Clipper utility called DGPIG created by Michael Devore (Causeway linker) which report the consumption of DGROUP on every module inside a library. With that programa you can check that module NATMSG on clipper.lib consumes more than 1.5kb because all the string literals are saved on the DGROUP segment and the magic of that new OBJ file is that moves all the string literals to another segment. The new OBJ file is created by Matteo Baccan and you can find all the code on Blinker 5, for example and since I did not find any copyright on the source code I guess there will be no problem if I post the files in this forum to.



--------------------------------------------------------------------------------





Hi ... can anyone throw some light on this one... When compiling with RMAKE 1.4 using Clipper 5.2e and FiveWin 1.9.2 libraries, I get the following:

Error Rmake/R2001 - FiveWin.CH (943) Fatal C3048 Preprocessor Table OverFlow

I am using a P100 with 24Mb RAM and Windows 95. This is happening on programs that previously compiled without any problem. I am fairly certain it's not hardware related.


I had the same problem. I went into my FIVEWIN.CH and blocked out a few things that I am not using.

// #include "ODBC.CH"

// #include "DDE.CH"

// #include "VIDEO.CH"

This is obviously not the best solution, but it may help until a better solution is found.


You can also try to break down any big PRG into 2 smaller PRG files.


What I ended up doing is to implement two FIVEWIN.CH files - the full blown version in the linked program files and one with REMed out #Includes in the main calling program. Many thanks for your contribution.


use your RMAKE.EXE to write a batch-file for compiling and linking this (normally) works without changing on header-files.


It happens , when your source .prg is too large, or you have not enough memory in the DOS Box.


Use HI CLIPPER.EXE (This loads clipper in high memory)


From my experience using lh clipper will allow clipper to go on but the preprocessor errors still happen.



--------------------------------------------------------------------------------




My stacksize and heapsize are set in the linking script like this :

stacksize=17500

heapsize=2500

But I regularly got the error : Unrecoverable error 667 : Eval stack fault I tried many other settings. The best result I got with the settings :

stacksize=18500

heapsize=500

Which settings are the best to be able to use a maximized stack ? Thank you very much in advance for any help.


we saw that sometimes 667 error aren't real stack errors you can fix changing stacksize/heapsize, but simply a "brutal" hand-made source code mistake. The system, for some reason, is unable to write correctly the error.log file and give you this problem. Try to put some msginfo() steps in order to understand where you get the error, I believe you will see that it's your fault. Our starting rule here is: "it's always our fault!". In this way, we find and fix 99% of "strange" errors (that, naturally, were our fault...) However, we saw there aren't perfect stacksize and heapsize values; for example for our main procedure

values are :

stacksize=9500

heapsize=1024

every other value doesn't work. But in other procedures we have different values...


Personally, I use

stacksize=16384

heapsize=4096

with my FW 1.9.1.


Thanks a lot to anybody who answered to my question. Meanwhile I tried several settings myself and I got the best results with :

stacksize=18650

heapsize=500

Strange, isn't it ?



--------------------------------------------------------------------------------




I've some problems with Internal Error 5333. I'm operatin with Clipper 5.2d. The error doesn't happen every time in specific line of my program. Do you have any idea? What should I do to solve it?

Update to Clipper 5.2e - it is way more solid.


Check your heap and stack in your link file. Are you using blinker ? What version ?


What indexes do you use (CDX, NTX or...)


I'm operating with Clipper 5.2e + Fivewin 2.0c and Blinker 4.1 using CDX indexes For example:

If I redefine more than 15 gets, the error happen. Can you understand it? How many is a great number for stack? I'll try grow up my stack, ok?


I am using a stacksize of 12000 and a heapsize of 8192 My app is quite big and some of the dialogs read much more than 15 gets without problem. I'm using blinker 5.1 Have you tried to recreate your cdx indexes ?



I have an app which in one part of it has a dialog in which are 5 folders. EACH folder has 86 GET's and 12 SAY's and 12 Comboboxes! Everything works OK I'm saying this, because I think it's not the problem in numbers of GEt's in your app.

My stack = 17500, my heap= 4096

According to internal errors docmentation, check the following:

a. If you are using any 3th party library other then Clipper's and FW, try without it

b. Try to use Clipper 5.3x

c. Try to use Blinker 5.x

That's all the documentation states and suggests about internal error 5333 Hope you'll find a solution...


It also says make sure you are providing the get with the correct data type!



--------------------------------------------------------------------------------





I have written a program quite some time ago and it is running fine, I'm using Clipper 5.2e, Six Driver 3.0, Fivewin 2.0 and Blinker 4.1 but after updating the patches 1 to 21 and recompiled my program. The above message is appearing, it only happen after the program have being running for one or two hours. I'm totally lost, please help.

Can we take a look at your blinker script ? Heap and stacksize. You Probably have to increase the values.


This is the original setting from FW 2.0 that i'm using right now

stacksize 9500

heapsize 2048

I have try increasing it to

stacksize 12000

heapsize 4096

Worse, it can't even start running. The message appear straight away. Any other suggestion? I have try putting Memory(-1) on some critical area and it helps, but maybe for another hour or so and it happen again.


What else is in your script ? Some blinker commands do this type of staff. Do you have any procedure depth command ? Can you email your script ? The error is probably in there. You could also link with the mpar.obj that we all use for clipper but i don't know if it's compatible clipper 5.2 (e) and blinker 4


I've retrofitted the mpar fix to 5.2, and it does work. Hopefully it'll work for you / this problem.


This is how my link script look like:

file TEST

file PIXEL

file SIXNSX

file MPAR

BLINKER INCREMENTAL OFF

BLINKER EXECUTABLE NODELETE

BLINKER EXECUTABLE EXTENDED

BLINKER EXECUTABLE COMPRESS

MAP A,S

PACKCODE

PACKDATA

DEFBEGIN

name Test

description 'Test System'

exetype Windows 3.1

code moveable discardable preload

data preload moveable

stacksize 9500

heapsize 2048

segment 'PLANKTON_TEXT' nondiscardable

segment 'EXTEND_TEXT' nondiscardable

segment 'OM_TEXT' nondiscardable

segment 'OSMEM_TEXT' nondiscardable

segment 'SORTOF_TEXT' nondiscardable

segment 'STACK_TEXT' nondiscardable

DEFEND

NOBELL

LIB Five, FiveC, Objects

LIB WinApi, Hartafw, Six3

LIB Clipper, Extend, Terminal

output TEST.EXE



I took a look at clipper 2 error messages. And they say for this error 650 increase stack size in rtlink (Blinker for you). My app runs for hours at users site and my script is as follows

Stacksize 12000

heapsize 8192

Try to get rid of the blinker executable extended to see if it makes a change. I join my link script. Hope it helps. I don't see other stuff.



--------------------------------------------------------------------------------


Can You tell me solution for error
_OBJCLSINS (0) Unrecoverable error 332: String/array memory overflow
Where can I find it FW 2.2c, Clipper 5.2e, Blinker 6.0, Mpar.obj


I found a solution i Norton Guide error statement descripsion because it is 'typicaly' Clipper error


This is typical Clipper 5.2e error because of failure in dealing with virtual memory. This problem most probably won't appear if you use
Clipper 5.3b. It took me a long time to trace this back without satisfactory results.
My very advice : Use Clipper 5.3b which has a much better memory management. If you love your 3rd party libs which are not compatible
with 5.3b ( like SIx ) go for another tool.





--------------------------------------------------------------------------------


I developed for a Customer a FW application that works in conjunction with a DOS Clipper prg (Cl53 + blinker 5), launched on a server from a PC client through ANSI emulation (telnet).
The problem is that when the DOS program is running, the CPU of this server is 99 % busy, creating troubles to other applications in the network. I heard that is possible to decrease the priority (and CPU usage) of Clipper-DOS programs at link time or something else, but I don't know how : anyone can help me ?


Link this OBJ with your DOS program. DOSIDLE.ZIP


thank for Your help, I tried to link DOSIDLE.OBJ but CPU is still 99% when DOS-Clipper prg is running.
May be I make some other mistake somewhere ...


Try to link oslib ( search at oasis) to solve your problem


can You give me more detailed info how/where can I find this lib ?


Here it is!
http://www.the-oasis.net/


Thanks David !


I agree with Pedro, use OsLib.
You can also find it here
http://www.davep.org/clipper/oslib106.zip


Another solution for your problem:
Nanfor LIB. (oasis)
This function most use like this:
FT_ONIDLE( {||FT_IAMIDLE()} )
Both function belong to NANFOR.LIB





--------------------------------------------------------------------------------


What does this error (after linking) mean and how can it be rectified:
'ERRORSYSW(CLIPPER530)'
I am using MS Link / OptLink and Clipper 5.2e.
I read in the NG's for FW192 and FW195 that there is a library called 501-520.LIB but this library is nowhere to be found.
Is this missing library the key to the problem and - if so - could someone please email it to me,
If this is not the problem - please help!


You don't need the lib you mention. It's only for poor souls using Clipper5.01.
In you case, my bet is that you have a module in you app that was compiledwith Clipper 5.3.
If you don't have access to the source code of such module in order to recompile it, or if you're pretty sure this is not the case, add a dummy
function in your main .prg:
Function Clipper530
Return Nil




--------------------------------------------------------------------------------


I'm getting the following error:
Error description: Error DBFCDX/2006 Corruption detected: Corruption detected in memo-file;In Function: FlexGetMemoData;On Line: 1200 Can anyone help me in solving this error.


I remember this error (or one like that) and its probably you use clipper 5.3 and there are one problem with FPT (memo files with DBFCDX rdd) that have a size less than 1Kb, incredible but true.
I resolved with this trick before open the file
/*
Para reparar el bug de los FPT en 5.3
*/
FUNCTION CHECKMEMOBUG(cDataBase,cDATAPATH)
LOCAL cBuffer, cMemofile
LOCAL aDATA,nSize, nHandle
DEFAULT cDATAPATH:=DATA_PATH
cDATAPATH:=ALLTRIM(cDATAPATH)+"\"
cDATAPATH:=STRTRAN(cDATAPATH,"\\","\")
cMemofile := cFileNoExt(cDataBase)+".FPT"
IF File(cDATAPATH+cMemoFile)
aDATA:=DIRECTORY(cDATAPATH+cMemoFile)
nSize :=aDATA[1,2]
IF nSize < 1024
cBuffer := Replicate(Chr(0), 1024-nSize)
nHandle := Fopen(cDATAPATH+cMemoFile, 2)
Fseek(nHandle, 0, 2)
Fwrite(nHandle, cBuffer)
Fclose(nHandle)
ENDIF
ENDIF
RETURN NIL


Thanks very much for your reply Bingen !!!
I'am going to use your function from now on, this really saves me a lot of work.
It looks like that (in my case) these FPT memo files that have these errors are made/maintained by DBFCDXAX (ADS database server).
DBFCDXAX works well with these memos, but DBFCDX not. Maybe an other workaround is to put at least one character in every memo
file, but I did not check this allready.





--------------------------------------------------------------------------------


I already knew that clipper has problems with round() but i never think that the same was aplied to INT ()
Try to sum the 4 records to a var in the TT.DBF . dbf attached it returns 908.
If you make ?int(var) it returns 907.
Is there any explanation to this( the work around i know , int(val(str(var)) returns 908 ok)
If anybody use int() in you programs be careful with misterious returns.


That's not an INT() problem. It's the old well known floating point approximation problem. If you add SET DECIMALS TO 15 and SET FIXED ON to your test program you will see that the numbers involved are approximated. They are not what they look. :-)


Try to make with dclip utility what you said (fixed on and so on). If my field dec is 2 and the i sum the field matematicaly its impossibe to
have more that 2 decimals with value.


What's "dclip"?
> If my field dec is 2 and the i sum the field matematicaly its impossibe to
> have more that 2 decimals with value.
I think you haven't undestood what I said. You can't have absolute precision with floating point values. You see 1.23 but the value stored
could be, for instance, 1.222222222229 or 1.230000000001. You have to round your totals (not to truncate them) if you want to approximate to a
certain number of decimals.


I presume if i have a field with 14.2 .and. a value stored of 5.25 it's not 5.25 .. anything.
I thought that a field with a len and dec specific rounds automatically when i store de data in the dbf.
If i understand you are saying that a value stored in a dbf cant be or not be rounded ?
By the way dclip.exe(by riger donnay) its a utility to maintain DBF's files.


No, I'm saying that once you assign that value to a floating point variable it could not retain its original precision. And when you later
apply some calculations to it the results could be different than what you expected.


This is my variation of a function to fix Int inaccuracy by Phil Barnett in theOasis:
// Fixes quirk in Clipper's Int()
#define FIX_QUIRK 0.0000000000000005
Function FixInt( nVal, nLen, nDec )
Local lNeg := ( nVal < 0 ), cVal
Default nLen := 19, nDec := 0
cVal := If( lNeg, "-", "" ) + ;
AllTrim( Str( Abs( nVal ) + FIX_QUIRK, nLen, nDec ) )
Return Val( cVal )





--------------------------------------------------------------------------------


Sorry.... is almost a Off Topic, but it goes here!
In the network one of our client, an error appears with certain frequency when:
- one user works in our system and the program in screen is left "idle" (without using), and when trying to work with him, it aborts with this
message, or
- of random way, completely at random, in a middle to be processing anything...
Reading the NG of Clipper 5.3, I understood that this can have an origin in communication in the network. This client used hub of 10 Mbts for his network, but change recently to a swich of 100 Mbts. (changing the Network cards too to 100 Mbts).
I do not know if this it is the problem, but if somebody has experience would be welcome the advice, because really I am almost crazy with this...
It is something that I have to take into account for swich use? They are not possible to use a swich or is of delicate use?
For sure the problem is from network, because running the system in the server (it is not dedicated) the problem does not arise, and yes it happens in ALL the terminals... everything is well, and suddenly it is not communicating with the server.
Thanks anticipated for help,


is your client using screensavers? I had nearly the same problem and it flew away by disabeling any screensaver.


Which OS is on the Server ?
If it's NT,W2K,XP the problem you have it's the Autodisconnect Feature of those OS you can change this behaviour. I give you a URL to see how you can change this behaviour !
http://www.winguides.com/registry/display.php/194/






--------------------------------------------------------------------------------
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Clipper Versions

Postby Antonio Linares » Wed Aug 27, 2008 7:46 am

Clipper Versions


--------------------------------------------------------------------------------


I am busy converting our fivewin stuff from Clipper 5.2e to Clipper 5.3b. Surprisingly (to me) it only took about 1/2 hour and seems to be working fine, even though we use comix, clipmore, advantage and funcky. For those interested, Comix/Clipmore in 5.2e is "replaced" by linking in cmfun.obj and cmxfun.obj, which translate your existing comix calls into the new 5.3 syntax which supports uses DBFCDX as comix and also supports most of clipmore. My version() of clipper 5.3b comes up with "Clipper (R) 5.3b Intl. (rev. 338) (1997.04.25)" Can anybody else using 5.3b please confirm that this is indeed the latest and correct version, after applying the relevant a and b patches to the original Clipper 5.3?

Do you have link script example, also where did you get cmfun.obj and cmxfun.obj. I do not seem to have them.


they are .Prgs and should be with 5.3 <i think>


No can find cm*.* in clipper 5.3


My clipper.exe is dated 05-20-1997 5.32a all the libs have the same date and time stamp. The only one that differ are SAMPLES.LIB and LLIBG.LIB. How's your 331/332 error goes ?


Yes all my 5.3b libs are dated 20/5/97 except samples.lib and llibg.lib which are dated 20/5/96 My 331/332 errors are under control. I was keen to see if changing to 5.3b from 5.2e would make any difference to memory usage, general speed etc etc etc, but it appears to be much the same. I was also not so happy about patching alloc.obj and om.obj from 5.3b into 5.2e, how do we know they are 100% compitable??? Also, if I used 5.3b om.obj with 5.2e, I had to comment out "Segment OM.TXT nondiscardiable" (per someone else's instructions) from the link script to avoid an irritating startup Windows error which I did not understand..... We will carry on.........no doubt more interesting issues will come to light!! One day I will get that job drinking cold beer on the beach..!


Glad to see that 331/332 goes away ! I think we have the final answer about it, DESTROYING unused DATA IS the solution ! Our product will be release on september 23 1999, after that I'll go hunting the moose and take good time in the beautiful Forest of Quebec. It will be to cold here to go to the beach ;-) !



--------------------------------------------------------------------------------




I make a .BAT file that replace some functions of clipper 5.2e with the same of clipper 5.3b. This work correctly with me. I use:

clipper 5.2e

fivewin 2.0b

blinker 5.1

six III ( nsx )

some C functions

PS: edit the .bat file and make the correct path to 5.2 and 5.3. ( EDIT1.BAT )


Great! So, why did you do it? Is it more stable now?

YES! Remember that clipper 5.2e has a bug on alloc ? In 5.3b this bug not exist. I think that the others funcs of 5.3b has bug correction or improvements too.



--------------------------------------------------------------------------------




DOES ANY ONE KNOW (EMAIL ADRESS) WHERE I CAN BUY CLIPPER5.3 THANKS IN ADVANCE

Try Zac Catalogs, maybe they still have it http://www.instantsoftware.com/scripts/ ... e:pZACHome

Try



--------------------------------------------------------------------------------


I want to buy CA-Clipper v5.3b software. Where can I buy it? Can someone tell me about it?

Try www.grafxsoft.com





--------------------------------------------------------------------------------


I recently upgraded to Clipper 5.3b and FW2.2c.
I have a SET BELL OFF in my programn but the bell sounds on the last chracter entered in a GET.
It also happend in my (legacy) DOS code. Any Ideas?


FW Class TGet uses MsgBeep(), that is why you hear the bell sound.
You may remove the MsgBeep() call from Class TGet (source\tget.prg) or simply declare a:
function MsgBeep()
return nil
from your main app.


Thank you Antonio. Works like a charm.





--------------------------------------------------------------------------------
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Boris Pekic - NG's archive

Postby eduardoh » Wed Mar 16, 2011 9:53 am

Hi There,

Our company had just bought xHarbour and I'm the one given the task to migrate all our clipper applications to xHarbour. I also noticed that our application is using Funcky 2.5 and Netlib 6.5 third-party libs. Would there be anybody here that had already created wrapper functions for funcky that could be used for xHarbour and if possible that I may request a copy.

Thanks in advance,

Eduardo
eduardoh
 
Posts: 1
Joined: Wed Mar 16, 2011 5:00 am

Previous

Return to Utilities / Utilidades

Who is online

Users browsing this forum: No registered users and 2 guests