It's much more automatic than the other answers here are suggesting. All the boilerplate code is written for you by Visual Studio.
You're lucky you have the .idl, it's by far the most conveninent, I think.
You could paste the contents of the .idl file into your ATL COM project's existing .idl file, which would give you access to the declarations in it. For example, something like this could be pasted into an IDL file:
[
object,
uuid(ecaac0b8-08e6-45e8-a075-c6349bc2d0ac),
dual,
nonextensible,
helpstring("IJim Interface"),
pointer_default(unique)
]
interface IJim : IDispatch
{
[id(1), helpstring("method SpliceMainbrace")] HRESULT SpliceMainbrace(BSTR* avast);
};
Then in Class View, right click your class and choose Add | Implement Interface
.
Notice that in this dialog, you can actually browse for a .tlb file, but I think it's better to have plain-text source for these things, for version control and the like.
Pick IJim
from the list, press the >
button to add it to the list to be implemented. Press Finish.
Visual Studio will add this to your class (along with a bunch of other crap to make it work):
// IJim Methods
public:
STDMETHOD(SpliceMainbrace)(BSTR * avast)
{
// Add your function implementation here.
return E_NOTIMPL;
}