<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi,<br>
<br>
VirtualBox 4.2 has introduced a new lock type for VM frontends:
LockType.LockType_VM. You have to use this lock type, otherwise the
Console related objects are not initialized.<br>
<br>
Ivo<br>
<br>
<div class="moz-cite-prefix">Op 9-3-2013 7:12, Pavel Murygin
schreef:<br>
</div>
<blockquote
cite="mid:CAPG96NOYWU1DPoJ3+Jyt2Ccd4bQ58h4wcM3ocvr6eW5tx8ZL+A@mail.gmail.com"
type="cite">Hi everybody!<br>
<br>
I wrote a virtual box frontend in C# using com api. I haven't
touched my code for about a year. During that year I've moved to a
laptop from pc. Last time I ran my code it worked fine. Now I
cannot access IDisplay because it's null;<br>
here is my code:<br>
<br>
var vb = new VirtualBoxClass();<br>
_machine = vb.FindMachine(machineName);<br>
<br>
var monitors = _machine.MonitorCount;<br>
<br>
Monitors = new MMFFrameBuffer[monitors];<br>
for (byte i = 0; i < monitors; i++)<br>
{<br>
var name = string.Format("monitor{0}", i + 1);<br>
Monitors[i] = MMFFrameBuffer.CreateNew(name)
<div id=":75">;<br>
}<br>
<br>
_session = new SessionClass();<br>
_machine.LockMachine(_session, LockType.LockType_Shared);<br>
<br>
for (int i = 0; i < MonitorsCount; i++)<br>
{<br>
_session.Console.Display.SetFramebuffer((uint) i,
Monitors[i]);<br>
}<br>
<br>
My program fails on the line where I'm trying to set
framebuffer. I get NullreferenceException:
_session.Console.Display is null.<br>
My current version of Vbox is the latest: 4.2.8 r83876. I can't
remember the exact version on which my code ran correctly. I can
only say It was the latest one about 1 year ago. Host OS is Win7
pro x64 (same as it was on my previous PC)<br>
<br>
I'm completely clueless about my issue. Any help would be highly
appreciated!<br>
<br>
Regrads,<br>
Pavel Murygin.</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
vbox-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:vbox-dev@virtualbox.org">vbox-dev@virtualbox.org</a>
<a class="moz-txt-link-freetext" href="https://www.virtualbox.org/mailman/listinfo/vbox-dev">https://www.virtualbox.org/mailman/listinfo/vbox-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>