Much more examples for using Control++

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
5 posts • Page 1 of 1
MassEffect
Posts:29
Joined: Mon Aug 24, 2020 8:19 pm

Much more examples for using Control++

Post by MassEffect »

Hello!
Tell me please, where can I find much more examples (than are showed in help) for using Control++?

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

Re: Much more examples for using Control++

Post by gschijndel »

Are you looking for specific examples?

Everybody is free to post examples on this forum. Perhaps it helps if somebody sets the good example and starts with a Control++ example.

MassEffect
Posts:29
Joined: Mon Aug 24, 2020 8:19 pm

Re: Much more examples for using Control++

Post by MassEffect »

For example, there is such function definition in WinCC OA library:

Code: Select all

static public shared_ptr<LoginFrameworkController> getInstance()
{
  if(instance == nullptr)
  {
    instance = new LoginFrameworkController();
  }

  return instance;
}
What does this entry "static public shared_ptr<LoginFrameworkController>" mean?
Is this function pointer or template using?
Last edited by gschijndel on Fri Sep 11, 2020 7:55 am, edited 1 time in total.
Reason: Set code tag

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

Re: Much more examples for using Control++

Post by weirdal »

The static function getInstance() returns a thread safe pointer to an instance of the Control++ class LoginFrameworkController.
Implicitly somewhere before, a static variable of the type "shared_ptr<LoginFrameworkController>" by the name "instance" has to be declared. Also, the function getInstance() has to be declared inside of a Control++ class.

So, it's a Control++ function that returns a pointer.

kilianvp
Posts:443
Joined: Fri Jan 16, 2015 10:29 am

Re: Much more examples for using Control++

Post by kilianvp »

ctrl++ is similar to c++

5 posts • Page 1 of 1