New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Distributed Objects

by: Amelie Murphy

Distributed Objects CSE 775

Amelie Murphy
GPA 3.98

James Fawcett

Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

James Fawcett
Class Notes
25 ?




Popular in Course

Popular in Computer Engineering

This 33 page Class Notes was uploaded by Amelie Murphy on Wednesday October 21, 2015. The Class Notes belongs to CSE 775 at Syracuse University taught by James Fawcett in Fall. Since its upload, it has received 66 views. For similar materials see /class/225561/cse-775-syracuse-university in Computer Engineering at Syracuse University.


Reviews for Distributed Objects


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/21/15
mu I Ede gm Mew lnsevl Evmecl Em d 1m mm e p 15 hi a M w P 1 1 EV ELL JJ 5 11 m H 3 amasz mATLexecpp mpurt Damn m1 Emm mpDrl umdl m1 g ATLexe u SmArxcw amen m Sum2W uudD7AECEASrES3A41D378EDF7ABCEEEUDDDBD aadav Ha m M helpsmm IEum Interface m pulnteridefaultumlque um nterface ISum IUnknuwn Dumast Anew helpstnhg methcd Sum ix HRESULT Sumn nt x 111 nt y mu m a a a Extema DeDendenmes 39 Mum Anexeuh uudD7AECES74263AA1D378EDF7ABCEEEEIEIEIEIUU Mm m varsmnm u b dh helpstrn9 ATLexe 1 n Type Library ages 1 m Puwsmhmu library mmle a a SauvceF es i mm magnum smmesz uh m axe DE mparum smnlez uh E ATLaxaEx day m deaAac uudD7AECEAArEs3AAIDSrBEDFrABCEEEUUUUUU MAM helpsmna sn m ClasS HeadevF es llamas Sum El Huzumcn Fun a Exlema Dependenmes default nterface ISum Arum L baselsdh 39 m smArx h i Ll E asst El esuur Fderew 39 39 in 1 am Lung H mm m m mquot Lmncsn mu memw I m n M Ready 5me wauakand axQgg w zuw SlmWNulax um n a m mzxp mn u Ium y 1 as WIzFlamern classex 39G Mummy 3 39v EEhMxew o EEMWEWU cmawewn memele LBuuan dcT xa vuld CChlldV12w Wm ccmmv Onyamm CFalnLDC dcths devlce Dnbexb for palnblng CFDnL Johnny CRECL rem GetClenLR Lamprecl a Drawrexugn CSE791 fm7TrangleX gt n CPen pen Pen Cresceyenyssotl a Seleccobjeccamppen a MDVETD miTrlangleX x 296 0 CMalnFramex pliant CH fpManrgtGeLTDQQJE temp ltlt ltlt sew d1 SetTexLCuluNRGEQE CSE791 Distributed Objects OnMDuSEMD xptagma Once xenms JschR gt mun wanp Classes mummy ccmm 7 In Windows mgssagg and m Handlevs lm cla Etnaiv Ilnklng FWREDJPE axe r n erruts n Humans J2 gun Mew 1mquot med gum my mum 521p WHEN E amvEvu wmjmnmam 3 H Al m 1 r Aulama an r a 5mm medyau Ema nc udeWD Asuppa 1 Wm Wage my a me my yam d a ng D E tm vs msrr39 Dan32 MAI l if 5 39 a Rey 1V signum ggUmwlmm Ir 4 Imm m st Variant Discrirninated Union struct tagVARIANT unlon s t ruct it agVARIANT VARTYPE vt holds a VTi wReservedl WORD wReservedZ WORD wReserved3 unlon LONG lVal VT714 BYTE bVal VTiUIl SHORT lVal VT712 FLOAT fltVal VT7R4 D dblVal VT7R8 VARIANTiBOOL boolval VTiBOOL ivARIANTiBOOL bool obsolete SCODE scode VTiERROR CY cyVal VT CY DATE date VTiDATE BSTR bstrVal T7 STR IUnknown punkval VTi NO IDlSpatch pdlSpVal VTiDISPATCH SAFEARRAY parray v 7 AY pral VTiBYREFHTiUII SHORT pral VTiBYREFHTiIZ LONG pral VTiBYREFHTilll FLOAT pfltVal VTiBYREFHTiRll DO pdbl al VTiBYRENVTiRB VARIANTiBOOL pboolVal VTiBYREFHTiBOOL 7VARTANT7BOOL pbool obsolete SCODE pscode VTiBYREFHTiERROR CY pcyVal VTiBYR VT CY DATE pdate VTiBYRENVTiDATE BSTR pbstrVal VTiBYRENVTiBST IUnknown ppu kVal VTiBYREFWT N IDlspatch ppdlspVal VTiBYREFWTiDISPATCH S ARRA pparray VTiBYREN TiAR v RI pvarVal VTiBYRENVTLVARIANT PV ID yref Generlc B Ref R cVal VTill USHORT ulVal VTiUIZ ulVal VT7U14 T lntVal VTilNT UINT ulntVal VTiUINT DECIMAL pdecval VTiBYREFHTiDECIMAL HA pcVal VTiBYREFH 711 USHORT pulVal VTiBYREFHTiUIZ ULONG pulVal VTiBYREFHTiUIll IN plntVal VTiBYREFHTiINT UINT pulntVal VTiBYREFHTiUINT struct itagBRECORD used for UDT S ln VB PVOID pvRecord IRecOrdInfo pRecInfo VARIANTiNAMEill VTiRECORD RIANTiNAME 3 r i RIANTfNAMEfZ DECIMAL decVal 77VARTANT7NAME71 typedef VARIANT LPVARIANT typedef VARIANT VARIANTARG typedef VARIANT LPVARIANTARG Variant manipulation VariantChangeType Converts a variant to another type VariantChangeTypeEX Converts a variant to another type using a locale identi er LCID VariantClear Releases resources and sets a variant to VTiEMPTY VariantCopy Copies a variant VariantCopyInd Copies variants that may contain a pointer VariantInit Initializes a variant Data type conversion VariantChangeType Converts speci c types of variants to other variant types VariantChangeTypeEX Converts speci c types of variants to other variant types define define define define Variant access macros define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define define Variant Access Functions ViUNIONX y V7VTX ViRECORDINFOX ViRECORDX VilsBYREFX VilsARRAYX VilsVECTORX ViNONEX ViUIlX ViUIlREFX v712x V712REFX v714x V714REFX V7R4X V7R4REFX V7R8X ViRBREFX v711x VillREFX V7U12X ViUIZREFX ViUI4X ViUI4REFX VilNTX VilNTREFX ViUINTX ViUINTREFX vicyx V7CYREFX ViDATEX ViDATEREFX ViBSTRX ViBSTRREFX ViDISPATCHX ViDISPATCHREFX ViERRORX ViERRORREFX ViBOOLX ViBOOLREFX ViUNKNOWNX ViUNKNOWNREFX V7VARIANTREFX VBYREFX ViDECIMALX ViDECIMALREFX ViUNIONX ViUNIONX n2 n2 n2 n3Y Vt n3brecValpRecInfo n3brecValpvRecord iBYREF iARRAY 7VECTOR bVal pral iVal inal lVal pral fltVal pfltVal dblVal pdblVal CVal pcVal uiVal puiVal ulVal pulVal intVal pintVal uintVal puintVal cyVal pcyVal date pdate bstrVal pbstrVal pdispVal ppdispVal scode pscode boolVal pboolVal punkVal ppunkVal pvarVal parray pparraY byref decVal pdecVal typedef struct tagSAFEARRAY USHORT CDimS USHORT fFeatures ULONG chlements ULONG CLOCkS PVOID vaata SAFEARRAYBOUND rgsabound SAFEARRAY typedef struct tagSAFEARRAYBOUND ULO CE 1 ement s long LBound SAFEARRAYBOUND SafeAIrayAccessData SafeAIrayAllocData SafeArrayAllocDescriptor SafeAIrayCopy SafeAIrayCopyData SafeAIrayCreate SafeAirayCreateVector SafeAIrayDestroy SafeArrayDestroyData SafeAIrayDestroyDescriptor SafeAIrayGetDim Safe Array number of array dimensions used by safe array API size of each element count of current locks pOinter to data valid when cLocks gt O bounds for each dimensions number of elements in dimension dimensio lower bound usually zero Array manipulation Increments the lock count of an array and returns a pointer to array data Allocates memory for a safe array based on a descriptor created with SafeArrayAllocDescriptor Allocates memory for a safe array descriptor Copies an existing array Copies a source array to a target array after releasing source resources Creates a new array descriptor Creates a onedimensional array whose lower bound is always zero Destroys an array descriptor Frees memory used by the data elements in a safe array Frees memory used by a safe array descriptor Returns the number of dimensions in an array SafeArrayGetElement Retrieves an element of an array SafeArrayGetElemsize Returns the size of an element SafeAIrayGetLBound Retrieves the lower bound for a given dimension SafeAIrayGetUBoundRetrieves the upper bound for a given dimension SafeArrayLock Increments the lock count of an array SafeAirayPtrOflndeX Returns a pointer to an array element SafeArrayPutElement Assigns an element into an array SafeAirayRedim SafeArrayUnaccessData SafeArrayUnlock Resizes a safe array Frees a pointer to array data and decrements the lock count of the array Decrements the lock count of an array IDispatch Interface 0 ject uuid0002040000000000C000000000000046 pointeridefault unique interface IDispatch IUnknown typedef unique IDispatch LPDISPATCH HRESULT GetTypeInfoCount UINT pctinfo HRESULT GetTypeInfo UINT iTInfo in LCID lcid out ITypeInfo ppTInfo HRESULT GetIDSOfNames REFIID riid in size iscNames LPOLESTR rgszNames out sizeiiscNames DISPID rgDispId local HRESULT Invoke in DISPID dispIdMember in WORD wFlags in out DISPPARAMS pDispParams out VARIANT pVarResult out EXCEPINFO pExcepInfo out UINT puArgErr callias Invoke HRESULT Remotelnvoke in DISPID dispIdMember in REFIID riid i lcid i RD dwFlag i DISPPARAMS pDispParams out VARIANT pVarResult o t o t U E u EXCEPINFO pExcepInfo pArgErr in size7i5cVarRef UINT rgVarRefIdx out size7i5cVarRef VARIANTARG rgVarRef DISPPARAIVIS typedef struct tagDISPPARAMS sizeiiscArgs VARIANTARG rg rg size7i5cNamedArgs DISPID rgdispidNamedArgs UINT cArgS UINT cNamedArgS DISPP s typedef co EXCEPINFO EX CEPINFO struct tagEXCEPINFO w ode wReserved bstrSource bstrDescription An error code describing the error A source of the exception A description of the error bstrHelpFile Fully qualified drive path and file name deelpContext help context of topic Within the help file pvReser ed paneferredFillIn 5 de I TypeInfo J uuid0002040100000000C00000000000004 6 pointeridefault unique interface ITypeInfo IUnknown typedef unique ITypeInfo LPTYPEINFO local HRESULT GetTypeAttr out TYPEATTR ppTypeAttr callias GetTypeAttr HRESULT RemoteGetTypeAttr out LPTYPEATTR ppTypeAttr out CLEANLOCALSTORAGE pDummy HRESULT GetTypeComp out ITypeComp ppTComp local HRESULT GetFuncDesc in UINT index out FUNCDESC ppFuncDesc callias GetFuncDesc HRESULT RemoteGetFuncDesc in UINT index out LPF NCDESC ppFuncDesc out CLEANLOCALSTORAGE pDummy local HRESULT GetVarDesc n UINT index out VARDESC ppVarDesc callias GetVarDesc HRESULT RemoteGetVarDesc in UINT index out LPVARDESC ppVarDesc out CLEANLOCALSTORAGE pDummy local HRESULT GetNames in MEMBERID memid out size7i5cMaxNames lengthiis chamesH BSTR rngtrNames in UINT cMaxNames out UINT chames callias GetNames HRESULT RemoteGetNames n MEMBERID memid out size7i5cMaxNames lengthiis chamesH BSTR rngtrNames in UINT cMaxNames out U NT chames HRESULT GetRenypeOfImplType in INT in ex out HREFTYPE pRenype HRESULT GetImplTypeFlags in U NT inde x out INT p1mplTypeFlags I TypeInfo continued local HRESULT GetIDSOfNames 1n slze715cNames LPOLESTR rgszNames 1n UINT cNames out slze715cNames MEMBERID pMemId callias GetIDsOfNames HRESULT LocalGetIDsOfNames local HRESULT Invoke 1n PVOID pvlnstance 1n MEMBERID memld 11 out DISPPARAMS lespParams out VARIANT pVarResult out EXCEPINFO pEXcepInfo out UINT puArgErr callias Invoke HRESULT Locallnvoke local HRESULT GetDocumentatlon MEMBERID memld BSTR callias GetDocumentatlon HRESULT RemoteGetDocumentatlon EMBERID memld 1n WORD refPtrFlags out BSTR sztrName out BSTR sztrDocStrlng out DWORD pdeelpConteXt out BSTR sztrHelpFlle local HRESULT GetDllEntry 1n MEMBERID memld 1n INVOKEKIND lDVKlDd out BSTR sztrDllName out BSTR sztrName out WORD prrdlnal callias GetDllEntry HRESULT RemoteGetDllEn out BSTR sztrName out BSTR sztrDllName out WORD prrdlnal HRESULT GetRenypeInfo n HREFTYPE hRenype out ITypeInfo ppTInfo I TypeInfo continued local HRESULT AddressOfMember MEMBERID memld 1n INVO KIND lDVKlDd out PVOID ppv callias AddressOfMember HRESULT LocalAddressOfMember local HRESULT Createlnstance 1n IUnknown pUnkOuter 1n REFIID rlld out 11d715r11d PVOID pvabj callias Createlnstance HRESULT RemoteCreateInstance 1n REFIID rlld out 11d715r11d IUnknown pvabj HRESULT GetMops 1n MEMBERID memld out BSTR sztrMops local HRESULT GetContalnlngTypeL1b out ITypele ppTle out UINT plndex callias GetContalnlngTypele HRESULT RemoteGetContalnlngTypele out ITypele ppTle out UINT plndex local VOld ReleaseTypeAttr 1n TYPEATTR pTypeAttr callias ReleaseTypeAttr HRESULT LocalReleaseTypeAttr VOld local VOld ReleaseFuncDesc 1n FUNCDESC pFuncDesc call asReleaseFuncDesc HRESUET LocalReleaseFuncDesc VOld local VOld ReleaseVarDesc n VARDESC pVarDesc callias ReleaseVarDesc HRESULT LocalReleaseVarDesc IErrorInfo Interface 3 tr uuidlCFZBlZ0547DilOlB8E6508002B2BD119 pointeridefault unique interface IErrorInfo IUnknown typedef unique IErrorInfo LPERRORINFO HRESULT GetGUID out GUID pGUID HRESULT GetSource out BSTR sztrSource HRESULT GetDescription out BSTR sztrDescription HRESULT GetHelpFile ut BSTR sztrHelpFile HRESULT GetHelpContext o t DWORD pdeelpContext CreateErrorInfo Interface ect uuid22F03340547DilOlB8E6508002B2BD119 pointeridefault unique interface ICreateErrorInfo IUnknown typedef unique ICreateErrorInfo LPCREATEERRORINFO HRESULT SetGUID n REFGUID rguid HRESULT SetSource n LPOLESTR szSource HRESULT SetDescription LPOLESTR szDescription HRESULT SetHelpFile LPOLESTR szHelpFile HRESULT SetHelpContext n DWORD deelpContext ISupportErrorInfo Interface 3 Ct uuidDFOB3D60548FilOlB8E6508002B2BD119 pointeridefault unique interface ISupportErrorInfo IUnknown typedef unique ISupportErrorInfo LPSUPPORTERRORINFO HRESULT InterfaceSupportsErrorInfo REFIID riid clnsnll sual cu m M g q a a AIL math huuc39aw mg wnwmpp Wm mama m Sp w Wen rA39wlaw New a maxysmb mag My eady TDQEAM 39 Il aumm 39 l 39 r lrgw y quotMW IDL Syntax attribute statement name BaselnterfaceName attribute statementBlock attribute l Endpoint specifies a wellknown port on which servers of the interface listen 2 Helpstring human readable comment string e g helpstring this is a help string 3 Local generate header les only 7 stubs are not generated 4 Object identi es a custom COM interface 7 must be followed by a uuid 5 pointeridefault pointer attribute to be applied to an unattributed pointer specification 0 ptr full pointer functionality 0 ref a reference never null always points to valid storage can not be reset 0 unique can be null and can be reset but can not be used as aliases e g data referenced by the pointer is unique to the pointer 6 uuid text representation of a universally unique identifier 7 version specifies version ofthe interface eg versionll statement name 1 coclass specify a list of intefaces supported by a COM component 2 dispinterface generate an interface derived from idispatch used for automation 3 interface used to generate a COM interface 4 library generate a type library from the statement block 5 module defines a set of functions when generating a DLL 6 enum typedef struct union Clike language declarations used to describe interface parameters IDL Types Base Types IDL recognizes the types boolean byte char double oat hyper int long short small void wcharit These may be quali ed as signed or unsigned and you may declare pointers to any of these types Import Statement IDL allows you to import de nitions from other IDL les using statements like import wtypesidl wtypesidl is a system le that de nes many types used in windows and win32 programming eg VOID PVOID LPVOID WORD DWORD DWORDLONG LPWORD BYTE INT UINT SHORT USHORT LONG ULONG TRUE FALSE BOOL BOOLEAN CHAR UCHAR WCHAR TCHAR LPSTR LPWSTR LPTSTR LPCWSTR LPCTSTR OLECHAR LPOLESTR LPCOLESTR BSTR LPBSTR VARIANT DOUBLE FLOAT DATE FILETIME SYSTEMTIME SECURITYiATTRIBUTES GUID IID CLSID REFIID Decorations An IDL declaration looks like a C declaration except that it is embellished with decorations These are quali ers of the form in out inout string sizeiis These will be discussed in more detail when we cover strings and arrays Preprocessor MIDL runs the C preprocessor prior to compiling the IDL statements That means the include de ne and if macros are available in IDL and have the same meaning as in C Interfaces An interface de ned in IDL takes the form VP 4 0 object uuidXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX pointeridefaultunique interface IanInterface IUnknown HRESULT transformin long in long out retval long HRESULT getPropertyout long HRESULT setProperty in long The quali er object specifies that the interface belongs to a COM object uuidarg identifies its argument as the GUID associated with this interface pointeridefaultarg identifies its argument as the default type for unattributed pointers the unique argument describes the default pointer is having no aliases That is it can be null be set to any address but there will only be one pointer for any given memory allocation eg the pointer is unique The decorations on method parameters help COM marshal data efficiently and have the following meanings I in describes the parameter as sending data to the method but returning nothing I out declares the parameter to have no significant input value but will return data to the client I retval specifies that Visual Basic and Java implementations of this interface will send this data to the client as a method return type It has no signficance for C or C the value is returned as a side effect of the argument All user defined interface methods should return HRESULT to identify success or failure and failure mode Clients should test for success with the macros SUCEEDEDhr and FAILEDhr N W 0UTPROC3 Demonstrates Remoting Component makes no special provisions for remote access by client Component speci es oleautomation in IDL This declares the component will use typelibrary marshalling so no proxystub code is required Thus neither client machine nor component machine need register a proxy dll a This makes it easier for client to use component b However the interfaces now are restricted to automation types Client speci es a remote machine a Use CoCreateInstanceEx b Specify maching using COSERVERINFO c Use MULTIQI Structure to request multiple interfaces in one roundtrip Aim HE awe de Mew Insevt Emyect Md Lads Mndaw deb 5 5 H wu maeasvevw l mlw mm Hcsmng glybdmmm d is v mg m 5 w A 39 Strngcpp Implementatlon of CStrJng Jnclude stdafxh r AYLShm sclasses D EEW Jnclude ATLStrJngsh E NEW Jnclude Strngh Jnclude ltJostreamgt RESTRth SW uslng nemeepece std aeommg H VVMHBSWM wstrlng preflx e L component tt eh FYIBSTR quot PBS 9 a abde omcenumbedmwn csmng DHEEAE asth ecllREFELSD vc sxd EFHD r 2 DWEENEVSENEVU Sewn W n e u Eeneva Dehu mu Lmk Resume o DHUnmgxslevSeme W 320 h g I g l I z E Made dew be new 39 Pam s la membev vepvesenlahan VA d Revvesemahanme a a AEaseA wa squot geneyex unmaae vemesenldlmn 7 gnah e exceedquot handh Enab e m I quota we Tyne lnlmmahaquot RTTU A I39 Dwsah e Qansnuchan deD acemen PMs2A gangquot I3gtltZEldD NSZ VD A wwouwswnwacs m usmm Fp DehugATLSnmgsDch 1 need lt 39I E assWew I 5 Resaumerew F erew 4 Xl Cumplhng l ATLSLrlngs pp Strlng cbp e Prugram flesmrusuft Vlsual dDVc98nc d enabled Spec e Png am flesmrusuft Vlsual studuv98nludeustream enabled SPEEJ e Prugram flesmrusuft Vlsual studDVc98ncludeustream229 Einstreamltchar argt gt Puthar us studDvc98ncludeustream234 warnlng CASSU c exceptlun handler need but unwlnd semantlcs are nbc enabled Sbe v H 4 gt e Prugram flesmrusuft Vle Eu d m Fwyde 39W39 lim sja I smnqs 5 lt9g a 9 smw Stu 1d Estream547 warnlng CASSU c exceptlun handler uee dc unbln are nbc 234 warnlng CASSU c exceptlun handler need but unwlnd semantlcs are nbc whlle cumplllng eleeeecemblece member functlun class std has Reedy gammagrgmggga H1rhm IHMnrrcsues NSFD lmu m lm I m H He gun Mew 1mquot Bugged Budd 1m mm elp amv wll w wchwmam 3 Wang 1 am la MFE Annwvzard Sign a n he an m dy hm 1quot k E acumen we r39 Achygaswmgm39gnvam wma van Wk muvuvum Emma Na 5 Y m Kym wm ammuppau wm dyau hke minc39maex r WNW r An Ex hn s ck aw raw w l Jj Re w 315nm 933 U Tadaym ky Emma Ejpv sm m sm 99w V ijmr W Q zm acum imam J2 gun Mew mm mm gum 1m mm elp Me a a v M w wchwmw 3 a Ha was 4 am l AA whal sMe DVD cl Wau d yau ke G MFE39Slandavd r w m WWW hk wg nexalawumsl lzf wm W WF W m ed L r Asia san cayh ck my Dan32 M l Re dy 1315Ulmggmjmam I w swam 3ka chsm reg WT ijmr w wm n mq 5 g 153m5mw mm 7 Myquot v8 5 r Inme qu um La 1 g ka space WRempe w W est El Ext nal Dependenme mzempe axe r u grams xznclude ltlumanlpgt using namespace std magi imam mama new DEEUGJIEW xundes THISJTILE stat char THISJ ILEU Xendzi FILE CChnldVIEW CChnldVIEW CChzldeew mumpxayxouuy mammaymuuy Jansen u Jansen u Juangxexvm Juangxeymy mpCSLaLzDNULL CChnldVIEW NcchnldewO delete nipCSLaUDA EEGINJESSAGEJAHccmJame cum ABLMSGJ IAPtCCthanEW 0N ungaunounowm OILWLCREATM AFXM5GMAP ENDJ IESSAGEJIAH CCthdeew message handlers u warnngs CSE775 Distributed Objects Spring 2007 COM API Jim Fawcett and Mario Tayah CSE775 Distributed Objects Spring 2007 7142010 1 CSE775 Distributed Objects Spring 2007 DLL Functions Required of lnProcessServers Function Name What it does When it is used DIIRegisterServer Instructs an inprocess server to create registry entries for all classes supported in this server module Used by RegSrv32 to register component Tells COM runtime were to nd component when client calls COCreateInstanceEX DIIUnregisterServer Instructs an inprocess server to remove those entries created with Used by RegSrv32 u to remove registry entries created for this component with RegSrv32 DIIRegisterServer DllCanUnloadNow Determines whether This function is called periodically the dynamiclink by the COM API library DLL that implements this function is in use DllGetClassObject Called by COM When the Client calls runtime to retrieve a CoCreateInstance the COM runtime pointer to the calls CoGetClassObj ect which in component s class tum calls DllGetClassObject This factory function provided by each in process COM server creates the class factory and returns an IClassFactory pointer to COM COM then uses that to create an instance of the classes the server provides to implement its interfaces 7142010 2 CSE775 Distributed Objects Spring 2007 COM Functions Provided by COM API For Creating Server Objects Function Name What it Does When its Called CoGetClassObject Provides a pointer to Call CoGetClassObject directly the lClassFactory when you want to create multiple interface on a class objects through a class obj ect for factory associated with which there is a CLSID in the a speci ed CLSID system registry You can also CoGetClassObject retrieve a class object from a locates and if speci c remote machine Most class necessary dynamically objects implement the lClassFactory loads the DLL for an interface inprocess server CoCreateInstanceEX Creates an CoCreateInstanceEX allows you to uninitialized instance create an instance of a com object of a specific class on a on a remote machine instead of speci c machine calling CoGetClassobject to get the class obj ect and then calling the lClassFactory Createlnstance to create the instance and finally releasing the class Object CoCreateInstance Creates an Called by clients when they want to uninitialized instance access a COM component for the of a specific class on rst time the local machine 7142010 3 CSE775 Distributed Objects Spring 2007 Functions Provided by COM API For Initializing Objects Function Name What it Does When its Called CoGetInstanceFromFile Creates a new obj ect and initializes it from a le using IPersistFileL0ad Use this function instead of creating an instance with a call to CoCreateInstance followed by an initializing call to IPersistFileL0ad Because this is much faster handled by COM runtime COGetInstanceFromIStorage This function creates a new object and initializes it from a storage object through an internal call to IPersistStorage Load Use this function instead of creating an instance with a call to CoCreateInstanceEX followed by an initializing call to IPersistStorage Load Because this is much faster handled by COM runtime 7142010 CSE775 Distributed Objects Spring 2007 COM Functions Provided by COM API For Server ShutDown Function Name What it Does When its Called CoRevokeClassObject Informs COM that a class obj ect for an outofprocess component previously registered with the CoRegisterClassObject function is no longer available for use Call this function when the out0f process server has completed its activities and there is no need for a reference to the component s factory anymore CoFreeUnusedLibraries Unloads any DLLs that are no longer in use and that when loaded were specified to be freed automatically Normally called by COM runtime in response to a client s call of CoUnintializeO Applications can call CoFreeUnusedLibraries periodically to free resources It is most efficient to call it either at the top ofa message loop or in some idletime task DLLs that are to be freed automatically have been loaded with the bAutoFree parameter of the CoLoadLibrary function set to TRUE CoFreeUnusedLibraries internally calls DllCanUnloadNow for DLLs that implement and export that function 7142010 CSE775 Distributed Objects Spring 2007 Functions Provided by COM Servers Function Name What it Does When its Called IUnknown QueryInterface Given a pointer to a COM interface the function QueryInterface upports a request for another interface The function will call AddRef before returning the interface Often just after a component is created If you are not sure the component supports a given interface you ask CoCreateInstance to return an IUnknown pointer and you use that to see if the interface you want is available IUnknown AddRef Increments the component s reference count You call AddRef any time you return an interface pointer from one of your functions or you assign an uninitialized pointer the address of an existing interface pointer IUnknown Release Decrements the component s reference count You call Release anything you nish using an Interface Pointer Be very careful not to use that pointer for anything after calling Release IClassFactory CreateInstance Implemented in the class factory of a com object it creates an uninitialized object of this component Usually called by COM If you call CoGetClassObject you should then call the IClassFactory CreateInstance function to get an unitialized object of this component IClassFactoryLockServer Called by the client of a class object to keep a server open in memory allowing instances to be created more quickly Note that the server s objects will be destroyed as usual but the library will not be unloaded if its LockServer count is positive LockServer plays a role in EXE servers This is mainly used when the application needs to keep the reference to the factory in memory The usual com scenario goes as following 1 create an instance 2 increment the reference count 3 destroy the reference 4 decrease reference count 5 if ref count 0 9 remove from memory 7142010 CSE775 Distributed Objects Spring 2007 Now if you know that you will continuously use this factory you lock a reference to it by calling LockServerTRUE and the server will be locked and can only shut itself down when it receives the corresponding unlock call IClassFactory LockS erverFALS E 7142010 chlvejlcl a New F ChlldV12w em mplememeuen e the CChlldV12w class i rrg kaspace F NRempe w pm eclls a WReclpe llles Jhnclude E Q ceF n u e ltsstreamgt Jtlnclude lt1Dmanlpgt1 usmg namespace std E a Headev He He Eu EhMxewh E W e 7mm x eglne new DEE u Jtundef THISJTII stat char THISVFILEU fun Jtendlf CChlld hew ReadMem CChlldV12w CChnldewO Exemd Devendenmes CChlldV12w NCChnldV12w7 EEGINJESSAGEJchcmJdvewcund AFLuscjdmcchudvEm c ENDJ IESSAGEJIIAH unflguratlun rwkeclpe e bun n9 pp 52791D0C0DEFWRE1PEChldV12w DPPES error czns yx Use791DOCODEFWRe eChldVew Ep as error cznss m DnsplaVY uxefe x x ex 7 nsx error cznss DC STATICI c va mjnsple red den 1 er c 5 undeclared ldentlfler undeclared dentlfler


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Kyle Maynard Purdue

"When you're taking detailed notes and trying to help everyone else out in the class, it really helps you learn and understand the I made $280 on my first study guide!"

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.