Forum Discussion

kylabohon's avatar
kylabohon
New Contributor
14 years ago

Connect.Dll is null

I am using the following bit of C# code to try to define an array that I will then send to a method I am calling in a C# dll.  But when the code executes Connect.Dll is null.  I have verified the DLL Access plug-in is installed by looking at the File/Instal Extensions dialog and can see the plug-in is installed.  Any ideas why Connect.Dll is null?





AutomatedQA.script.var arrayType = Connect.Dll["DefineType"]("tmpArrayType", (int)VarEnum.VT_UI1, "Value");

AutomatedQA.script.var byteArray = Connect.Dll["New"]("tmpArrayType", bufferSize);

for (int i = 0; i < bufferSize; i++)

{

    byteArray["Item"](i)["Value"] = buffer;

}

3 Replies

  • Kyla,


    Perhaps, TestComplete is not in the test-running mode. That is, you didn't call Connect.RunTest in your application before working with the Connect object (see http://support.smartbear.com/viewarticle/11477/).


    Also, why do you use TestComplete objects to call functions from DLLs? I'd suggest using C# built-in capabilities for this. They should be faster and more reliable.

  • kylabohon's avatar
    kylabohon
    New Contributor
    I did call Connect.RunTest before using the Connect object.  Prior to using Connect.Dll I had already used the Connect object to access and run other methods within a DLL.  I just needed to create an array to pass to another method.  According to the documentation I needed to use Connect.Dll to do this.



    I assume you mean to use the C# AppDomain class to call functions in DLLs?



    Thanks,

    Kyla