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.

Compile with multiple libraries

More
24 Nov 2022 15:58 #11238 by federica
Thank you very much for your answer.

I changed my code following your suggestion:
[...]
// OpcLabs.BaseLib
//#if _MSC_VER >= 1300
//#define IMPORT_OPCLABS_BASELIB "libid:ecf2e77d-3a90-4fb8-b0e2-f529f0cae9c9"
//#else
#define IMPORT_OPCLABS_BASELIB	"OpcLabs.BaseLib.tlb"
//#endif
#import IMPORT_OPCLABS_BASELIB version("5.3f")  \
rename("value", "Value") \
rename("password", "Password")
using namespace OpcLabs_BaseLib;
[...]

Thanks
Federica

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

More
24 Nov 2022 14:26 #11237 by support
Hello.

I am sure you are aware that for run-time COM apps, multiple QuickOPC version cannot coexist in the same computer.

For COM development-time, we do not support it either, but in some cases - and when you know what you are doing - it might possible.
Since QuickOPC reuses the same IIDs, CLSIDs and also TLBIDs, you need to make sure you are importing the right type library. So, if you can assure that the file that will be found by the compiler for the #import directive is of the right version, I think your approach may work - although I have not tried it.

Also note that the #import directive has an optional "version" attribute, which might be another way to go: learn.microsoft.com/en-us/cpp/preprocessor/hash-import-directive-cpp?view=msvc-170 .

Regards
The following user(s) said Thank You: federica

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

More
24 Nov 2022 07:47 #11234 by federica
Hi,

I'm using QuickOPC COM, developing in C++.

I need to compile my project with multiple versions of QuickOPC libraries in order to distruibute my projects with backward compatibility.

I created separate projects using Visual Studio and I installed multiple libraries on the machine where I will compile.

I also edited "Quickopc.h" file in order to directly reference tlb files.
For example:
[...]
// OpcLabs.BaseLib
//#if _MSC_VER >= 1300
//#define IMPORT_OPCLABS_BASELIB	"libid:ecf2e77d-3a90-4fb8-b0e2-f529f0cae9c9"
//#else
#define IMPORT_OPCLABS_BASELIB	"OpcLabs.BaseLib.tlb"
//#endif
#import IMPORT_OPCLABS_BASELIB \
	rename("value", "Value") \
  rename("password", "Password")
using namespace OpcLabs_BaseLib;
[...]

Do you see any downside doing this?
Or do you think I should do something else?

Thanks,
Federica

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

Moderators: support
Time to create page: 0.054 seconds