15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


MFC / ODBC / Structured Storage Question

Deirdre Collins -- deirdre@technicon.com
Wednesday, February 05, 1997

Environment: VC++ 4.2b, Win 95, NT 4.0

I'm using the MFC ODBC classes to access my database.  One of the fields
in this ACCESS database is of type OLE Object, which can be loaded as a
CLongBinary or a CByteArray object.  The content of this field is an OLE
Doc Object eg a Word or Excel Document, which is fundamentally in
Structured Storage format.  I can activate and manipulate these objects
by passing their IStorage to the COleClientItem, as I am already doing
for documents not stored in the database.

My question is - how do I get the Storage Interface of the OLE Object
from the CLongBinary or CByteArray that gets loaded from the database?

Also does anyone have any sample code on how to define an SNB (String
Named Buffer) for use in Opening/Copying IStorage contents?  The MSDN
information is somewhat obscure.

Thanks,
Deirdre Collins.



Deirdre Collins -- deirdre@technicon.com
Saturday, February 08, 1997

Hi Klaus -=20

Thanks for your suggestion.  Have you had any success with this?
I've tried it but get STG_E_FILEALREADYEXISTS from the
StgCreateDocfileOnILockBytes.  In fact, if I run StgIsStorageILockBytes
on the ILockBytes it returns FALSE!  I also tried
StgOpenStorageOnILockBytes but get the same result.
I've been on to Microsoft, but with no success yet...
They seemed to think that the OLE Object in the DB may contain some
header information - which would explain why StgIsStorageILockBytes
would fail.  But they weren't sure about this..
I'd appreciate any further information you or anyone else may have on
this as it's a critical issue for me right now.

Thanks,
Deirdre.

>-----Original Message-----
>From:	Klaus G=FCtter [SMTP:KG@it-gmbh.de]
>Sent:	Saturday, February 08, 1997 10:33 AM
>To:	Deirdre Collins; 'mfc-l@netcom.com'
>Subject:	AW: MFC / ODBC / Structured Storage Question
>
>Deirdre,
>
>you could do the following:
>*	first create an ILockBytes object in memory using
>CreateILockBytesOnHGlobal
>*	the create a stream on this using StgCreateDocfileOnILockBytes
>
>- Klaus
>>----------
>>Von: 	Deirdre Collins[SMTP:deirdre@technicon.com]
>>Gesendet: 	Donnerstag, 6. Februar 1997 02:33
>>An: 	'mfc-l@netcom.com'
>>Betreff: 	MFC / ODBC / Structured Storage Question
>>
>>Environment: VC++ 4.2b, Win 95, NT 4.0
>>
>>I'm using the MFC ODBC classes to access my database.  One of the =
fields
>>in this ACCESS database is of type OLE Object, which can be loaded as =
a
>>CLongBinary or a CByteArray object.  The content of this field is an =
OLE
>>Doc Object eg a Word or Excel Document, which is fundamentally in
>>Structured Storage format.  I can activate and manipulate these =
objects
>>by passing their IStorage to the COleClientItem, as I am already doing
>>for documents not stored in the database.
>>
>>My question is - how do I get the Storage Interface of the OLE Object
>>from the CLongBinary or CByteArray that gets loaded from the database?
>>
>>Also does anyone have any sample code on how to define an SNB (String
>>Named Buffer) for use in Opening/Copying IStorage contents?  The MSDN
>>information is somewhat obscure.
>>
>>Thanks,
>>Deirdre Collins.
>>




Become an MFC-L member | Вернуться в корень Архива |