PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Jean-Pierre LEROY on April 04, 2005, 06:07:58 AM

Title: Problem with DTN_DATETIMECHANGE function for DateTimePicker
Post by: Jean-Pierre LEROY on April 04, 2005, 06:07:58 AM
Hi,

I've got a PowerBASIC compiler error, when I try to compile my FF project; the error is in a DTN_DATETIMECHANGE function for a DateTimePicker Control.

PowerBasic Compiler returned an error during compiling, Error Number = 414; I can't see what is wrong !

FUNCTION FORM1_DATEACTUELLE_DTN_DATETIMECHANGE ( _
                                              ControlIndex  AS LONG,           _  ' index in Control Array
                                              hWndForm      AS DWORD,          _  ' handle of Form
                                              hWndControl   AS DWORD,          _  ' handle of Control
                                              pNMHDR        AS NMHDR PTR       _  ' pointer to NMHDR structure
                                              ) AS LONG

END FUNCTION

Has anyone else got this problem ?

Jean-Pierre
Title: Problem with DTN_DATETIMECHANGE function for DateTimePicker
Post by: TechSupport on April 04, 2005, 09:47:00 AM
The problem is that you are using the new PB compilers and they do not allow pointers to be passed by reference. They must be passed ByVal. You need to modify the declaration:

ByVal pNMHDR AS NMHDR PTR _ ' pointer to NMHDR structure

I have already fixed this for the next version of FireFly.
Title: Problem with DTN_DATETIMECHANGE function for DateTimePicker
Post by: Jean-Pierre LEROY on April 04, 2005, 10:17:46 AM
Ok Paul, I've just try with "BY VAL" keyword and it's Ok.

Thank you very much for your help.
Jean-Pierre
Title: Problem with DTN_DATETIMECHANGE function for DateTimePicker
Post by: Haakon Birkeland on April 04, 2005, 10:53:55 AM
QuoteThey must be passed ByVal.
For some unknown reason I've caught the change of reference made in 8.x, but when I looked in the help-file last time, I couldn't find any anything there. Have anyone seen any elaborative text on the subject there?
Title: Problem with DTN_DATETIMECHANGE function for DateTimePicker
Post by: TechSupport on April 04, 2005, 10:56:07 AM
If I remember correctly, in previous versions of PB they have indicated that pointers *should* be passed ByVal. In the latest compiler they decided to strictly enforce it. I assume that in the past that the compiler simply treated parameters without the ByVal keyword as being ByVal regardless.
Title: Problem with DTN_DATETIMECHANGE function for DateTimePicker
Post by: Roger Garstang on April 04, 2005, 11:14:24 AM
Yeah, I think it is kinda dumb the way they did it too.  I think it only should have an error if you explicitly try to uses it as any other type of parameter and keep the old way of assuming ByVal.