Alam Brito
Alam Brito

Reputation: 463

ATL-based COM objects in WinRT/Metro Style App

Scenario:
I am trying to migrate a C++ application to WinRT/Metro Style. This application uses an ATL/COM object that implements an IDispatch interface by using the class IDispatchImpl, however, according to MSDN IDispatchImpl is not available for Metro Style applications.

My ATL/COM class looks like this:

class MyATLClass :
    public IDispatchImpl<IMyDispInterface, &IID_IMyDispInterface, &LIBID_MYLIB, 1, 0>, 
    public CComObjectRoot,
    public CComCoClass<MyATLClass,&CLSID_MyATLClass>
{
    ...
}

Question:
Is there any replacement in WinRT for IDispatchImpl?

The replacement could involve deriving from different classes and discarding my IDL file for example. My ultimate goal is just to be able to do QueryInterface on an instance of MyATLClass and get a reference through IMyDispInterface. I can also include all my files (library and application) in a single project, but I do want to avoid changing the code where IMyDispInterface references are used if possible.

Upvotes: 4

Views: 1349

Answers (1)

Alam Brito
Alam Brito

Reputation: 463

Re-implementing my COM/ATL class as a WRL based component is probably the best choice in this scenario (Thanks Larry). More information is provided on these video posts:

Porting a desktop app to a Metro style app

The Windows Runtime Library (WRL)

Upvotes: 2

Related Questions