I'm working on a C++ DLL that uses an IDL file to talk to another program's API. I'm trying to call a function that's defined in the following way in the other program's .idl:
[propget, id(1014), helpstring("The user defined attribute on the feature using the name of the attribute")] HRESULT UserAttribute([in] BSTR attr_id, [out, retval] VARIANT *pVal);
This is my method call in the DLL:
VARIANT *res = udf->UserAttribute(BSTR("version"));
However, when I try to compile the program, I get this error:
1>ApplicationSink.cpp(378): error C2660: 'IFMFeature::GetUserAttribute' : function does not take 0 arguments
The line number is for the line I quoted above; also the line I quoted above is the only line where the UserAttribute method appears anywhere in the DLL. So I know the error isn't actually referring to another place in the code where I do call it without arguments. Also, I'm using many, many other functions from the API with no problem, so I don't think the issue is with the API generally. I've also written VB macros that have successfully used the UserAttribute function, so I know it works in at least some cases.
I'm calling UserAttribute, but the error is talking about GetUserAttribute -- could that be because it's doing some behind-the-scenes magic related to the fact that UserAttribute is defined as a propget function? There is no GetUserAttribute function defined in the API.
Does anyone know what's happening here and how I can fix it?