Using Dynamic-link Library(DLL)

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
5 posts • Page 1 of 1
damon.qiu
Posts:3
Joined: Wed May 13, 2020 7:56 am

Using Dynamic-link Library(DLL)

Post by damon.qiu »

Hi everyone,
I was trying to include a DLL in my project.
I put it in the bin under my project folder and tried to include it with #uses in scripts.
But every time I tried, I got the following error message and the UI/Ctrl just crash.

Code: Select all

Unexpected state, The Ctrl Extension C:\WinCC_OA_Proj\Testing\bin\HelloWorld.dll is not compatible with the current library version 317000 of WinCC OA.
It might be from version <= 3.6, or a needed external library could not be loaded.
The environment is Windows Server 2019 and WinCC OA 3.17.
I have tried it on WinCC OA 3.16 but just got the same error.

What am I missing out?

weirdal
Posts:34
Joined: Thu Mar 12, 2015 11:37 am

Re: Using Dynamic-link Library(DLL)

Post by weirdal »

Looks like dependencies of your DLL are missing. Dependent DLLs that are in the project's bin folder will not be recognized.

Either add the bin folder to the PATH environment variable or put dependent DLLs into a folder that is contained in the PATH variable (eg. .\Windows\system32).

damon.qiu
Posts:3
Joined: Wed May 13, 2020 7:56 am

Re: Using Dynamic-link Library(DLL)

Post by damon.qiu »

Thanks for your reply.
I tried it last week and unfortunately I got the same issue.
I was thinking whether I missed some setup steps in WinCC OA.

gschijndel
Posts:376
Joined: Tue Jan 15, 2019 3:12 pm

Re: Using Dynamic-link Library(DLL)

Post by gschijndel »

Dynamic link libraries (or shared objects), that can be loaded using '#uses', must be compiled against the WinCC OA API.

Have a look on the topic: Using DLL in WinCC OA project
Or in the documentation: Special functions -> Control Extensions
and: Add-ons -> API

damon.qiu
Posts:3
Joined: Wed May 13, 2020 7:56 am

Re: Using Dynamic-link Library(DLL)

Post by damon.qiu »

Thank you so much.
The problem has been solved.

5 posts • Page 1 of 1