B
Brian Rogers
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_FtpProtocol.
If I use the following unmanaged C++ code, I can create an instance of the
filter.
HRESULT result;
LPUNKNOWN _pUnk = NULL;
CoInitialize( NULL);
result = CoCreateInstance( CLSID_FtpProtocol,
NULL,
CLSCTX_INPROC_SERVER,
IID_IInternetProtocol,
(LPVOID*)&_pUnk);
If I use the following C# code, I receive an error. (OutOfMemoryException)
Guid IID_IInternetProtocolInfo = new
Guid("{79eac9e3-baf9-11ce-8c82-00aa004ba90b}");
objType = Type.GetTypeFromCLSID(IID_IInternetProtocolInfo);
Activator.CreateInstance(objType);
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_FtpProtocol.
If I use the following unmanaged C++ code, I can create an instance of the
filter.
HRESULT result;
LPUNKNOWN _pUnk = NULL;
CoInitialize( NULL);
result = CoCreateInstance( CLSID_FtpProtocol,
NULL,
CLSCTX_INPROC_SERVER,
IID_IInternetProtocol,
(LPVOID*)&_pUnk);
If I use the following C# code, I receive an error. (OutOfMemoryException)
Guid IID_IInternetProtocolInfo = new
Guid("{79eac9e3-baf9-11ce-8c82-00aa004ba90b}");
objType = Type.GetTypeFromCLSID(IID_IInternetProtocolInfo);
Activator.CreateInstance(objType);
Any thoughts would be greatly appreciated.
Thanks,
Brian.