The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Type mismatch in return from COM object
#1
Hi -

I think I'm missing something but I've already had my cup of coffee & that didn't help Big Grin

I've created a COM object in C# (it invokes a web service with NTLM authentication) and the values appear to be successfully being returned to QM. But I think I'm running into a type conversion problem.

The type is defined in C#. The type information is visible in QM when I'm writing code. And - if I use a simple "out" statement it prints the correct value. But if I use a more complex out statement it does not.

Here's what the call looks like:
WebServiceWrapper.iStudyData studyData1 = pacsWebServices.getStudyData(testAccessionOK)
and one of the values in studyData1 is the string "PatientName".

The following statement will print the correct value:
Code:
Copy      Help
out studyData1.PatientName
and the following will also work:
Code:
Copy      Help
str name = studyData1.PatientName
out "studyData1.PatientName %s" name

But both of these will fail:
Code:
Copy      Help
out F"studyData1.PatientName {studyData1.PatientName}"
and
Code:
Copy      Help
out "studyData1.PatientName %s" studyData1.PatientName
with the error message
Error (RT) in TestPacsInterface: 0x80020005, Type mismatch.

In C# I've defined the API to this class like this:
Code:
Copy      Help
[Guid("xxxxxx-xxxxx-xxxxxxx"), ClassInterface(ClassInterfaceType.AutoDual)]
    [ComVisible(true)]
    public class iStudyData
    {
        public string StudyRef;
        public string PatientName;
        ...
   }
.

Any ideas what's wrong? I'm worried that this is a symptom that there's a problem with how I've defined the type. Thanks.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)