[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/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 - C++ mixer splitter implementation without ATL
Page 1 of 1

C++ mixer splitter implementation without ATL

PostPosted: 13 May 2015, 14:55
by greTol

Re: C++ mixer splitter implementation without ATL

PostPosted: 13 May 2015, 19:19
by jasper

Re: C++ mixer splitter implementation without ATL

PostPosted: 02 July 2015, 08:53
by greTol

Re: C++ mixer splitter implementation without ATL

PostPosted: 02 July 2015, 11:46
by jasper
You can simply make the name field of the base class public. Or you can implement a public member

const wchar_t *Name() {
return name.c_str();
}

in the base class, which is a "nicer" thing to do, or this

const wstring &getName() const {
return name;
}

(I believe that one is already there, you can use it directly).

But, you may want to make a new project, and generate a unit operation in there. This will ask you to put down the entire implementation of the unit operation. Have a look at the collection class that is generated there. You could copy this class into your existing project.

This collection keeps both a vector of the objects and a hash map of the indexes of the objects by name. Considerably more efficient in case there are more than a few items in the collection.

Re: C++ mixer splitter implementation without ATL

PostPosted: 10 July 2015, 14:38
by greTol
Some basic question regarding the COMSmartPtr and the access of collection elements:

//This is given (created by the COM CO Wizard 2.0)
Collection<Parameter,true> parameterCollection;

//Now I want to access elements of this collection:
//This gives no error, but I need a RealParameter
COMSmartPtr<Parameter> param = parameterCollection.items[0];

//This would be nice, but erroneous ("base class IUnknown ambiguous(?)")
COMSmartPtr<RealParameter> param = parameterCollection.items[0];

//Not working either, same error
COMSmartPtr<RealParameter> param = (COMSmartPtr<RealParameter>)parameterCollection.items[0];

How can I correctly access the elements in that collection, getting the exact type etc?

Re: C++ mixer splitter implementation without ATL

PostPosted: 10 July 2015, 15:44
by jasper