I have a C dll that I have used for years with winrunner and another automated testing tool called wintask. I cannot get QTP to successfully call some functions from the same dll.
Here's my example. #1 works. #2 fails with this error:
"Variable uses an Automation type not supported in VBScript: 'Extern.getUserName'
Line (35): "msgbox(extern.getUserName())". "
<font class="small">Code:</font><hr /><pre>Extern.Declare micInteger,"GetProcId", "C:\Code\WRSystem\Release\wrsystem.dll","GetProcId ",micString
<font class="small">Code:</font><hr /><pre>
Extern.Declare micString, "getUserName", "C:\Code\WRSystem\Release\wrsystem.dll","getUserNa me"
Here are the associated function declarations.
1) extern "C" _declspec(dllexport)int GetProcId(char* sExe_in)
2) extern "C" _declspec(dllexport)char* getUserName( )
#1 passes micString, but it seems like #2 can't accecpt the micString as a return value. I have several more functions within the dll that I really would like to get to work properly. Any help would be appreciated.
Re: extern.declare problem