[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

C++ mixer splitter implementation without ATL

C++ mixer splitter implementation without ATL

Postby greTol » 13 May 2015, 14:55

greTol
 
Posts: 20
Joined: 26 August 2013, 14:45

Re: C++ mixer splitter implementation without ATL

Postby jasper » 13 May 2015, 19:19

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

Re: C++ mixer splitter implementation without ATL

Postby greTol » 02 July 2015, 08:53

greTol
 
Posts: 20
Joined: 26 August 2013, 14:45

Re: C++ mixer splitter implementation without ATL

Postby jasper » 02 July 2015, 11:46

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.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: C++ mixer splitter implementation without ATL

Postby greTol » 10 July 2015, 14:38

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?
greTol
 
Posts: 20
Joined: 26 August 2013, 14:45

Re: C++ mixer splitter implementation without ATL

Postby jasper » 10 July 2015, 15:44

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


Return to Unit Operations

Who is online

Users browsing this forum: No registered users and 1 guest

cron