You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Adriano Crestani <ad...@apache.org> on 2007/04/20 09:59:54 UTC

DataFactory::addType problem

I'm using the next SDO M3 RC4 and getting the SDOInvalidArgumentException
when trying to use DataFactory::addType or DataFactory::addPropertyToType
when passing a std::string argument


std::string tableName = "item";
dataFactory->addType("dasnamespace", tableName); // doesn't work
dataFactory->addType("dasnamespace", tableName.c_str() ); // works

Has it something to do with some character codification option on my VC
project?

Adriano Crestani

Re: DataFactory::addType problem

Posted by Adriano Crestani <ad...@apache.org>.
Thanks, I will try it out ; )

Adriano Crestani

On 4/20/07, Pete Robbins <ro...@googlemail.com> wrote:
>
> Interesting!
>
> There are 2 methods:
>
>    1. addType(const string&, const string&, ...etc.)
>    2. addType(const char*, const char*, ...etc.)
>
> the first variation calls the second. Where you pass char* it works. I've
> seeen similar behaviour when the string is being passed across different
> MS
> c++ runtime libraries, e.g. if your program is built Debug and SDO is
> Release. The bin distro in M3 is Release. You could try re-building the
> SDO
> as debug.
>
> Cheers,
>
>
> On 20/04/07, Adriano Crestani <ad...@apache.org> wrote:
>
> > I'm using the next SDO M3 RC4 and getting the
> SDOInvalidArgumentException
> > when trying to use DataFactory::addType or
> DataFactory::addPropertyToType
> > when passing a std::string argument
> >
> >
> > std::string tableName = "item";
> > dataFactory->addType("dasnamespace", tableName); // doesn't work
> > dataFactory->addType("dasnamespace", tableName.c_str() ); // works
> >
> > Has it something to do with some character codification option on my VC
> > project?
> >
> > Adriano Crestani
> >
>
>
>
> --
> Pete
>

Re: DataFactory::addType problem

Posted by Pete Robbins <ro...@googlemail.com>.
Interesting!

There are 2 methods:

   1. addType(const string&, const string&, ...etc.)
   2. addType(const char*, const char*, ...etc.)

the first variation calls the second. Where you pass char* it works. I've
seeen similar behaviour when the string is being passed across different MS
c++ runtime libraries, e.g. if your program is built Debug and SDO is
Release. The bin distro in M3 is Release. You could try re-building the SDO
as debug.

Cheers,


On 20/04/07, Adriano Crestani <ad...@apache.org> wrote:

> I'm using the next SDO M3 RC4 and getting the SDOInvalidArgumentException
> when trying to use DataFactory::addType or DataFactory::addPropertyToType
> when passing a std::string argument
>
>
> std::string tableName = "item";
> dataFactory->addType("dasnamespace", tableName); // doesn't work
> dataFactory->addType("dasnamespace", tableName.c_str() ); // works
>
> Has it something to do with some character codification option on my VC
> project?
>
> Adriano Crestani
>



-- 
Pete