Problem in calling DLL functions.
Submitted by: Administrator[I have a DLL which contains simple functions
function1 is just returning a char value
function2 returns a Long value
function3 returns a int value
function4 returns a double value
function5 returns a float value
but when I assign a 4test variable by calling all above functions or printing the returned value it creates a problem.
Problem:
1. Not able to return the correct "char" value from dll function. it gives garbage. same problem is with function returning float . working fine for the function returning int,double.DLL is loaded properly. Using "SilkTest 6.5 International", windows-xp. Dll was created in .NET framework . Also the functions are wrapped into "C" wrapper
Above all function gives correct values when call in a .NET framework.]
Used proper SilkTest DataType ie. String corresponding to C Char type But this time Agents crashes giving error *** Error: The Agent has abnormally exited when Aborted and silk test hangs on the statement calling Dll function returning char .
Please see the sample code
[+] dll "C:partnerTEST70FrameXPressVishnu1.dll"
[ ] String ReturnChar()
[ ] float ReturnFloat()
[ ] double ReturnDouble()
[ ] long ReturnLong()
[ ] int ReturnInt()
[+] testcase DllTest()
[ String str=ReturnChar()
// hangs for ever at above statement and agent crashes
[ ] Print(ReturnInt())
[ ] Print(ReturnChar())
[ ] Print(ReturnFloat())
[ ] Print(ReturnDouble())
[ ] Print(ReturnLong())
in Dll definition of ReturnChar()
Char ReturnChar()
{
Char a='h' ;
return a;
}
Submitted by: Administrator
function1 is just returning a char value
function2 returns a Long value
function3 returns a int value
function4 returns a double value
function5 returns a float value
but when I assign a 4test variable by calling all above functions or printing the returned value it creates a problem.
Problem:
1. Not able to return the correct "char" value from dll function. it gives garbage. same problem is with function returning float . working fine for the function returning int,double.DLL is loaded properly. Using "SilkTest 6.5 International", windows-xp. Dll was created in .NET framework . Also the functions are wrapped into "C" wrapper
Above all function gives correct values when call in a .NET framework.]
Used proper SilkTest DataType ie. String corresponding to C Char type But this time Agents crashes giving error *** Error: The Agent has abnormally exited when Aborted and silk test hangs on the statement calling Dll function returning char .
Please see the sample code
[+] dll "C:partnerTEST70FrameXPressVishnu1.dll"
[ ] String ReturnChar()
[ ] float ReturnFloat()
[ ] double ReturnDouble()
[ ] long ReturnLong()
[ ] int ReturnInt()
[+] testcase DllTest()
[ String str=ReturnChar()
// hangs for ever at above statement and agent crashes
[ ] Print(ReturnInt())
[ ] Print(ReturnChar())
[ ] Print(ReturnFloat())
[ ] Print(ReturnDouble())
[ ] Print(ReturnLong())
in Dll definition of ReturnChar()
Char ReturnChar()
{
Char a='h' ;
return a;
}
Submitted by: Administrator
Read Online SilkTest Job Interview Questions And Answers
Top SilkTest Questions
☺ | How to search for html link? |
☺ | How to read .xls file contents without using the ddt wizard? |
☺ | Need help regd. silk test runing thr .bat file on cmd prompt? |
☺ | How to launch 2 web application windows simultaneously thru Silktest? |
☺ | Can SilkTest run on Mac? |
Top Application Program Categories
☺ | AutoCAD Interview Questions. |
☺ | Microsoft Office Interview Questions. |
☺ | Microsoft Outlook Interview Questions. |
☺ | Microsoft Excel Interview Questions. |
☺ | WPF Interview Questions. |