Mixing Remoting calls in ATL

Rajnish Bharti <[email protected]> Thu, 20 Jun 2002 10:24:16 +0530
Newsgroups gmane.comp.windows.devel.dotnet.general
Message-ID <[email protected]>
Hi,

I'm having problems in mixing managed code in my ATL code.
I get the following compilation errors.

error C2039: 'GetObjectA' : is not a member of 'System::Activator'
error C2664: 'GetObjectA' : cannot convert parameter 1 from 'System::Type
__gc *' to 'HGDIOBJ'

#using <mscorlib.dll>
#using <System.Runtime.Remoting.dll>
#using "PMInterface.dll"

STDMETHODIMP MyATLActivex::SomeFunc(BSTR* str)
{
        using namespace System;
        using namespace System::Runtime::Remoting ;

        Channels::Http::HttpChannel *chal=new Channels::Http::HttpChannel();
        Channels::ChannelServices::RegisterChannel(chal);

        // get Server reference
        using namespace PMInterface;

        IProjectManager * obj = __try_cast<IProjectManager
*>(Activator::GetObject(__typeof(PMInterface::IProjectManager),
                                                         _T("http://localhost/PM/ProjectManager.soap"), NULL));
}

The compiler is not able to resolve Activator::GetObject as against
CGdiObject::GetObject.

Any help would be appreciated. If possible please provide me some code
snippets involving mixing
of managed and unmanaged code.

Regards
-Rajnish

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.