[vbox-dev] MSCOM - ISession CoCreateInstance

Samuel Rats samuel.rats at gmail.com
Mon Jun 25 07:37:16 GMT 2012


Hi,

Thanks for your answer Klaus, but it doesn't change anything.

I just compiled the given sample for Windows, and I got exactly the same
problem.


2012/6/21 Klaus Espenlaub <klaus.espenlaub at oracle.com>

> On 21.06.2012 16:28, Samuel Rats wrote:
> > Hi guys,
> >
> > I'm currently working on a custom device manager, and I got a little
> > probleme : I'm unable to retreive session object from MSCOM
> >
> > This work :
> > CoCreateInstance(CLSID_VirtualBox, 0, CLSCTX_LOCAL_SERVER,
> > IID_IVirtualBox, (void**)&this->vbox);
>
> Yes, because it's getting a reference for an IVirtualBox instance (which
> actually lives in an out of process server, VBoxSVC).
>
> > This does'nt (error 80040154):
> > CoCreateInstance(CLSID_Session, 0, CLSCTX_LOCAL_SERVER, IID_ISession,
> > (void**)&this->session)
>
> The session object doesn't exist yet, and it must be created in the
> current process. So it must be CLSCTX_INPROC_SERVER.
>
> > Any advice ?
>
> Yes, look at the SDK sample code for this
> (sdk/bindings/mscom/samples/tstVBoxAPIWin.cpp) - it has the respective
> code sequences in it.
>
> Klaus
>
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> https://www.virtualbox.org/mailman/listinfo/vbox-dev
>



-- 
Samuel Rats
Co-Fondateur du LYAUG
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20120625/e26a427f/attachment.html>


More information about the vbox-dev mailing list