DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Fri, 17 Aug 2007 04:48:20 -0700,    posted on: microsoft.public.dotnet.framework.interop        back       

Thread Index
  1    Sundar
          2    Mattias Sjgren


Com and .Net Interoperability problem   
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 ?...
Date:Fri, 17 Aug 2007 04:48:20 -0700   Author:  

Re: Com and .Net Interoperability problem   

>I converted it into aC# as follows :
>
>	[ComImport,Guid["Guid of IModuleConfig :"]
>	public interface IModuleConfig
>	{
>		int SetValue(Guid guid,Object obj);


Try it like this

void SetValue(Guid guid, ref Object obj);


Mattias

-- 
Mattias Sjgren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Date:Fri, 17 Aug 2007 19:48:54 +0200   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us