- From: lpsmith at spod-central.org (Lucian Smith)
- Subject: [cellml-dev] CellML wchar sizes
- Date: Wed, 2 Dec 2009 23:16:48 +0000
* Andrew Miller <ak.miller at auckland.ac.nz> [2009-12-01 20:36] writes:
>
Lucian Smith wrote:
>
>* Andrew Miller <ak.miller at auckland.ac.nz> [2009-12-01 02:11] writes:
>
>>
>
>> nsresult rv;
>
>> nsCOMPtr<cellml_apiICellMLBootstrap>
>
>>boot(do_GetService(CELLML_BOOTSTRAP_CID, &rv));
>
>> NS_ENSURE_SUCCESS(rv, rv);
>
>> nsCOMPtr<cellml_apiIModel> mod;
>
>> rv = boot->CreateModel(NS_LITERAL_STRING("1.1"), getter_AddRefs(mod));
>
>> NS_ENSURE_SUCCESS(rv, rv);
>
>>
>
>
>
>Am I right in assuming that if I want to use OpenCell's DataCollector
>
>library (cellml-opencell/opencellStage/components/libDataCollector.so ) I
>
>will need to use XPCOM, and write code like the above, in order to use
>
>functions like MathMLToInputFormat, which takes an nsCString as an
>
>argument?
>
>
Yes, unless you want to port it to not use XPCOM.
>
>
>
>
>If so, where do the functions 'boot' and 'do_GetService' come from (as
>
>well as the (I assume) #define's) from your example?
>
>
boot is not a function - this is C++ syntax for passing arguments to an
>
object constructor.
Whoops, I knew that. Wasn't paying close enough attention when I asked
the question; sorry. The other information was indeed helpful, and I
think I basically have it, except:
>
CELLML_BOOTSTRAP_CID may need to be pasted in from
>
CellMLBootstrapXPCOM.cpp explicitly, we don't seem to have a header for
>
it (but maybe we should consider this).
>
#define CELLML_BOOTSTRAP_CID \
>
{ /* 56849f69-c321-4be6-9191-1bb2ee0a76e0 */ \
>
0x56849f69, \
>
0xc321, \
>
0x4be6, \
>
{0x91, 0x91, 0x1b, 0xb2, 0xee, 0x0a, 0x75, 0xe0} \
>
}
This is the bit that I'm having problems with--if I #define this at the
top of the file, the line:
nsCOMPtr<cellml_apiICellMLBootstrap> boot(do_GetService(CELLML_BOOTSTRAP_CID,
&rv));
gives me the error:
src/module-cellml.cpp:230: error: expected primary-expression before '{' token
-Lucian
Archive powered by MHonArc 2.6.18.