Professional OPC
Development Tools

logos

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.

ApplicationName used for certificate in C++ COM Project

More
21 Jun 2023 13:59 #11832 by csm
All working, thanks for the advice.
The following user(s) said Thank You: support

Please Log in or Create an account to join the conversation.

More
21 Jun 2023 09:16 #11830 by support

Please Log in or Create an account to join the conversation.

More
21 Jun 2023 09:15 #11829 by csm
Hello,

I have just realised my error. I was using an underscore within the __uuidof call i.e.

_EasyUAApplicationPtr easyAppPtr(__uuidof(_EasyUAApplication))

but using

_EasyUAApplicationPtr easyAppPtr(__uuidof(EasyUAApplication))

Creates the object. I'll look at adjusting the ApplicationName now.

Regards
Colin

Please Log in or Create an account to join the conversation.

More
21 Jun 2023 08:31 #11828 by csm
Hello,

Unfortunately I still get the same "Class not registered" error after uninstalling 2022.2 and installing 2023.1 and rebuilding the C++ application.

I also tested and got the same error when adding the line to one of your examples ..\Examples-COM\CPP\VisualStudio\Win32\UADocExamples\_EasyUAClient\DiscoverLocalServers.Main.cpp

. . .
namespace _EasyUAClient
{
void DiscoverLocalServers::Main()
{
// Initialize the COM library
CoInitializeEx(NULL, COINIT_MULTITHREADED);
{
_EasyUAApplicationPtr easyAppPtr(__uuidof(_EasyUAApplication));
. . .

Should this work or should I use a different way to set the ApplicationName (or other certificate details) with C++/COM in 2023.1?

Regards
Colin

Please Log in or Create an account to join the conversation.

More
20 Jun 2023 13:54 #11827 by support
OK, I am now reading your original post better, and in fact, it appears that you have already looked at the documentation that is for 2023.1.

And, the method you have "guessed" should be the right one. I.e. instantiate the EasyUAApplication object. It is not in 2022.2 but it is in 2023.1.

Please uninstall the old version first, in order to prevent possible conflicts.

Best regards
The following user(s) said Thank You: csm

Please Log in or Create an account to join the conversation.

More
20 Jun 2023 13:50 #11826 by csm
Hi,

Thanks for the quick response. Yes I can upgrade to 2023.1.

Regards
Colin

Please Log in or Create an account to join the conversation.

More
20 Jun 2023 13:25 #11825 by support
Hello.

I will give you the answer, but let me ask first: Can't you upgrade to version 2023.1?
The reason I am asking that the location of these parameters have changed in 2023.1 - so if you can upgrade, or anticipate an upgrade anyway, it would be better to do it in the new way already.

Best regards

Please Log in or Create an account to join the conversation.

More
20 Jun 2023 13:22 #11824 by csm
Hi,

I am working with an unmanaged C++ project and would like to be able to set the "ApplicationName" property. In C# it is done as follows:

// Set the application name, which determines the subject of the client certificate.
// Note that this only works once in each host process.
EasyUAApplication.Instance.ApplicationParameters.ApplicationManifest.ApplicationName = "QuickOPC - CSharp example application";

How can the global "EasyUAApplication" object be accessed using the C++ COM interfaces?

I tried to create an object as follows:

_EasyUAApplicationPtr easyAppPtr(__uuidof(_EasyUAApplication));

but this throws a "Class not registered" error.

I can access and use other QuickOPC objects, so the issue is just limited to the _EasyUAApplication class, so assume this is a special case. Can't find any examples.

I am Using QuickOPC 2022.2.

Regards
Colin

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.061 seconds