Conversione Libreria di interfaccia a LibMySql.dll
Posted: Tue Mar 20, 2018 11:54 am
Buongiorno a tutti.
da poco ho cominciato a sperimentare l'import dei miei progetti VO in X#.
Siccome la maggior parte dei progetti ha un utilizzo misto di DBF e MySql attraverso LibMySql ho cominciato subito da quest'ultimo componente.
Per l'interfaccia uso una vecchia classe che credo fosse stata scritta da Fabrice Foray.
La compilazione è andata a buon fine, ma usandola ho subito riscontrato un errore:
***************************************************************************************************
Error occurred in C:GDOshopPosExplorerGDOx-PosExplorer.exe at 20/03/2018 12:32:56------------------------------------------------------------
Impossibile effettuare il marshalling di 'return value': I puntatori non possono fare riferimento a strutture per le quali è stato eseguito il marshalling. Utilizzare ByRef.
Callstack:
in GDO-00-LoadSQLlib.Functions.mysql_fetch_row(_tcxMYSQL_RES* result)
in FabMySQLResult.get_fetch_row()
in GDOx-PosExplorer.Exe.Functions.MysqlDB_QueryResult(String sQuery) in C:XporterOutputGDOx-PosExplorerMysql x PosExp.prg:riga 197
in PosExplorerWin.CaricaTabelle(__Usual[] Xs$Args) in C:XporterOutputGDOx-PosExplorerForm PosExplorerWin.prg:riga 1417
in PosExplorerWin.PrimoInit(__Usual[] Xs$Args) in C:XporterOutputGDOx-PosExplorerForm PosExplorerWin.prg:riga 1457
in PosExplorerWin.Expose(__Usual[] Xs$Args) in C:XporterOutputGDOx-PosExplorerForm PosExplorerWin.prg:riga 1440
in Vulcan.VO.Window.Dispatch(__Usual[] $args)
in VulcanVOGUIClasses.Functions.__WCDialogProc(Void* hWnd, UInt32 uMsg, UInt32 wParam, Int32 lParam)
in VulcanVOWin32APILibrary.Functions.CallWindowProc(Void* lpPrevWndFunc, Void* hwnd, UInt32 Msg, UInt32 wParam, Int32 lParam)
in bTools_bBrowser.Functions.bEventHandler(Void* hWindow, UInt32 iMessage, UInt32 iWParam, Int32 iLParam)
**************************************************************************************************
l'errore sembra generato qui:
ACCESS fetch_row
LOCAL oRow AS FabMySQLRow
LOCAL pRow AS PTR
//
SELF:__Check_pMySQL_Res( #fetch_row )
pRow := mysql_fetch_row( SELF:pmySQL_RES )
IF ( pRow != NULL_PTR )
oRow := FabMySQLRow{ SELF, pRow }
ENDIF
//
RETURN oRow
_DLL FUNCTION mysql_fetch_row( result AS _tcxMYSQL_RES ) AS PSZ PTR PASCAL:libmySQL.mysql_fetch_row
VOSTRUCT _tcxMYSQL_RES
MEMBER row_count AS REAL8
//
MEMBER field_count AS DWORD
MEMBER current_field AS DWORD
MEMBER fields AS _tcxMYSQL_FIELD
MEMBER data AS _tcxMYSQL_DATA
MEMBER data_cursor AS _tcxMYSQL_ROWS
MEMBER field_alloc IS _tcxMEM_ROOT
// If unbuffered read
MEMBER row AS PSZ PTR
// buffer to current row
MEMBER current_row AS PSZ PTR
// column lengths of current row
MEMBER lengths AS DWORD PTR
// for unbuffered reads
MEMBER handle AS _tcxMYSQL
// Used my mysql_fetch_row
MEMBER eof AS BYTE
Qualcuno riesce a capire dove sbaglio?
Grazie
Gianluca
da poco ho cominciato a sperimentare l'import dei miei progetti VO in X#.
Siccome la maggior parte dei progetti ha un utilizzo misto di DBF e MySql attraverso LibMySql ho cominciato subito da quest'ultimo componente.
Per l'interfaccia uso una vecchia classe che credo fosse stata scritta da Fabrice Foray.
La compilazione è andata a buon fine, ma usandola ho subito riscontrato un errore:
***************************************************************************************************
Error occurred in C:GDOshopPosExplorerGDOx-PosExplorer.exe at 20/03/2018 12:32:56------------------------------------------------------------
Impossibile effettuare il marshalling di 'return value': I puntatori non possono fare riferimento a strutture per le quali è stato eseguito il marshalling. Utilizzare ByRef.
Callstack:
in GDO-00-LoadSQLlib.Functions.mysql_fetch_row(_tcxMYSQL_RES* result)
in FabMySQLResult.get_fetch_row()
in GDOx-PosExplorer.Exe.Functions.MysqlDB_QueryResult(String sQuery) in C:XporterOutputGDOx-PosExplorerMysql x PosExp.prg:riga 197
in PosExplorerWin.CaricaTabelle(__Usual[] Xs$Args) in C:XporterOutputGDOx-PosExplorerForm PosExplorerWin.prg:riga 1417
in PosExplorerWin.PrimoInit(__Usual[] Xs$Args) in C:XporterOutputGDOx-PosExplorerForm PosExplorerWin.prg:riga 1457
in PosExplorerWin.Expose(__Usual[] Xs$Args) in C:XporterOutputGDOx-PosExplorerForm PosExplorerWin.prg:riga 1440
in Vulcan.VO.Window.Dispatch(__Usual[] $args)
in VulcanVOGUIClasses.Functions.__WCDialogProc(Void* hWnd, UInt32 uMsg, UInt32 wParam, Int32 lParam)
in VulcanVOWin32APILibrary.Functions.CallWindowProc(Void* lpPrevWndFunc, Void* hwnd, UInt32 Msg, UInt32 wParam, Int32 lParam)
in bTools_bBrowser.Functions.bEventHandler(Void* hWindow, UInt32 iMessage, UInt32 iWParam, Int32 iLParam)
**************************************************************************************************
l'errore sembra generato qui:
ACCESS fetch_row
LOCAL oRow AS FabMySQLRow
LOCAL pRow AS PTR
//
SELF:__Check_pMySQL_Res( #fetch_row )
pRow := mysql_fetch_row( SELF:pmySQL_RES )
IF ( pRow != NULL_PTR )
oRow := FabMySQLRow{ SELF, pRow }
ENDIF
//
RETURN oRow
_DLL FUNCTION mysql_fetch_row( result AS _tcxMYSQL_RES ) AS PSZ PTR PASCAL:libmySQL.mysql_fetch_row
VOSTRUCT _tcxMYSQL_RES
MEMBER row_count AS REAL8
//
MEMBER field_count AS DWORD
MEMBER current_field AS DWORD
MEMBER fields AS _tcxMYSQL_FIELD
MEMBER data AS _tcxMYSQL_DATA
MEMBER data_cursor AS _tcxMYSQL_ROWS
MEMBER field_alloc IS _tcxMEM_ROOT
// If unbuffered read
MEMBER row AS PSZ PTR
// buffer to current row
MEMBER current_row AS PSZ PTR
// column lengths of current row
MEMBER lengths AS DWORD PTR
// for unbuffered reads
MEMBER handle AS _tcxMYSQL
// Used my mysql_fetch_row
MEMBER eof AS BYTE
Qualcuno riesce a capire dove sbaglio?
Grazie
Gianluca