Hi, I'm trying to use the function of you and me errors occur below:
[CODE] function Main LOCAL pFunc := ( @Test() ) cls ? Valtype( pFunc ) ? POINTER2STRING( pFunc ) return NIL function Test ? "hello word" return NIL #pragma begindump #include "hbapi.h" HB_FUNC( STRING2POINTER ) { PHB_ITEM s = hb_param( 1, HB_IT_STRING ); if( s ) hb_retptr( (void *) hb_itemGetCPtr( s ) ); } HB_FUNC( POINTER2STRING ) { PHB_ITEM p = hb_param( 1, HB_IT_POINTER ); if( p ) { PHB_ITEM s = hb_itemNew( NULL ); PHB_ITEM n = hb_param( 2, HB_IT_NUMERIC ); hb_itemPutCL( s, hb_itemGetPtr( p ), n ? hb_itemGetNI( n ) : strlen( hb_itemGetPtr( p ) ) ); hb_itemReturnRelease( s ); } } #pragma enddump [/CODE] [ERROR] hbmk2: Processando opções do ambiente: -compiler=bcc hbmk2: Plataforma detectada: win hbmk2: Usando Harbour: c:\hrb_bcc\bin c:\hrb_bcc\include c:\hrb_bcc\lib c:\hrb_bcc\lib hbmk2: Usando compilador C: c:\bcc55\bin\bcc32.exe hbmk2: Processando arquivo de configuração: c:\hrb_bcc\bin\hbmk.cfg hbmk2: Linha de comando do compilador Harbour: (interno) (c:\hrb_bcc\bin\harbour.exe) -n2 point1.prg -n -D__BCC__ -oC:\TMP\ -ic:\hrb_bcc\ hbmk2: Comando do compilador C/C++: bcc32.exe -c -q -tWM -d -6 -O2 -OS -Ov -Oi -Oc -DHB_GC_AUTO -DHB_FM_STATISTIC - C:\TMP\point1.c: Warning W8065 point1.prg 27: Call to function 'hb_itemGetCPtr' with no prototype Warning W8065 point1.prg 36: Call to function 'hb_itemNew' with no prototype in Warning W8069 point1.prg 36: Nonportable pointer conversion in function HB_FUN_P Warning W8065 point1.prg 38: Call to function 'hb_itemGetPtr' with no prototype Warning W8065 point1.prg 38: Call to function 'hb_itemGetNI' with no prototype i Warning W8065 point1.prg 38: Call to function 'hb_itemGetPtr' with no prototype Error E2342 point1.prg 38: Type mismatch in parameter '__s' (wanted 'const signe Warning W8065 point1.prg 38: Call to function 'hb_itemPutCL' with no prototype i Warning W8065 point1.prg 39: Call to function 'hb_itemReturnRelease' with no pro *** 1 errors in Compile *** [/ERROR] I need to do for the above example work ? Best Regards, Rossine. -- View this message in context: http://old.nabble.com/Ask-Str2Poniter%28%29-and-Pointer2Str%28%29-function-pair-....-tp28042446p28069776.html Sent from the Harbour - Dev mailing list archive at Nabble.com. _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour