Thread View: microsoft.public.vc.mfcole
1 messages
1 total messages
Started by rajinder.singh
Wed, 23 Sep 1998 00:00
ICreateTypeInfo2.SetCustData Example
Author: rajinder.singh
Date: Wed, 23 Sep 1998 00:00
Date: Wed, 23 Sep 1998 00:00
51 lines
2746 bytes
2746 bytes
I am using Delphi 4.0, running on Windows NT 4.0 SP3 to create type libraries
dynamically. In Delphi 4.0 when we create a MTSObject Using Delphi Wizard we
can set the Transaction Attributes for the object as a result of this the idl
of the CoClass of the object we create looks like this :
Sample = coclass(ISample [default] )
[ uuid '{EFFC96EE-52F5-11D2-84E6-0008C77C8C21}',
version 1.0,
helpstring 'jkdsflsd Object',
custom '{17093CC7-9BD2-11CF-AA4F-304BF89C0001}' 0 ];
custom '{17093CC7-9BD2-11CF-AA4F-304BF89C0001}' 0 : tells MTS that the
object Requires a New Transaction.
Since I am creating type library dynamically I need an example of using
function ICreateTypeInfo2.SetCustData ( refguid:TGUID; lpvarValue:POleVariant
);
I am getting an unknown error when I make this call. Here is a part of the
code I am using.
//////////////////////////////////////////////
// Create a ICreateTypeInfo for the CoClass
/////////////////////////////////////////////
rc := FParentCreateTypeLib.CreateTypeInfo(
StringToLPOLESTR(Self.FCoClassName),
TKIND_COCLASS, Self.FCreateTypeInfo
// Get the ICreateTypeInfo2 from ICreateTypeInfo Interface
Self.FCreateTypeInfo.QueryInterface(ICreateTypeInfo2,lCreateTypeinfo);
// lpvarValue is declared as
// lpvarValue : POleVariant;
New(lpVarValue);
lpVarValue^ := 0; Assign a value of 0 to it
// GUID sets the transaction attribute to Require a Transaction.
rc := lCreateTypeInfo.SetCustData(GUID_RequiresTransaction,lpvarValue);
The example can be in any language.
Thanks
Raj
‰
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads