- Posts: 42
- Thank you received: 0
Online Forums
Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.
Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.
Do not use the Contact page for technical issues.
Unhandled exception in C++ WriteMultipleItemValues
Please Log in or Create an account to join the conversation.
There is a bug in the example.
Here is the fixed part:
CComSafeArray<VARIANT> ArgumentsArray(;
ArgumentsArray.SetAt(0, _variant_t((IDispatch*)ItemValueArguments1Ptr));
ArgumentsArray.SetAt(1, _variant_t((IDispatch*)ItemValueArguments2Ptr));
ArgumentsArray.SetAt(2, _variant_t((IDispatch*)ItemValueArguments3Ptr));
ArgumentsArray.SetAt(3, _variant_t((IDispatch*)ItemValueArguments4Ptr));
ArgumentsArray.SetAt(4, _variant_t((IDispatch*)ItemValueArguments5Ptr));
ArgumentsArray.SetAt(5, _variant_t((IDispatch*)ItemValueArguments6Ptr));
ArgumentsArray.SetAt(6, _variant_t((IDispatch*)ItemValueArguments7Ptr));
ArgumentsArray.SetAt(7, _variant_t((IDispatch*)ItemValueArguments8Ptr));
CComVariant vArgumentsArray(ArgumentsArray);
LPSAFEARRAY pArgumentsArray = ArgumentsArray.Detach();
CComSafeArray<VARIANT> ResultArray;
ResultArray.Attach(ClientPtr->WriteMultipleItemValues(&vArgumentsArray));
ArgumentsArray.Attach(pArgumentsArray);
There are two differences:
1) additional variable - CComVariant vArgumentsArray(ArgumentsArray);
2) use of that variable - the WriteMultipleItemValues call now uses &vArgumentsArray and not &pArgumentsArray
Will be fixed in the upcoming version. Good catch!
Best regards
Please Log in or Create an account to join the conversation.
ReadMultipleItems in the same solution that is launched with that project runs successfully with no errors.
We have tried this with both the kit server (OPCLabs.KitServer.2) and TOP Server, and saw the same error with both.
Please Log in or Create an account to join the conversation.
1. In the same project, are they calling some other methods on the _EasyDAClient - such as ReadXXXX? If so, do they work?
2. Which target OPC server are they connecting to?
Thank you
Please Log in or Create an account to join the conversation.
We are doing some troubleshooting for a customer using OPC Data Client version 2022.2 in C++ with Visual Studio 2022.
When we attempt to run WriteMultipleItemValues from WriteMultipleItemValues.vcxproj, we receive an unhandled exception with an HRESULT of "E_NOINTERFACE," screenshot attached.
We are having a hard time troubleshooting this no interface supported error.
What are we missing here to get WriteMultipleItemValues to work?
Thank you, as always!
Zachary Parham
Please Log in or Create an account to join the conversation.