<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/clearspace/rss" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>VMware Communities: Message List - VixCom/VIX VMWare Server Exceptions: GetErrorText and Connect</title>
    <link>http://communities.vmware.com/community/developer/forums/automationapi?view=discussions</link>
    <description>Most recent forum messages</description>
    <language>en</language>
    <pubDate>Mon, 21 May 2007 19:38:32 GMT</pubDate>
    <generator>Clearspace 1.10.12 (http://jivesoftware.com/products/clearspace/)</generator>
    <dc:date>2007-05-21T19:38:32Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>Re: VixCom/VIX VMWare Server Exceptions: GetErrorText and Connect</title>
      <link>http://communities.vmware.com/message/650022?tstart=0#650022</link>
      <description>This also solved my problem with Visual C++, unfortunately not DevC++&lt;br /&gt;
&lt;b&gt;The C code connect example&lt;/b&gt;&lt;br /&gt;
[code]&lt;br /&gt;
#include "stdafx.h"&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;vix.h&amp;gt; &lt;br /&gt;
&lt;br /&gt;
int _tmain(int argc, _TCHAR* argv[])&lt;br /&gt;
{&lt;br /&gt;
	VixHandle jobHandle = VIX_INVALID_HANDLE;&lt;br /&gt;
	VixHandle hostHandle = VIX_INVALID_HANDLE;&lt;br /&gt;
&lt;br /&gt;
	VixError err = VIX_OK;&lt;br /&gt;
&lt;br /&gt;
	jobHandle = VixHost_Connect(1,VIX_SERVICEPROVIDER_VMWARE_SERVER,NULL,0,NULL,NULL,0,VIX_INVALID_HANDLE,NULL,NULL);&lt;br /&gt;
&lt;br /&gt;
	err = VixJob_Wait(jobHandle,&lt;br /&gt;
	VIX_PROPERTY_JOB_RESULT_HANDLE,&lt;br /&gt;
	&amp;#38;hostHandle,&lt;br /&gt;
	VIX_PROPERTY_NONE);&lt;br /&gt;
&lt;br /&gt;
	if (VIX_OK != err) {&lt;br /&gt;
		printf("\nError: %i",err);&lt;br /&gt;
		printf("\n%s\n",Vix_GetErrorText(err,NULL));&lt;br /&gt;
		goto abort;&lt;br /&gt;
	} else {&lt;br /&gt;
		printf("connection success!\n");&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	Vix_ReleaseHandle(jobHandle);&lt;br /&gt;
&lt;br /&gt;
abort: &lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;p /&gt;
[/code]</description>
      <pubDate>Mon, 21 May 2007 19:38:32 GMT</pubDate>
      <author>zerovoid</author>
      <guid>http://communities.vmware.com/message/650022?tstart=0#650022</guid>
      <dc:date>2007-05-21T19:38:32Z</dc:date>
      <clearspace:dateToText>2 years, 6 months ago</clearspace:dateToText>
    </item>
    <item>
      <title>Re: VixCom/VIX VMWare Server Exceptions: GetErrorText and Connect</title>
      <link>http://communities.vmware.com/message/650017?tstart=0#650017</link>
      <description>Wonderful thanks...&lt;br /&gt;
For anyone using the code above...&lt;br /&gt;
Set the version to 1 and be sure to assign the propertyIDs as an array.&lt;br /&gt;
&lt;br /&gt;
eg (VB).&lt;br /&gt;
       job = VixLibA.Connect(1, VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_SERVER, Nothing, Nothing, Nothing, Nothing, 0, Nothing, Nothing)&lt;br /&gt;
&lt;p /&gt;
        Dim propertyIDS() As Object = {VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE}&lt;br /&gt;
&lt;br /&gt;
        Dim err = job.Wait(propertyIDS, results)</description>
      <pubDate>Mon, 21 May 2007 19:35:04 GMT</pubDate>
      <author>zerovoid</author>
      <guid>http://communities.vmware.com/message/650017?tstart=0#650017</guid>
      <dc:date>2007-05-21T19:35:04Z</dc:date>
      <clearspace:dateToText>2 years, 6 months ago</clearspace:dateToText>
    </item>
    <item>
      <title>Re: VixCom/VIX VMWare Server Exceptions: GetErrorText and Connect</title>
      <link>http://communities.vmware.com/message/649974?tstart=0#649974</link>
      <description>Similar to the response that my colleague gave in the thread "VixHost_Connect Problem", the issue that there is a version mismatch issue.&lt;br /&gt;
&lt;br /&gt;
Error code 6 is 'not supported'. &lt;br /&gt;
&lt;br /&gt;
You're having an exception when you call GetErrorText() because when Connect() failed, not all of the required libraries were loaded, so VIX is having difficulties looking up the error string. We're looking into ways to make sure that this doesn't happen in future releases.&lt;br /&gt;
&lt;br /&gt;
You should be able to get this to work by explicitly passing 1 as the first argument to Connect().&lt;br /&gt;
&lt;br /&gt;
Just to be clear, only functions from the version 1.0 of the VIX API are supported with VMware Server.</description>
      <pubDate>Mon, 21 May 2007 19:01:20 GMT</pubDate>
      <author>mattrich</author>
      <guid>http://communities.vmware.com/message/649974?tstart=0#649974</guid>
      <dc:date>2007-05-21T19:01:20Z</dc:date>
      <clearspace:dateToText>2 years, 6 months ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>Re: VixCom/VIX VMWare Server Exceptions: GetErrorText and Connect</title>
      <link>http://communities.vmware.com/message/649927?tstart=0#649927</link>
      <description>I would like to also mention this is a 32bit environment.&lt;br /&gt;
This forum needs an edit post function.</description>
      <pubDate>Mon, 21 May 2007 18:19:41 GMT</pubDate>
      <author>zerovoid</author>
      <guid>http://communities.vmware.com/message/649927?tstart=0#649927</guid>
      <dc:date>2007-05-21T18:19:41Z</dc:date>
      <clearspace:dateToText>2 years, 6 months ago</clearspace:dateToText>
    </item>
    <item>
      <title>VixCom/VIX VMWare Server Exceptions: GetErrorText and Connect</title>
      <link>http://communities.vmware.com/message/649925?tstart=0#649925</link>
      <description>This post has a few questions.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;What is error code 6 when trying to connect?&lt;/b&gt;&lt;br /&gt;
           I get this error returned in everything C, C#, VB, VBScript/WSH, Perl&lt;br /&gt;
&lt;b&gt;Why am I having these exceptions in VixCom for GetErrorText?&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Why do my programs crash when compiled with DevC++ and VC++2005 but run fine with VC++6&lt;/b&gt; (except error 6 returned)&lt;b&gt;?&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Is this a bug in VixCom/Vix?&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Has anyone had any luck with VixCom or Vix on VMWare Server?&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;If yes, can you please post your code or a link to a project source?&lt;/b&gt;&lt;br /&gt;
			Language is not a problem as long as it uses VIX.&lt;br /&gt;
			The other APIs do not support some of the functionality I am seeking.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Environment:&lt;/b&gt;&lt;br /&gt;
WinXPSP2&lt;br /&gt;
VMWare Server 1.0.3 (even though it has been tried on older versions and different machines)&lt;br /&gt;
Vix API 1.1&lt;br /&gt;
Tried in various languages (C#, VB, VBScript, C)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Visual C Sharp (C#)&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;C Sharp (C#) Code&lt;/b&gt;&lt;br /&gt;
Source at &lt;a class="jive-link-external" href="http://www.buriproject.info/vix/c%20sharp%20GetErrorText.7z"&gt;http://www.buriproject.info/vix/c%20sharp%20GetErrorText.7z&lt;/a&gt;&lt;br /&gt;
[code]&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using VixCOM;&lt;br /&gt;
&lt;br /&gt;
namespace VIXTest&lt;br /&gt;
{&lt;br /&gt;
    class Program&lt;br /&gt;
    {&lt;br /&gt;
        static void Main(string[] args)&lt;br /&gt;
        {&lt;br /&gt;
            VixCOM.VixLib lib = new VixCOM.VixLib();&lt;br /&gt;
            Console.WriteLine("Connecting...");&lt;br /&gt;
            VixCOM.IJob job = lib.Connect(VixCOM.Constants.VIX_API_VERSION, VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_SERVER, "", 0, "", "", 0, null, null);&lt;br /&gt;
            object[] data = { VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE };&lt;br /&gt;
            object results = null;&lt;br /&gt;
            ulong err = job.Wait((VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE), ref results);&lt;br /&gt;
&lt;br /&gt;
            if (lib.ErrorIndicatesFailure(err))&lt;br /&gt;
            {&lt;br /&gt;
                ushort errCode = lib.ErrorCode(err);&lt;br /&gt;
                string errMsg;&lt;br /&gt;
                   errMsg = lib.GetErrorText(err, null);&lt;br /&gt;
&lt;p /&gt;
                Console.WriteLine("Error: " + errCode.ToString() + " : " + errMsg);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            exit(true);&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
       static void exit()&lt;br /&gt;
       {&lt;br /&gt;
           exit(false);&lt;br /&gt;
       }&lt;br /&gt;
       static void exit(bool prompt)&lt;br /&gt;
       {&lt;br /&gt;
           if (prompt)&lt;br /&gt;
           {&lt;br /&gt;
               Console.Write("Press Any Key To Exit");&lt;br /&gt;
               Console.ReadKey();&lt;br /&gt;
           }&lt;br /&gt;
           System.Environment.Exit(-1);&lt;br /&gt;
       }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
[/code]&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;C Sharp(C#) Error ScreenShot&lt;/b&gt;&lt;br /&gt;
&lt;a class="jive-link-external" href="http://www.buriproject.info/vix/c%20sharp%20GetErrorText.png"&gt;http://www.buriproject.info/vix/c%20sharp%20GetErrorText.png&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Error Text&lt;/b&gt;&lt;br /&gt;
[code]&lt;br /&gt;
System.Runtime.InteropServices.COMException was unhandled&lt;br /&gt;
  Message="The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))"&lt;br /&gt;
  Source="Interop.VixCOM"&lt;br /&gt;
  ErrorCode=-2147417851&lt;br /&gt;
  StackTrace:&lt;br /&gt;
       at VixCOM.VixLibClass.GetErrorText(UInt64 err, String locale)&lt;br /&gt;
       at VIXTest.Program.Main(String[] args) in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\VIXTest\VIXTest\Program.cs:line 23&lt;br /&gt;
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)&lt;br /&gt;
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)&lt;br /&gt;
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()&lt;br /&gt;
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)&lt;br /&gt;
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)&lt;br /&gt;
       at System.Threading.ThreadHelper.ThreadStart()&lt;br /&gt;
[/code]&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Visual Basic (VB)&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;VB Code&lt;/b&gt;&lt;br /&gt;
Source at &lt;a class="jive-link-external" href="http://www.buriproject.info/vix/vb%20GetErrorText.7z"&gt;http://www.buriproject.info/vix/vb%20GetErrorText.7z&lt;/a&gt;&lt;br /&gt;
[code]&lt;br /&gt;
Public Class Form1&lt;br /&gt;
&lt;br /&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
&lt;br /&gt;
        Dim VixLibA As New VixCOM.VixLib&lt;br /&gt;
        Dim job = VixLibA.Connect(VixCOM.Constants.VIX_API_VERSION, VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_SERVER, Nothing, Nothing, Nothing, Nothing, 0, Nothing, Nothing)&lt;br /&gt;
        Dim results = Nothing&lt;br /&gt;
        Dim err = job.Wait((VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE), results)&lt;br /&gt;
        If VixLibA.ErrorIndicatesFailure(err) Then&lt;br /&gt;
            Dim errMsg = VixLibA.GetErrorText(err, Nothing)&lt;br /&gt;
            MsgBox("Error: " &amp;#38; err.ToString() &amp;#38; " : " &amp;#38; errMsg)&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
[/code]&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;VB Error ScreenShot&lt;/b&gt;&lt;br /&gt;
&lt;a class="jive-link-external" href="http://www.buriproject.info/vix/vb%20GetErrorText.png"&gt;http://www.buriproject.info/vix/vb%20GetErrorText.png&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;VB Error Text&lt;/b&gt;&lt;br /&gt;
[code]&lt;br /&gt;
System.AccessViolationException was unhandled&lt;br /&gt;
  Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."&lt;br /&gt;
  Source="Interop.VixCOM"&lt;br /&gt;
  StackTrace:&lt;br /&gt;
       at VixCOM.VixLibClass.GetErrorText(UInt64 err, String locale)&lt;br /&gt;
       at VixCom_Test.Form1.Form1_Load(Object sender, EventArgs e) in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\VixCom Test\VixCom Test\Form1.vb:line 10&lt;br /&gt;
       at System.EventHandler.Invoke(Object sender, EventArgs e)&lt;br /&gt;
       at System.Windows.Forms.Form.OnLoad(EventArgs e)&lt;br /&gt;
       at System.Windows.Forms.Form.OnCreateControl()&lt;br /&gt;
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)&lt;br /&gt;
       at System.Windows.Forms.Control.CreateControl()&lt;br /&gt;
       at System.Windows.Forms.Control.WmShowWindow(Message&amp;#38; m)&lt;br /&gt;
       at System.Windows.Forms.Control.WndProc(Message&amp;#38; m)&lt;br /&gt;
       at System.Windows.Forms.ScrollableControl.WndProc(Message&amp;#38; m)&lt;br /&gt;
       at System.Windows.Forms.ContainerControl.WndProc(Message&amp;#38; m)&lt;br /&gt;
       at System.Windows.Forms.Form.WmShowWindow(Message&amp;#38; m)&lt;br /&gt;
       at System.Windows.Forms.Form.WndProc(Message&amp;#38; m)&lt;br /&gt;
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;#38; m)&lt;br /&gt;
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;#38; m)&lt;br /&gt;
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&lt;br /&gt;
       at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)&lt;br /&gt;
       at System.Windows.Forms.Control.SetVisibleCore(Boolean value)&lt;br /&gt;
       at System.Windows.Forms.Form.SetVisibleCore(Boolean value)&lt;br /&gt;
       at System.Windows.Forms.Control.set_Visible(Boolean value)&lt;br /&gt;
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)&lt;br /&gt;
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)&lt;br /&gt;
       at System.Windows.Forms.Application.Run(ApplicationContext context)&lt;br /&gt;
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()&lt;br /&gt;
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()&lt;br /&gt;
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)&lt;br /&gt;
       at VixCom_Test.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81&lt;br /&gt;
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)&lt;br /&gt;
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)&lt;br /&gt;
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()&lt;br /&gt;
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)&lt;br /&gt;
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)&lt;br /&gt;
       at System.Threading.ThreadHelper.ThreadStart()&lt;br /&gt;
[/code]</description>
      <pubDate>Mon, 21 May 2007 17:39:17 GMT</pubDate>
      <author>zerovoid</author>
      <guid>http://communities.vmware.com/message/649925?tstart=0#649925</guid>
      <dc:date>2007-05-21T17:39:17Z</dc:date>
      <clearspace:dateToText>2 years, 6 months ago</clearspace:dateToText>
      <clearspace:replyCount>4</clearspace:replyCount>
    </item>
  </channel>
</rss>

