Ask a Question

pb passing numeric variable by reference to a DLL function

tandreys
Occasional Contributor

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
1 REPLY 1
YMinaev
Staff

Hi,



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. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: