473,467 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Namespace declaration

Hello.
I am trying to convert a C# to VB.NET.
Can you please tell me what I'm doing wrong and how I can fix it?
I am getting the error "Namespace declarations can only be used..."
Thank you!

This is my module:

Imports System
Imports System.Collections.Generic
Imports System.Text

Module Module1

Namespace Mogre.Demo.BSP
Class Program
Private Shared Sub Main(ByVal args As String())
Try
Dim app As New BspApplication()
app.Go()
Catch generatedExceptionName As
System.Runtime.InteropServices.SEHException
' Check if it's an Ogre Exception
If OgreException.IsThrown Then
ExampleApplication.Example.ShowOgreException()
Else
Throw
End If
End Try
End Sub
End Class

Class BspApplication
Inherits Mogre.Demo.ExampleApplication.Example
Private quakePk3 As String
Private quakeLevel As String

Private loadingBar As New
Mogre.Demo.ExampleApplication.LoadingBar()

Public Overloads Overrides Sub LoadResources()
loadingBar.Start(window, 1, 1, 0.75F)

' Turn off rendering of everything except overlays
sceneMgr.ClearSpecialCaseRenderQueues()

sceneMgr.AddSpecialCaseRenderQueue(CByte(RenderQue ueGroupID.RENDER_QUEUE_OVERLAY))
'fix: RenderQueueGroupID.RENDER_QUEUE_OVERLAY

sceneMgr.SetSpecialCaseRenderQueueMode(SceneManage r.SpecialCaseRenderQueueMode.SCRQM_INCLUDE)

' Set up the world geometry link

ResourceGroupManager.Singleton.LinkWorldGeometryTo ResourceGroup(ResourceGroupManager.Singleton.World ResourceGroupName,
quakeLevel, sceneMgr)

' Initialise the rest of the resource groups, parse
scripts etc

ResourceGroupManager.Singleton.InitialiseAllResour ceGroups()

ResourceGroupManager.Singleton.LoadResourceGroup(R esourceGroupManager.Singleton.WorldResourceGroupNa me,
False, True)

' Back to full rendering
sceneMgr.ClearSpecialCaseRenderQueues()

sceneMgr.SetSpecialCaseRenderQueueMode(SceneManage r.SpecialCaseRenderQueueMode.SCRQM_EXCLUDE)

loadingBar.Finish()
End Sub

' Override resource sources (include Quake3 archives)
Public Overloads Overrides Sub SetupResources()
Dim cf As New ConfigFile()
cf.Load("quake3settings.cfg", "" & Chr(9) & ":=", True)
quakePk3 = cf.GetSetting("Pak0Location")
quakeLevel = cf.GetSetting("Map")

MyBase.SetupResources()

ResourceGroupManager.Singleton.AddResourceLocation (quakePk3, "Zip",
ResourceGroupManager.Singleton.WorldResourceGroupN ame, True)
End Sub

' Override scene manager (use indoor instead of generic)
Public Overloads Overrides Sub ChooseSceneManager()
sceneMgr =
Root.Singleton.CreateSceneManager("BspSceneManager ")
End Sub

' Scene creation
Public Overloads Overrides Sub CreateScene()
camera.NearClipDistance = 4.0F
camera.FarClipDistance = 4000.0F

Dim vp As ViewPoint = sceneMgr.GetSuggestedViewpoint(True)

camera.Position = vp.Position
camera.Pitch(New Degree(90.0F))
camera.Rotate(vp.Orientation)
camera.SetFixedYawAxis(True, Vector3.UNIT_Z)
End Sub
End Class
End Namespace
End Module
Aug 20 '07 #1
1 2124
"Charles Simpsons" <c.*******@gmail.comschrieb
Hello.
I am trying to convert a C# to VB.NET.
Can you please tell me what I'm doing wrong and how I can fix it? I
am getting the error "Namespace declarations can only be used..."
Thank you!

This is my module:

Imports System
Imports System.Collections.Generic
Imports System.Text

Module Module1

Namespace Mogre.Demo.BSP
Namespace Mogre.Demo.BSP

Module Module1
...
End Module

End Namespace

You can not put Namespaces in Modules or Classes, only the other way round.
Armin

Aug 20 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: marco_segurini | last post by:
Hi, the following test program shows a solution to a problem I have had. Now, this test program is compiled and linked by VS2003 and g++ while Comeau-on-line-compiler fails with this messages:...
6
by: clinton__bill | last post by:
Hi, I usually use "using namespace <namespace_name>" to reference a namespace. Today I run across a code, in its header file it has this, namespace SP1{ class C1; } While SP1::C1 is a...
6
by: David B. Bitton | last post by:
I am having a problem deserializing XML when the root node is missing a namespace declaration. My Type has an XmlTypeAttribute with a namespace defined. If I attempt to deserialize the XML, I get...
8
by: Simon Brooke | last post by:
I was debugging a new XML generator tonight and trying to determine why it wasn't working; and realised my dom printer does not output XML namespace declarations. My method to output an Element...
9
by: Ivan Mascovich | last post by:
Previous posts (and compilers) confirm that class X { friend void Y() ; } ; does not match namespace
12
by: Keith Patrick | last post by:
Can someone tell me the difference in terms of actual implications using: namespace MyNamespace { using System; class MyClass {...} } vs. using System;
11
by: Bruno de Oliveira Schneider | last post by:
Hello all, I'm rewriting a C++ framework, so that old prefixed names are replaced by namespaces. Please consider the following class: === boundingbox.h === namespace VART { class...
1
by: toton | last post by:
Hi, I have two namespace contains class InkFrame and PrefDialog respectively. PrefDialog needs InkFrame to show the dialog over the frame. It also stores a pointer to InkFrame inside it. Now I...
9
by: vthomasset | last post by:
Hi, Sorry for the bad subject, but i couldn't figure a better one. I would like to understand why a variable declared non static in a header causes multiple symbol definitions (if included in...
1
by: dignan.tenenbaum | last post by:
Hello, I'm using the XmlReader.ReadOuterXml() method to return the string representation of an xml node. The XmlReader is created with a file path and a XmlReaderSettings object. This was...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.