![]() Now In order to set the general COM security level you must perform a call to the CoInitializeSecurity function.ĬoInitializeSecurity(nil, -1, nil, nil, RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_IMPERSONATE, nil, EOAC_NONE, nil) įWbemLocator.ConnectServer(strNetworkResource, strUser, strPassword, strLocale, WBEM_FLAG_CONNECT_USE_MAX_WAIT, strAuthority, nil, FWbemServices) If Succeeded(CoInitializeEx(nil, COINIT_MULTITHREADED)) then Microsoft recommends use the CoInitializeEx function with the COINIT_MULTITHREADED flag this unit called JwaWbemCli is part of the JEDI API Library Accessing the WMI using the COM Interface Note : the code showed in this article was tested in Delphi 2007, Delphi XE and FPC 2.4.2 and uses the WBEM Client interface Unit for Object Pascal which is an translation of the headers of the WbemCli.h file. ![]() The interfaces of the COM API for WMI are very similar to the Microsoft WMIScripting Library because the last is just a wrapper for the COM object. In the next sample you will learn how avoid this additional layer. In the next diagram you can see the layers to access the WMI, you can note how the WMIScripting finally access the WMI using the WMI COM API. in both cases you are using the same layer to access the WMI (WMIScripting). In the past articles always I show samples to use the WMI using late binding or importing the Microsoft WMIScripting Library. Themes support for Syntax highlighting (+50 themes included) compatible with the Delphi IDE Theme Editor.įor download the new version of the application and more details go to project pageĪ fellow Delphi programmer, ask me how they can access the WMI using the COM API for WMI, so I decide write this article to show how.įirst you must to know which this API was designed primarily for low level access to the WMI from C++ and for create WMI providers, compile mof files and so on.Runs on Windows XP, 2003, 2008, Vista and 7.Open the the generated Delphi Prism code directly in Visual Studio 2008, Visual Studio 2010 or MonoDevelop.Open the the generated Free Pascal code directly in the Lazarus IDE.Open the the generated Delphi code in any of these Delphi IDE’s 7, 2005, BDS/Turbo 2006 and RAD Studio 2007, 2009, 2010, XE.Compile and run the generated code directly form the application using the selected compiler.You can access directly from the application the MSDN web page related to the WMI Class which your are using.Full access to metadata of any WMI Class registered in the system including qualifiers, mof definition, properties, methods, events.Net (Oxygene) generated code is compatible with all the versions up to 4.0.23.741 (in newer versions must work too) The Free Pascal code generated is compatible with these versions 2.4.2, 2.4.4.The Delphi code generated is compatible with Delphi 7, 2005, BDS/Turbo 2006 and RAD Studio 2007, 2009, 2010, XE.Can generate object pascal code compatible with one of these compilers Delphi Win32, Delphi -Prism (Oxygene), Free Pascal.Now is time to show the results, so the new version is here with many new features, also the full source code is now available in the google code project hosting site under the Mozilla Public License 1.1Ĭheck the list of features of the current version In the last months I’ been working in a new version of the WMI Delphi Code Creator, porting the original code from Delphi 2007 to XE, adding new features like support for Delphi Prism and Free Pascal, and improving the source code generated by the tool. TStatusBar is a visible component on the Common Controls tab of the Component Palette that provides a status bar consisting of a single area SimpleText or a list of text-strings in its property Panels that will divide the status bar in two or more separate panels with own contents (text or owner-drawn).Update : The WMI Delphi Code Creator now is hosted on Github.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |