Podobne
- Strona startowa
- Bruce Morris Adventure Guide Florida Keys & Everglades National Park (2005)
- The Career Survival Guide Dealing with Office Politics Brian OConnell
- True Magick A Beginner's Guide by Amber K (2003)
- Corel PHOTO PAINT 11 User Guide
- (Ross Enamait) The Underground Guide To Warrior Fitness
- Novell Netware 5 Advanced Admin Instructor guide
- White Stephen Program (2)
- Opis obyczajow za ponowania... Kitowicz
- May Karol Kozak (SCAN dal 966)
- Sagan Carl Kontakt (3)
- zanotowane.pl
- doc.pisz.pl
- pdf.pisz.pl
- mieszaniec.xlx.pl
Cytat
Do celu tam się wysiada. Lec Stanisław Jerzy (pierw. de Tusch-Letz, 1909-1966)
A bogowie grają w kości i nie pytają wcale czy chcesz przyłączyć się do gry (. . . ) Bogowie kpią sobie z twojego poukładanego życia (. . . ) nie przejmują się zbytnio ani naszymi planami na przyszłość ani oczekiwaniami. Gdzieś we wszechświecie rzucają kości i przypadkiem wypada twoja kolej. I odtąd zwyciężyć lub przegrać - to tylko kwestia szczęścia. Borys Pasternak
Idąc po kurzych jajach nie podskakuj. Przysłowie szkockie
I Herkules nie poradzi przeciwko wielu.
Dialog półinteligentów równa się monologowi ćwierćinteligenta. Stanisław Jerzy Lec (pierw. de Tusch - Letz, 1909-1966)
[ Pobierz całość w formacie PDF ]
." In your object s QueryInterface method, delegate calls for IDD_IMarshal to the free-threaded marshaler (stored as FMarshaler above).Warning The free-threaded marshaler violates the normal rules of COM marshaling to provideadditional efficiency.It should be used with care.In particular, it should only beaggregated with free-threaded objects in an in-process server, and should only beinstantiated by the object that uses it (not another thread).43-8 Devel oper s Gui deDe f i n i n g a COM o b j e c t s i n t e r f a c eWriting an object that supports the apartment threading modelTo implement the (single-threaded) apartment threading model, you must follow afew rules:" The first thread in the application that gets created is COM s main thread.This istypically the thread on which WinMain was called.This must also be the lastthread to uninitialize COM." Each thread in the apartment threading model must have a message loop, and themessage queue must be checked frequently." When a thread gets a pointer to a COM interface, that pointer may only be used inthat thread.The single-threaded apartment model is the middle ground between providing nothreading support and full, multi-threading support of the free threading model.Aserver committing to the apartment model promises that the server has serializedaccess to all of its global data (such as its object count).This is because differentobjects may try to access the global data from different threads.However, the object sinstance data is safe because the methods are always called on the same thread.Typically, controls for use in Web browsers use the apartment threading modelbecause browser applications always initialize their threads as apartment.Writing an object that supports the neutral threading modelUnder COM+, you can use another threading model that is in between free threadingand apartment threading: the neutral model.Like the free-threading model, thismodel allows multiple threads to access your object at the same time.There is noextra marshaling to transfer to the thread on which the object was created.However,your object is guaranteed to receive no conflicting calls.Writing an object that uses the neutral threading model follows much the same rulesas writing an apartment-threaded object, except that you do need to guard instancedata against thread conflicts if it can be accessed by different methods in the object sinterface.Any instance data that is only accessed by a single interface method isautomatically thread-safe.Defining a COM object s interfaceWhen you use a wizard to create a COM object, the wizard automatically generates atype library (unless you specify otherwise in the COM object wizard).The typelibrary provides a way for host applications to find out what the object can do.It alsolets you define your object s interface using the Type Library editor.The interfacesyou define in the Type Library editor define what properties, methods, and eventsyour object exposes to clients.Note If you selected an existing interface in the COM object wizard, you do not need toadd properties and methods.The definition of the interface is imported from the typelibrary in which it was defined.Instead, simply locate the methods of the importedinterface in the implementation unit and fill in their bodies.Cr eat i ng s i mpl e COM s er v er s 43-9De f i n i n g a COM o b j e c t s i n t e r f a c eAdding a property to the object s interfaceWhen you add a property to your object s interface using the Type Library editor, itautomatically adds a method to read the property s value and/or a method to set theproperty s value.The Type Library editor, in turn, adds these methods to yourimplementation class, and in your implementation unit creates empty methodimplementations for you to complete.To add a property to your object s interface,1 In the type library editor, select the default interface for the object.The default interface should be the name of the object preceded by the letter I.To determine the default, in the Type Library editor, choose the CoClass andImplements tab, and check the list of implemented interfaces for the one marked, Default
[ Pobierz całość w formacie PDF ]