I am getting the following error when compiling a vendor supplied project:
CommsWorker.obj : error LNK2001: unresolved external symbol _IID_IObjectConstructString.
The vendor is no longer supporting this application, and we are trying to compile for an upgrade.
The problem is occurring in code that is using an interface. I'm hoping this is just a project set-up issue. Any help will be greatly appreciated!
CODE
//IObjectConstruct implementation
STDMETHODIMP CCommsWorker::Construct(IDispatch * pCtorObj)
{
// construct_string method is called by COM+
// if so configured in Component Services.
// Component Properties, Activation tab, Object
// constructor settings.
HRESULT hr;
CComPtr<IObjectConstructString> object_construct_string=NULL;
BSTR construct_string=NULL;
USES_CONVERSION;
m_strConfigFileName = "";
if (pCtorObj==NULL) return S_OK;
try
{
// first get the IObjectConstructString interface from the
// constructor object
// THE CODE BELOW CAUSES THE COMPILE ERROR
hr = pCtorObj->QueryInterface(IID_IObjectConstructString,
reinterpret_cast<void**>(&object_construct_string) );
if (!SUCCEEDED(hr) || object_construct_string==NULL) return S_OK;
// Get the constructor string
hr = object_construct_string->get_ConstructString(&construct_string);
if (!SUCCEEDED(hr)) return S_OK;
// copy the string -- memory allocated by OLE2CA will
// be automatically released when the method ends.
m_strConfigFileName = (construct_string == NULL ? "" : OLE2CA(construct_string));
// free the string we got from IObjectConstructString
SysFreeString(construct_string);
}
catch(...)
{
// ignore any exceptions...
}
return S_OK;
}