Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
Search the Tips

Com-plus - Page 3

41-60 of 116     Previous     Next
Avoiding Access Denied erros when raising events from MTS objects
by Enrico Sabbadin
If you don't take specific actions, you get an Access Denied Error when you try to raise an event from an MTS component into a client. This happens because the client executable doesn't have the proper DCOM security settings to let the server call it back. In order to have it working you have ...
Don't let binary compatibility beat you
by Enrico Sabbadin
When you decide to release a new version of an MTS/COM+ component you should take care of its compatibility with the previous version. There are three types of changes you could make: (1) You change only internal code of a component, keeping the interface that the component provides ...
Don't store object variables in the SPM
by Enrico Sabbadin
Some MTS/COM+ newbies wonder whether it is legal to store object variables in the SPM. No, you can't!! the SPM is unaware of Apartment marshaling issues. If you ask the SPM for an interface pointer while running in an apartment that is different from the one where the interface pointer ...
Don't use global variables in MTS/COM+ projects
by Enrico Sabbadin
Public variables at module level are thread specific. Each new thread starts get a new fresh & uninitialized copy of such variables. All the activities that are born from the same object context always run in the same apartment (You can confirm this by checking the thread ID) as if the object ...
Misconceptions on variables and binding
by Enrico Sabbadin
Consider this line of code: Dim x as Project1.Class1 Many developers think that we were declaring x as a "Project1.Class1" object. This is wrong. All object variables in VB are interface variables. In this line of code x is declared as the _Class1 interface defined in ...
Never use New to create MTS/COM+ objects
by Enrico Sabbadin
A common question among VB developers is: Why is it dangerous the use of the New keyword in VB to create COM objects registered under MTS/COM+? The New keyword is the only way to go when you want to create objects that are defined as PublicNotCreatable or Private (CreateObject doesn't ...
The best setting for the RunAs option in a server package
by Enrico Sabbadin
When you deploy COM objects in DLLs no security issues arise since DLLs run in the process of the caller. On the contrary, when you deploy your COM objects into an .EXE, you have to deal with such issues. - (D)COM needs to know under what security principal (read identity) the process, ...
IsComDll - Check whether a DLL is a self-registering COM server
by Francesco Balena
Check whether a DLL is an COM self-registering server
GetFileFromCLSID - The file that implements a COM component with given CLSID
by Francesco Balena
Get the name of the DLL or EXE that contains the class whose CLSID is passed as an argument Note: Remote servers aren't taken into account
GetFileFromProgID - The file that implements a COM component with given ProgID
by Francesco Balena
Get the name of the DLL or EXE that contains the class whose ProgID is passed as an argument Remote servers aren't taken into account NOTE: Requires GetRegistryValue
Reduce activation delays by sorting DCOM protocol list properly
by Francesco Balena
When the client and the server machine have different communication protocol lists you can experience serious delays when the client tries to instantiate an object on the server, and you can even get an error if the two protocol lists don't have any protocol in common. For best response ...
C++ Exceptions Will Not Cross COM Boundaries
by Rajesh Chathapuram
When writing a COM object using C++, care should be taken to ensure that all C++ exceptions generated by the code are handled within the call itself. If any C++ exception is not handled, the ...
Using CoInitialize()
by Rajesh Chathapuram
CoInitialize() should be called for each thread in the application that makes COM calls. Not just once at application startup.
Make a phone call using TAPI
by Francesco Balena
If TAPI libraries are installed on your machine, you can easily dial a number from a VB application using a single API call. Here's a function that encapsulates the call and that returns True if the dialing was successful: Private Declare Function tapiRequestMakeCall Lib "TAPI32.DLL" ...
Pass the hidden Global object to an ActiveX DLL
by Francesco Balena
An ActiveX DLL doesn't have direct access to the environment of the calling EXE. For example, the App and Printer objects in the DLL don't correspond to the objects with the same name in the main application, therefore if you want to print something from the DLL using the same settings as the ...
Registering Custom Interfaces
by Boris Eligulashvili
When the object exposes the custom interfaces via standard marshalling, the proxy\stub DLL is required for marshalling data across the thread\processes\computer boundaries.
GetClasses - Enumerate all the classes defined in a type library
by Alberto Falossi
Return a collection with all creatable classes of the type library specified in TypeLibFile. Set IncludeNotCreatableClasses = True to include not creatable classes (that is, those with Instancing property set to PublicNotCreatable) too. Be sure that "TypeLib Information" type library (TlbInf32.
GetClassesByInterface - Retrieve all the classes that implement a given interface
by Alberto Falossi
Return all classes of the type library specified in TypeLibFile parameter that support a certain interface. the interface can be specified as an Object or through its IID Be sure that "TypeLib Information" type library (TlbInf32.tlb) is referenced in your VB project.
GetClassesByMember - Retrieve the list of classes that expose a given property or method
by Alberto Falossi
return a collection with names of all the class names of a type library that implement a certain member. MEMBERNAME is the name of the property or method MEMBERTYPE is the type of the member (vbGet, vbLet, vbSet, vbMethod). You can specify multiple types by ORing these constants Example:
GetObjectGUID - Retrieve the GUID of a COM object
by Alberto Falossi
Return the GUID of the object specified in the first parameter Be sure that "TypeLib Information" type library (TlbInf32.tlb) is referenced in your VB project.
41-60 of 116     Previous     Next
Sitemap