Hello everyone,
I apologize for the cross and re-post, but I am still searching for an
answer.
Why can C++ can create this object, but C# can't?
I am trying to create an instance of the default FTP asynchronous pluggable
protocol adaptor, so I can analyse the traffic between urlmon.dll (IE) and
the FTP server. The language I am attempting to use is C#.
The CLSID for the adaptor (as referenced in the protocol registry key) is
{79eac9e3-baf9-11ce-8c82-00aa004ba90b} and is stored as CLSID_FtpProtoc ol.
If I use the following unmanaged C++ code, I can create an instance of the
filter.
HRESULT result;
LPUNKNOWN _pUnk = NULL;
CoInitialize( NULL);
result = CoCreateInstanc e( CLSID_FtpProtoc ol,
NULL,
CLSCTX_INPROC_S ERVER,
IID_IInternetPr otocol,
(LPVOID*)&_pUnk );
If I use the following C# code, I receive an error. (OutOfMemoryExc eption)
Guid IID_IInternetPr otocolInfo = new
Guid("{79eac9e3-baf9-11ce-8c82-00aa004ba90b}") ;
objType = Type.GetTypeFro mCLSID(IID_IInt ernetProtocolIn fo);
Activator.Creat eInstance(objTy pe);
Any thoughts would be greatly appreciated.
Thanks,
Brian.
I apologize for the cross and re-post, but I am still searching for an
answer.
Why can C++ can create this object, but C# can't?
I am trying to create an instance of the default FTP asynchronous pluggable
protocol adaptor, so I can analyse the traffic between urlmon.dll (IE) and
the FTP server. The language I am attempting to use is C#.
The CLSID for the adaptor (as referenced in the protocol registry key) is
{79eac9e3-baf9-11ce-8c82-00aa004ba90b} and is stored as CLSID_FtpProtoc ol.
If I use the following unmanaged C++ code, I can create an instance of the
filter.
HRESULT result;
LPUNKNOWN _pUnk = NULL;
CoInitialize( NULL);
result = CoCreateInstanc e( CLSID_FtpProtoc ol,
NULL,
CLSCTX_INPROC_S ERVER,
IID_IInternetPr otocol,
(LPVOID*)&_pUnk );
If I use the following C# code, I receive an error. (OutOfMemoryExc eption)
Guid IID_IInternetPr otocolInfo = new
Guid("{79eac9e3-baf9-11ce-8c82-00aa004ba90b}") ;
objType = Type.GetTypeFro mCLSID(IID_IInt ernetProtocolIn fo);
Activator.Creat eInstance(objTy pe);
Any thoughts would be greatly appreciated.
Thanks,
Brian.
Comment