Rajaat
Member
I need to test a number of COM components and I have two options:
Here is a simple example of what I mean. Suppose I have an interface with the following method:
.NET will conveniently allow me to access Count the following way:
Ok, Here is my problem. In the C++ COM implementation there is code to make sure that pVal points to a real location; in other words, that the pointer is not null. I cant make pVal null in .NET.
I noticed (through IntelliSense) some raw_ methods that seemed to allow me to access the COM signature for some methods under managed C++ but these raw_ methods were available only for COM methods and not COM properties.
Im trying to find information on this so that I can understand what my options are. Any suggestions, comments, or strategies would be appreciated!
- test using unmanaged C++
- test using .NET managed language
Here is a simple example of what I mean. Suppose I have an interface with the following method:
Code:
[object, uuid(...), pointer_default(unique)]
interface ICollection : IDispatch
{
[propget, id(...)] HRESULT Count([out, retval] long *pVal);
}
.NET will conveniently allow me to access Count the following way:
Code:
// In C#
ICollection c = new CollectionClass();
long count = c.Count;
Ok, Here is my problem. In the C++ COM implementation there is code to make sure that pVal points to a real location; in other words, that the pointer is not null. I cant make pVal null in .NET.
I noticed (through IntelliSense) some raw_ methods that seemed to allow me to access the COM signature for some methods under managed C++ but these raw_ methods were available only for COM methods and not COM properties.
Im trying to find information on this so that I can understand what my options are. Any suggestions, comments, or strategies would be appreciated!