醉里乾坤大,壶中日月长

VixCom.dll vs Vix.dll

上一篇 / 下一篇  2009-10-11 11:04:17

Click to view mxyz's profile Novice mxyz 8 posts since
Dec 20, 2007
Hello,

I am a bit confused by the dlls that Vix API provides and what to use/reference in my program.

I have installed VIX API from http://www.vmware.com/download/eula.do (VIX API for Window 32-bit and 64-bit).

I am using Visual Studio 2005. When i go to the references for my project, all i see is "VixCom 1.0 Type Library" which points to VixCom.dll and not Vix.dll

This VixCom.dll is at version 1.0.0.1

Does this sound right? I need to point to Vix dll that is at version 1.0.4

What is VixCom.dll? Why is the library packaged with VixCom.dll and not Vix.dll?

All i want to know is, am I missing anything here?

My program keeps crashing when i try to loop through several VM images (to boot the images), hence the above question.

Thanks for any input.

MXYZ

Reply Re: VixCom.dll vs Vix.dll Feb 7, 2008 11:26 PM
Click to view mattrich's profile Expert mattrich 485 posts since
Nov 29, 2006
VMware
The COM library for the VIX API is exposed in a separate DLL, VixCOM.dll which manages multiple versions of VIX. If you notice, there are multiple vix.dll's in different directories in the VIX install directory. VixCOM.dll handles loading the correct implementation of VIX based on the product and version.

There isn't a VIX release 1.0.4, are you referring to VMware Server?

Can you give some more details about the crash you are seeing? If possible, could you post the source code that causes the crash?

TAG:

逍遥客 引用 删除 xiaoyaoke   /   2009-10-12 14:35:34
加上-i参数,可以得到python code

VixCOM 1.0 Type Library
{7A474EE3-0062-4239-AE91-134AC9BD5FD3}, lcid=0, major=1, minor=0
>>> # Use these commands in Python code to auto generate .py support
>>> from win32com.client import gencache
>>> gencache.EnsureModule('{7A474EE3-0062-4239-AE91-134AC9BD5FD3}', 0, 1, 0)
逍遥客 引用 删除 xiaoyaoke   /   2009-10-12 14:26:02
To generate Python Sources supporting a COM object
Example using Microsoft Office 97.
Either:
•        Run 'win32com\client\makepy.py' (eg, run it from the command window, or double-click on it) and a list will be presented. Select the Type Library 'Microsoft Word 8.0 Object Library'
•        From a command prompt, run the command 'makepy.py "Microsoft Word 8.0 Object Library"' (include the double quotes). This simply avoids the selection process.
•        If you desire, you can also use explicit code to generate it just before you need to use it at runtime. Run 'makepy.py -i "Microsoft Word 8.0 Object Library"' (include the double quotes) to see how to do this.
And that is it! Nothing more needed. No special import statements needed! Now, you simply need say
>>> import win32com.client
>>> w=win32com.client.Dispatch("Word.Application")
>>> w.Visible=1
>>> w
<win32com.gen_py.Microsoft Word 8.0 Object Library._Application>
Note that now Python knows the explicit type of the object.
Using COM Constants
Makepy automatically installs all generated constants from a type library in an object called win32com.clients.constants. You do not need to do anything special to make these constants work, other than create the object itself (ie, in the example above, the constants relating to Word would automatically be available after the w=win32com.client.Dispatch("Word.Application") statement.
For example, immediately after executing the code above, you could execute the following:
>>> w.WindowState = win32com.client.constants.wdWindowStateMinimize
and Word will Minimize.
逍遥客 引用 删除 xiaoyaoke   /   2009-10-11 11:38:28
VixCOM.Constants problem in VBScript
Mar 19, 2008 6:29 AM
Click to view TomRichardson's profile Lurker TomRichardson 1 posts since
Mar 19, 2008
I've been trying to write some code to create snapshots of virtual machines (in VBScript). When I use the code sample from the VIX COM API Reference, I get an "Object Required: 'VixCom.Constants'" error. My main machine is Vista, but I tried the same thing on an XP machine just to make sure that wasn't the problem, and received the same error there. I can successfully created instances of VixCOM.VixLib. I also thought perhaps the API hadn't installed correctly, but if I fire up Visual Studio, I can access VixCOM.Constants without any issue. Does anyone have any suggestions on how I can resolve this? My current workaround is to get the values of all the constants from a VB progam and then hard code them into the script, which will eventually bite me, I'm sure.
Reply Re: VixCOM.Constants problem in VBScript Mar 31, 2008 6:07 PM
Click to view mattrich's profile Expert mattrich 485 posts since
Nov 29, 2006 VMware
Reply 1. Re: VixCOM.Constants problem in VBScript Mar 31, 2008 6:07 PM
Are you trying to run the .vbs script directly? You will need to create a .wsf script to invoke the .vbs script. This will ensure that the constants are loaded for the VBScript environment.

The sample code that ships with the VIX installer should give an example .wsf and .vbs pair of files.
 

评分:0

我来说两句

Open Toolbar