pb passing numeric variable by reference to a DLL function
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2010
04:28 AM
06-28-2010
04:28 AM
pb passing numeric variable by reference to a DLL function
when I pass numeric variable by reference to a function in an external DLL, the modified value are not visible in TC.
In the example below, after the call to the function, the value of nrow and ncol is still 0.
Passing a structure, a string (via dll.new("lpstr")) is working fine.
any idea?
thanks
LONG WINAPI GridGetSelectedCell(HWND hWndGrid, unsigned long* row, unsigned long* col)
{
*row=2;
*col=3;
return 1;
}
in TC (7.52)
[jscript]
MY_DLL.DefineProc("GridGetSelectedCell",vt_i4,vt_byref | vt_ui4,vt_byref | vt_ui4,vt_hresult );
mydll = DLL.Load("D:\\auto\\current\\Tools\\Syb_qa\\Debug\\syb_qa.dll","MY_DLL")
...
var nrow=0;
var ncol=0;
mydll.GridGetSelectedCell(SGridWnd.Handle,nrow,ncol);
//I'm expecting nrow=3, ncol=2
In the example below, after the call to the function, the value of nrow and ncol is still 0.
Passing a structure, a string (via dll.new("lpstr")) is working fine.
any idea?
thanks
LONG WINAPI GridGetSelectedCell(HWND hWndGrid, unsigned long* row, unsigned long* col)
{
*row=2;
*col=3;
return 1;
}
in TC (7.52)
[jscript]
MY_DLL.DefineProc("GridGetSelectedCell",vt_i4,vt_byref | vt_ui4,vt_byref | vt_ui4,vt_hresult );
mydll = DLL.Load("D:\\auto\\current\\Tools\\Syb_qa\\Debug\\syb_qa.dll","MY_DLL")
...
var nrow=0;
var ncol=0;
mydll.GridGetSelectedCell(SGridWnd.Handle,nrow,ncol);
//I'm expecting nrow=3, ncol=2
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2010
08:15 PM
07-01-2010
08:15 PM
Hi,
JScript doesn't support passing parameters by reference.
JScript doesn't support passing parameters by reference.
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
