Mogreform: Error when in vb.net

Nimph

01-08-2007 11:08:30

I attempted to convert the c# version of the Mogreform example to vb.net.
All was well except for one thing:

window = root.CreateRenderWindow("Simple Mogre Form Window", 0, 0, False, misc)

In this code, the misc at the end has a blue zig zag line under it, because of the error (Value of type 'Mogre.NameValuePairList' cannot be converted to 'Mogre.Const_NameValuePairList'.)

I don't understand why the constant "NameValuePairList" doesn't understand "Mogre.NameValuePairList". :?

Bekas

01-08-2007 14:07:59

This is mentioned in the FAQ:
http://www.ogre3d.org/wiki/index.php/Mogre_FAQ#Why_do_some_classes_have_the_.27Const_.27_prefix_.3F

Nimph

01-08-2007 20:35:59

Dim misc As Const_NameValuePairList = List.ReadOnlyAttribute
misc("externalWindowHandle") = hWnd.ToString()
window = root.CreateRenderWindow("Simple Mogre Form Window", 0, 0, False, misc)


I tried this, except on the first line it complains about "Too few type arguments to 'System.Collections.Generic.List(Of T)'."

And it also complains about the whole second line that "Property 'Item' is 'ReadOnly'."

[Edit] Nevermind. I fixed the problem like this:

Dim misc As New NameValuePairList
misc("externalWindowHandle") = hWnd.ToString()
Dim const_list As Const_NameValuePairList = misc.ReadOnlyInstance
window = root.CreateRenderWindow("Simple Mogre Form Window", 0, 0, False, const_list)