R
rep_movsd
Hi
I have a C++ com object that exposes IStream and IPropertyBag, this is
derived from IUnknown, there is no typelib or IDispatch etc
I need to write a simple VB.NET app in VB 2003 that can create the COM
object given the CLSID, get IStream and IPropertybag from that object
then set a couple of BSTR properties, and use that IStream to read.
Can someone give me the simplest code equivalent in VB.NET to the
following in c++ (simplified for clarity)?
// {77D4C560-6A25-44af-8DA5-44FDF9B2A154}
DEFINE_GUID(CLSID_XorEncryptor, 0x77d4c560, 0x6a25, 0x44af, 0x8d,
0xa5, 0x44, 0xfd, 0xf9, 0xb2, 0xa1, 0x54);
CoInitialize(0);
CComPtr<IUnknown> pCrypt;
pCrypt.CoCreateInstance(CLSID_XorEncryptor);
CComQIPtr<IPropertyBag> pProps(pCrypt);
CComQIPtr<IStream> pCryptStream(pCrypt);
pProps->Write(...);
pProps->Write(...);
pCryptStream->Seek(...);
pCryptStream->Read(...);
Thanks in advance
Vivek
I have a C++ com object that exposes IStream and IPropertyBag, this is
derived from IUnknown, there is no typelib or IDispatch etc
I need to write a simple VB.NET app in VB 2003 that can create the COM
object given the CLSID, get IStream and IPropertybag from that object
then set a couple of BSTR properties, and use that IStream to read.
Can someone give me the simplest code equivalent in VB.NET to the
following in c++ (simplified for clarity)?
// {77D4C560-6A25-44af-8DA5-44FDF9B2A154}
DEFINE_GUID(CLSID_XorEncryptor, 0x77d4c560, 0x6a25, 0x44af, 0x8d,
0xa5, 0x44, 0xfd, 0xf9, 0xb2, 0xa1, 0x54);
CoInitialize(0);
CComPtr<IUnknown> pCrypt;
pCrypt.CoCreateInstance(CLSID_XorEncryptor);
CComQIPtr<IPropertyBag> pProps(pCrypt);
CComQIPtr<IStream> pCryptStream(pCrypt);
pProps->Write(...);
pProps->Write(...);
pCryptStream->Seek(...);
pCryptStream->Read(...);
Thanks in advance
Vivek