Re: error MIDL2025 : syntax error : expecting { near ","

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"Donos" <donguy76@xxxxxxxxx> wrote in message news:1187816806.414246.43230@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Ok here is the full code used in contructor of client

CMyClient::CMyClient(IUnknown* dd)
{

ASSERT(dd);
CComPtr<IUnknown> p(dd);
m_pVehicle = CComQIPtr<IVehicle>(p);
dd->Release();

}

Here you can see how "p" is declared.

Hope this helps.

I think we are getting to the heart of the matter.

How and when do you instantiate the client? You should be using one of two techniques, either CoCreateInstance(Ex) or CComObject<MyClass>::CreateInstance(). I'm guessing you are simply allocating your client on the stack or the heap. I suggest doing a little reading around the CComObject class.


Brian

.



Relevant Pages

  • Re: Design issue with constructor arguments
    ... seem to keep getting but I dont know if it has a name or something. ... I am writing a library which is to be used by some client code. ... special processing class which invokes callback function supplied by ... I instantiate the processor and then pass a reference to it ...
    (comp.object)
  • Re: LSP and subtype
    ... Client is indifferent to vs. but does not want to invoke foo() if the instance in hand is just a Base ... Moreover, even if Base is not abstract, the client only sees the interface of Base, so why should the client ever care about the runtime type of the object he deals with? ... Example: .NET provides the FileStream class http://msdn2.microsoft.com/en-us/library/y0bs3w9t which is concrete and can therefore be used on its own. ... I don't see how this backs your assertion that one should not be able to instantiate Base classes. ...
    (comp.object)
  • Design issue with constructor arguments
    ... seem to keep getting but I dont know if it has a name or something. ... I am writing a library which is to be used by some client code. ... special processing class which invokes callback function supplied by ... I instantiate the processor and then pass a reference to it ...
    (comp.object)
  • Re: What about CAO?
    ... One possible solution to this is to extend your shared assembly with an interface for a SAO object. ... It needs a single method which returns a new instance of the CAO, ... Then get a reference of this object on the client via GetObject (you do not instantiate the object, you get a proxy of the existing one from the server - so it will work with the interface only on the client). ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Connecting Out of Process Servers via COM+
    ... it would create a Dispatcher-Object first and registers ... how would I instantiate the teh object at the client? ... If two Clients at the same time are requesting the COM+-Server, the requests ...
    (microsoft.public.vb.com)