Frank,
I suggest comparing your browse definition with that in testxbrw.prg to see if you can find what might be triggering the error. It would be very helpful if you could create a simple test program that shows the error.
Regards,
James
Frank,
I suggest comparing your browse definition with that in testxbrw.prg to see if you can find what might be triggering the error. It would be very helpful if you could create a simple test program that shows the error.
Regards,
James
I think you made an error because the string of state is not ok
I suggest to try to save a normal state before to try your test
the paintheader() method must read exactly fields :
sample
Customer=21;1:150:S;2:150:S;3:150:S;4:150:S
the number of record 21
the first column 1
the size 150
show or Hide S
the second column 2
the size 150
show or Hide S
....
until to 4
#include "fivewin.ch"
#include "xbrowse.ch"
function Main()
local oWnd, oBrw
LOCAL cState := ""
LOCAL aState
cState := cState := "XSS:41E70006004123000200430D005265417272616E6765436F6C73410E0003004E0100314E0100324E0100334115000200430B005F6E526F774865696768744E02003138412E0002004308005F6E576964746873411E0003004E06003932332E30384E06003130372E36394E0700313932332E303841230002004307005F6C486964657341140003004C03002E462E4C03002E462E4C03002E462E411C0002004309005F6347727048647273410B000300550000550000550000412E0002004309005F6348656164657273411D000300430A00506172612E2D4E616D654304005765727443040054657874"
REQUEST DBFCDX
USE RSTRSTT
INDEX ON Field->Prmtr_txt TO RSTRSTT
SET ORDER TO "RSTRSTT"
GO TOP
DEFINE WINDOW oWnd TITLE "Test RestoreState() FWH 1010"
@ 0, 0 XBROWSE oBrw OF oWnd LINES CELL
oBrw:nMarqueeStyle = MARQSTYLE_HIGHLROW
oBrw:CreateFromCode()
aState := ARead( HexToStr( SubStr( cState, 5 ) ) )
AltD()
oBrw:RestoreState( cState )
oWnd:oClient := oBrw
ACTIVATE WINDOW oWnd VALID ( cState := oBrw:SaveState(), .T. )
AltD()
return NILUnfortunately the sample is working with the right value for <cState>:
cState :=
"XSS:41E70006004123000200430D005265417272616E6765436F6C73410E0003004E0100314E0100324E0100334115000200430B005F6E526F774865696768744E02003138412E0002004
308005F6E576964746873411E0003004E06003932332E30384E06003130372E36394E0700313932332E303841230002004307005F6C486964657341140003004C03002E462E4C03002E4
62E4C03002E462E411C0002004309005F6347727048647273410B000300550000550000550000412E0002004309005F6348656164657273411D000300430A00506172612E2D4E616D654
304005765727443040054657874"
But it's only working in this sample, my application still crashes:
Error description: Error BASE/1004 Class: 'NIL' has no exported method: EVAL
Args:
[ 1] = U
Called from: => EVAL(0)
Called from: xbrowse.prg => (b)TXBROWSE:TXBROWSE(385)
Called from: => TXBROWSE:KEYCOUNT(0)
Called from: xbrowse.prg => TXBROWSE:REFRESH(1131)
Called from: xbrowse.prg => TXBROWSE:RESTORESTATE(5447)
Called from: my_txbrowse.prg => MY_RESTORESTATE(2458)
Called from: my_txbrowse.prg => MY_TXBROWSE(637)
Called from: my_browse.prg => MY_BROWSE(116)
Called from: C:\xHarbour\SewIS-PPS\my_application.prg => (b)BUILDMENU(1405)
Called from: .\source\classes\MENU.PRG => TMENU:COMMAND(437)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND(1029)
Called from: .\source\classes\MDIFRAME.PRG => TMDIFRAME:COMMAND(243)
Called from: => TMDIFRAME:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(3394)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(978)
Called from: C:\xHarbour\SewIS-PPS\my_application.prg => MAIN(571)
XSS:419B020600416D000200430D005265417272616E6765436F6C7341580013004E0100314E0100324E0100334E0100344E0100354E0100364E0100374E0100384E0100394E020031304E020031314
E020031324E020031334E020031344E020031354E020031364E020031374E020031384E020031394115000200430B005F6E526F774865696768744E02003138417B0002004308005F6E576964746873
416B0013004E020031374E020038304E020035394E020038304E03003232304E020033384E03003135304E03003135304E020037334E03003232304E03003239304E03003130384E020039344E02003
3384E03003130384E0400313532324E03003130384E020039344E0200333841830002004307005F6C486964657341740013004C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E4
62E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E46
2E4C03002E462E414C0002004309005F6347727048647273413B00130055000055000055000055000055000055000055000055000055000055000055000055000055000055000055000055000055000
055000055000041BB0002004309005F634865616465727341AA001300430700566F726C6167654306005465726D696E4307004B656E6E756E674307004B642E2D4E722E430700566F726E616D654304
004E616D6543070054656C65666F6E4304004C616E64430300504C5A4303004F727443060053747261DF65430600556D7361747A430000550000430F00556D732E2D53742E2D49442D4E722E430E00
417566747261677366656C646572430600556D7361747A4305004F6666656E4304004A616872
XSS:419B020600416D000200430D005265417272616E6765436F6C7341580013004E0100314E0100324E0100334E0100344E0100354E0100364E0100374E0100384E0100394E020031304E020031314
E020031324E020031334E020031344E020031354E020031364E020031374E020031384E020031394115000200430B005F6E526F774865696768744E02003138417B0002004308005F6E576964746873
416B0013004E020031374E020038304E020035394E020038304E03003232304E020033384E03003135304E03003135304E020037334E03003232304E03003239304E03003130384E020039344E02003
3384E03003130384E0400313532324E03003130384E020039344E0200333841830002004307005F6C486964657341740013004C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E4
62E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E46
2E4C03002E462E414C0002004309005F6347727048647273413B00130055000055000055000055000055000055000055000055000055000055000055000055000055000055000055000055000055000
055000055000041BB0002004309005F634865616465727341AA001300430700566F726C
Gilbert,
see fwh\source\winapi\profile.c
This line:
HB_FUNC( GETPVPROFSTRING )
HB_FUNC( GETPVPROFS )
{
BYTE bBuffer[ 1024 ]; <<--
It seems it is only allocating a 1k buffer for the data. Perhaps try increasing that to see if it solves the problem. If it does we can ask Antonio about making that change.
Regards,
James
Error E2342 CTOFUNC.C 256: Type mismatch in parameter 'lpKeyName' (wanted 'const signed char *', got 'int') in function HB_FUN_GETPVPROFSTRING
HB_FUNC( GETPVPROFSTRING )
{
BYTE bBuffer[ 2048 ];
WORD wLen;
wLen = GetPrivateProfileString( hb_parc( 1 ), // Section
IF( HB_ISCHAR( 2 ), hb_parc( 2 ), 0 ), // Entry
hb_parc( 3 ), // Default
( char * ) bBuffer, // Destination Buffer
sizeof( bBuffer ) - 1, // M x Len
hb_parc( 4 ) ); // INI File (<= line 256 in my sourcecode )
if( wLen )
hb_retclen( ( char * ) bBuffer, wLen );
else
hb_retc( "" );
}Gilbert,
Sorry, I don't know much about C. I suggest trying to compile the unchanged profile.c program with your current compiler and parameters to see if that works. If it does, then it is something specific about your ctofunc.c program that is causing the problem.
You could also try using BEGINDUMP/ENDDUMP and put the function right into your PRG.
Regards,
James
James (& others who might know a little more about c)
the error stays the same if I include the function in one of my PRG's
(I also get a warning: "Warning W8064 EHO.prg 2328: Call to function 'HB_ISCHAR' with no prototype in function HB_FUN_GETPVPROFSTRING", but I think the error mentioned before is causing the trouble, as this is only a warning)
Gilbert,
Please try compiling the profile.c program to see if that works OK. If so, then you can just include the OBJ in your program.
Also, did you inlcude the INCLUDEs that are in profile.c in your ctofunc.c program?
James
James Bott wrote:
Please try compiling the profile.c program to see if that works OK. If so, then you can just include the OBJ in your program.
James Bott wrote:
Also, did you inlcude the INCLUDEs that are in profile.c in your ctofunc.c program?
If I do that I get numerous errors about other functions in there
Hi,
though the sample is working with the right value for <cState> my application crashes as described above!
I have no more idea what is going on ![]()
Frank,
As Gilbert discovered, some cState values are too large to be retrieved from an INI file, thus they are truncated. Gilbert has not yet been able to compile a revised C program to correct the problem. But, it will happen as soon as we can get some guidance from a C programmer.
Regards,
James
James,
thank you for your advice.
Just debugging xbrowse.prg till method KeyNo(), wondering that the value of <nGoTo> and also the code block <bKeyNo> is NIL!
So it's clear: a refresh is not suitable, because the browse isn't activated yet.
It's working now, only by commenting '::Refresh()' in the method 'RestoreState()'! ![]()