Skip to main content

Posts

Showing posts with the label COM

Creating a New Programming Language and Compiler

Recently I have been looking into a special need to create my own programming language. I have also studied the history of different languages and success and issues they are struggling and stuck with. Here is my personal point of view on this: Creating a Purely new Programming Language The best available language is C\C++ for a cross platform development with different compilers and debuggers. If you are thinking of creating a remarkable new language, HOLD ON,          1- You need to create a compile to target X86, X64, and ARM etc          2- Compiler shall work on Windows, Linux and MAC etc...          3- You need to revisit the entire history of programming language in this case and you have to port all that stuff          4- You Need IDE, compiler          5- Debugger ...

Exposing .NET Components to COM

Namespace: System.Runtime.CompilerServices Building .NET Components for use by COM .Net framework generates COM Proxies known as COM Callable Wrapper (CCW) to be used by COM. No matter how many COM clients consume a given managed object, .Net runtime will create a single CCW. Write down you class and before building it, Select the configuration form the project properties named “ Register for COM interop ”. Hiding public .NET Classes from COM To hide a class or member just use the following attribute: [ComVisible(true/false)] . Deploying COM-Enabled Assemblies :       Check the following necessaries before creating CCW: 1.        All class have default constructor (no parameter). 2.        Exposed Types should be public . 3.        Any member exposed should be public . 4.        Abstract classes will not b...

COM Interoperability in .NET

Namespace: System.Runtime.CompilerServices Why we need Interoperation? A company may have a large application that is already tested, verified, and is stable. And they are interested to use new technology while keeping the old at its position. Secondly, not every windows API has been wrapped in with .NET Framework. .Net provides ample support for COM interoperation to import and use type libraries. Runtime Callable Wrapper (RCW) is used to bridge the communication between the COM and .NET. Importing Type Libraries: There are two ways to Import libraries. 1.        Using Add Reference Feature in Visual Studio 2005 and selecting appropriate COM component. 2.        Using tlbimp.exe . In command prompt go to the location where your assembly is, then execute the command “ tlbimp.exe MyDll.dll [/out:ManagedMyDll.dll] In C# optional parameters are not supported , so if you want to pass somethi...

Detecting Management Events using .Net

Namespace: System.Management ConnectionOptions Specifies all settings required to make a WMI connection Authentication Gets or sets the COM authentication level to be used for operations in this connection. Authority Gets or sets the authority to be used to authenticate the specified user. Context  Gets or sets a WMI context object. This is a name-value pairs list to be passed through to a WMI provider that supports context information for customized operation. (Inherited from ManagementOptions.) EnablePrivileges Gets or sets a value indicating whether user privileges need to be enabled for the connection operation. This property should only be used when the operation performed requires a certain user privilege to be enabled (for example, a machine restart). Impersonation Gets or sets the COM impersonation level to be used for operations in this connection. Locale Gets...