[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
CAPE-OPEN • View topic - Returning a string in c++ UO as UO Parameter

Returning a string in c++ UO as UO Parameter

Re: Returning a string in c++ UO as UO Parameter

Postby SLiebschner » 28 March 2022, 06:05

I never used COCO/COFE.
SLiebschner
 
Posts: 19
Joined: 01 February 2022, 10:14

Re: Returning a string in c++ UO as UO Parameter

Postby jasper » 28 March 2022, 08:16

As an alternative, can you perhaps log the interaction between your unit operation and ProII, using e.g. the CAPE-OPEN logger and tester tool (COLTT)?

User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Returning a string in c++ UO as UO Parameter

Postby SLiebschner » 01 April 2022, 13:21

I have no permissions to install COLTT or COCO. Can you think of yet another way to narrow it down?

PS: I made value and defValue a std::wstring instead of BSTR, but it does not help.
SLiebschner
 
Posts: 19
Joined: 01 February 2022, 10:14

Re: Returning a string in c++ UO as UO Parameter

Postby jasper » 02 April 2022, 10:39

I am not sure what you want me to suggest - the snippet you sent me is not sufficient for me to go on - it is still mixing double parameter details (minVal,maxVal,dimensionality (also passed to constructor)) with string parameter details. get_OptionList remains unimplemented, get_RestrictedToList returns NO_ERROR, but returns whatever value was already in the BOOL that was used as input argument, so the outcome is undefined. The constructor takes a pointer value (defVal) by reference.

The construction code snippet you post does not match the argument count of the constructor code snippet you post, so cannot possibly compile (as you posted it).

You cannot install tools to check whether your implementation is functioning, so you leave me really little choice but to read the code line by line, and the code is at best messy, but as said, as you posted it, it cannot even compile. Maybe you can put a bit more effort into cleanup of the code and posting the correct code? Otherwise I feel like I am putting in more effort than you.

I understand that COM programming is unpleasant. CO-LaN also understands this, and a new middle-ware which takes a lot of the COM programming out of the picture, and therefore making things a lot easier, is in the making.



Code produced with COBIA, or the class wizard () is generally a lot easier to understand and certainly a lot 'cleaner'. Perhaps this is a way forward. If you are however bound to using the COM CAPE-OPEN binding, please clean up the code, post construction code that matches constructor code; only then can I actualy perhaps say something about it (which still would require a lot of work on my end, integrating your code into a test project, and essentially running the logger or interop with a PME myself).
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Returning a string in c++ UO as UO Parameter

Postby SLiebschner » 11 April 2022, 12:16

SLiebschner
 
Posts: 19
Joined: 01 February 2022, 10:14

Re: Returning a string in c++ UO as UO Parameter

Postby jasper » 11 April 2022, 16:55

1) get_Dimensionality can return an empty VARIANT for non-real valued parameters. This is mistakenly a part of the common parameter interface, the CAPE-OPEN 1.2 definition of parameters fixes this.

2,3) in this case, return get_OptionList as an empty VARIANT, and return VARIANT_FALSE (better than 0, although equivelent) for get_RestrictedToList.

4) I misread - apologies. It demonstrates that all I can do is go over the code by reading it.

It would be good to log the interaction between the PME and the PME (ProII) so you can see whether anything goes wrong in the interaction.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Returning a string in c++ UO as UO Parameter

Postby SLiebschner » 12 April 2022, 08:33

Good news first: I got COLTT installed.
But I don't see anything in the log file, which gives me a clue why all output parameters work except the string parameter.

I tried to attach the log file, but it says: "The extension log is not allowed". Similar errors arise if I use txt as suffix or remove it all together. Posting the log inline is certainly too long.
Do you know how I can attach the file? For the time being I uploaded it here: https://mettwolke.dukun.de/s/Gs2bkFosGEKyKpx
SLiebschner
 
Posts: 19
Joined: 01 February 2022, 10:14

Re: Returning a string in c++ UO as UO Parameter

Postby jasper » 14 April 2022, 07:43

User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Returning a string in c++ UO as UO Parameter

Postby jasper » 14 April 2022, 08:14

One work around would be to make it a restricted option parameter, with only one option, which is the value you need it to have. The disadvantage of that option however, is that the list of options can only change during Edit. This implies you cannot change the value as a result of Calculate. This would be good enough for a version parameter I suppose - but I am not sure whether this covers any other use cases you may have.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Returning a string in c++ UO as UO Parameter

Postby SLiebschner » 14 April 2022, 12:48

The use case is that the UO calls a Python package, which performs the actual calculation. One output parameter of this calculation is the version number.

It would not be convenient to restrict the parameter (to a list of possible values), as I do not know which versions are yet to came: "1.2.0", "1.2.1", ... "1.3.0", ...
SLiebschner
 
Posts: 19
Joined: 01 February 2022, 10:14

PreviousNext

Return to Unit Operations

Who is online

Users browsing this forum: No registered users and 1 guest