Sundar
8/17/2007 11:48:00 AM
Hi I faced this Interoperability problem if any one have answers let
me know about it.
I developed the COM interface in VC++ as follows :
interface IModuleConfig
{
HRESULT SetValue(GUID guid, VARIANT* var);
}
class CModuleConfig : public IModuleConfig
{
};
HRESULT CModuleConfig :: SetValue(GUID guid, VARIANT* var)
{
if(var.vt == VT_BOOL)
{
m_bFound = var->boolVal;
}
return S_OK;
}
I converted it into aC# as follows :
[ComImport,Guid["Guid of IModuleConfig :"]
public interface IModuleConfig
{
int SetValue(Guid guid,Object obj);
}
m_pConfig = Activator.CreateInstance(CModuleConfig);
IModuleConfig m_pModuleConfig = m_pConfig as IModuleConfig;
m_pModuleConfig.SetValue( guid,true);
The "true" value is not properly send to the COM component Any one
have an idea about it ?...