How to assign a value to BSTR in C#

0

As part of a legacy automation, we try to assign "c:\temp" to a COM object's property.

var host = engine.Session.Hosts.Item[HostName]; 
host.TemporaryDirectory = TemporaryDirectoryPath;

During the run, we saw a COMException - "Type mismatch...0x80020005..."

It seems that the property is in typeof BSTR and have a default value "50".

Can you please advice how can I perform a string assignment in this case?

c#
.net
automation
comexception
bstr
asked on Stack Overflow Oct 19, 2017 by Liron S • edited Oct 19, 2017 by MickyD

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0