Convert std::string to FDOString?

classic Classic list List threaded Threaded
3 messages Options
nav
Reply | Threaded
Open this post in threaded view
|

Convert std::string to FDOString?

nav
It's strange I couldn't find any info online about it.
Am basically getting an error in this piece of code

        int RegisterProvider(std::string strProviderName)
    {
            FdoPtr<FdoProviderRegistry> m_pRegistry = (FdoProviderRegistry*) FdoFeatureAccessManager::GetProviderRegistry();

                m_pRegistry->RegisterProvider(strProviderName, ...blah


where strProviderName isn't being accepted (compiletime error) by RegisterProvider function because of the error Error 1 error C2664: 'FdoProviderRegistry::RegisterProvider' : cannot convert parameter 1 from 'std::string' to 'FdoString *'
Reply | Threaded
Open this post in threaded view
|

Re: Convert std::string to FDOString?

Jackie Ng
Are you not able to use std::wstring or wchar_t instead of std::string?

- Jackie
nav
Reply | Threaded
Open this post in threaded view
|

Re: Convert std::string to FDOString?

nav
Okay managed to do it like this.
     int RegisterProvider(std::string strProviderName)
    {
        std::wstring widestr = std::wstring(strProviderName.begin(), strProviderName.end());
            FdoPtr<FdoProviderRegistry> m_pRegistry = (FdoProviderRegistry*) FdoFeatureAccessManager::GetProviderRegistry();

                m_pRegistry->RegisterProvider(widestr.c_str(), ...blah

String conversion is a torture really :-)