darkdave's picture

Currently using Tao opengl wrapper for Visual Basic 2010 express

I have been working on a project in vb2010 express using tao opengl wrapper. A friend of my set it up a new project for me with all the project referencing etc etc, things that i know very little about.

Anyways, I have lost contact with this guy, and re-installed windows with a fresh install of vb2010 express, but now my project refuses to work with all kinds of weired errors such as the computer reading one opengl line and then just skips the rest in the function and moves on to the next function... reallly weiredm things i cant fix with my debugging skills.

So I need a solution, I either need to set up my existing VB2010 express environment properly (project referencing of dlls etc etc) with files i already have in my project folder or do a massive overhaul of the program by changing it to openTK.

If possible I want to try the first option but there is no existing documentation on how to set up visualbasic 2010 express for tao.

I understand a lot of people here may have had experiences with tao on vb2010 express.

If so can u guys help me out with the first option? If not then the 2nd.

What should i do?


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mOfl's picture
darkdave wrote:

reallly weiredm things i cant fix with my debugging skills.
[...]
What should i do?

Learn to use the tools you have. Your current problem is neither about Tao nor OpenTK nor OpenGL, it's that you are not familiar with the basics of your IDE. Maybe you should refer to a more general forum than this one. Also you do not provide any valuable information to help you solve some of the problems you are experiencing. "refuses to work with all kinds of weired errors" is not an accurate error description. What errors? Run-time, compile-time? What is displayed and what isn't?

If you have worked with C++ before you should have noticed that creating a project and solution file under C# in VS2010 is incredibly simple. You do not have to link any fancy *.lib files, include the header files and put the *.dll files in the right location. You just add a reference that you can choose from all libraries available. This pretty much sums up everything you need to setup an OpenTK project in VS2010. It's basically the same thing for Tao, just the libraries differ.

richardjmoss's picture

You'll need to provide actual error messages if you want any help that is more useful than use trying to second guess what your issues could be.

Offhand, the issue I remember most with TAO was that it has depending on many non-managed libraries, and these would not be copied to your deployment folder if you just added references to the managed version, thus causing many runtime errors API calls that couldn't find the relevant libs.

darkdave's picture

I suspect it has something to do with the fact that im running windows 7 64bit.

But anyways to be more specific i put a break point in my function that runs initially during the program execution, when i increment the advance of the program it exits the function when it reaches any line that is opengl related such as glWhatever. And then i see my GUI for VB but without an acompanying OpenGL window that normally appears beside it.

It's as if the program does not finish running thru the entire function so it does not even start the GL LOOP to begin rendering.

NO OpenGL window because it wont execute opengl codes and DOES NOT THROW ANY ERROR MESSAGES! Weired isnt it?

However when i move the file to another computer running windows 7 32 bit, it runs no problems. Same files no edits.

It's as if the dlls dont work in my 64bit OS.
Another possibility is that because my 64 bit IDE needs to be configured first for the project to work and my 32bit OS has their IDE correctly set up, i don't know for sure.
HOWEVER, I was under the impression that the solution file should hold all the relevant settings for the IDE to run correctly under the right settings, and the project files are not edited between the OS
yet it only works in the 32bit OS not the 64bit.

So im thinking either there needs to be a download of a 64bit dlls for opengl TAO or i just need to setup my IDE (VB2010express) in 64bit win7 because there is some "global" setting that supersedes the settings in the solution file.

In the case below glutINIT does not run nor does any of the the lines after it, I have swapped it around before with another gl line and the same thing occurs: no subsequent lines in the after the first glcode in the same function is executed, i know because i noticed that certain variables were not initialized that are supposed to be initialized after the gl codes in this function.

In this picture below you can see that because of this problem GL Loop doesnt run and none of the keyboard functions are linked/bined to the glutkeyboard functions since they all occur after the first gl Line.


This is the VB form that always appears.

Here is the SEPERATE openGL window that DOES appear on a windows7 32 bit system and appears beside the VB form next to it, in 64bit OS only the VB form appears and this graphics openGL window DOES NOT.

darkdave's picture

I installed TAO frame work hoping it would fix the problems but even the examples dont work:


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: Unable to load DLL 'freeglut.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at Tao.FreeGlut.Glut.glutInitWindowSize(Int32 width, Int32 height)
at CgExamples.Gl_01_vertex_program.Run()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at CgExamples.CgExamples.SelectExample()
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5448 (Win7SP1GDR.050727-5400)
CodeBase: file:///D:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
CgExamples
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Program%20Files%20(x86)/TaoFramework/examples/CgExamples.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5446 (Win7SP1GDR.050727-5400)
CodeBase: file:///D:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5...
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5453 (Win7SP1GDR.050727-5400)
CodeBase: file:///D:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/Sy...
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5458 (Win7SP1GDR.050727-5400)
CodeBase: file:///D:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d...
----------------------------------------
Tao.FreeGlut
Assembly Version: 2.4.0.2
Win32 Version: 2.4.0.2
CodeBase: file:///D:/Windows/assembly/GAC_MSIL/Tao.FreeGlut/2.4.0.2__6e602a6ad6c0d...
----------------------------------------
Tao.OpenGl
Assembly Version: 2.1.0.12
Win32 Version: 2.1.0.12
CodeBase: file:///D:/Windows/assembly/GAC_MSIL/Tao.OpenGl/2.1.0.12__1ca010269a4501...
----------------------------------------
Tao.Cg
Assembly Version: 2.0.0.0
Win32 Version: 2.0.0.0
CodeBase: file:///D:/Windows/assembly/GAC_MSIL/Tao.Cg/2.0.0.0__52fa5aba625fe731/Ta...
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

darkdave's picture

After installing TAO framework the project does throw an error before able to execute one line of code.
System.InvalidOperationException was unhandled
Message=An error occurred creating the form. See Exception.InnerException for details. The error is: Could not load type 'IdleCallback' from assembly 'Tao.OpenGl, Version=2.1.0.12, Culture=neutral, PublicKeyToken=1ca010269a4501ef'.
Source=Part2
StackTrace:
at Part2.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at Part2.My.MyProject.MyForms.get_MyProject()
at Part2.MyProject.Main() in G:\SOFTWARE PROJECTS\VB\WS - Historica\part2\Part2\MyProject.Designer.vb:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.TypeLoadException
Message=Could not load type 'IdleCallback' from assembly 'Tao.OpenGl, Version=2.1.0.12, Culture=neutral, PublicKeyToken=1ca010269a4501ef'.
Source=Part2
TypeName=IdleCallback
StackTrace:
at Part2.MyProject.chkAnimation_CheckedChanged_1(Object sender, EventArgs e)
at System.Windows.Forms.CheckBox.set_CheckState(CheckState value)
at Part2.MyProject.InitializeComponent() in G:\SOFTWARE PROJECTS\VB\WS - Historica\part2\Part2\MyProject.Designer.vb:line 946
at Part2.MyProject..ctor() in G:\SOFTWARE PROJECTS\VB\WS - Historica\part2\Part2\MyProject.vb:line 132
InnerException:

darkdave's picture

Seriously? After all that talk about "this is not a Tao problem" etc etc, and i finally show some concrete error messages , none of u previously loud people are willing to add anything else ?

richardjmoss's picture
darkdave wrote:

Seriously? After all that talk about "this is not a Tao problem" etc etc, and i finally show some concrete error messages , none of u previously loud people are willing to add anything else ?

Well, I can't really see anyone willing to help if that's going to be your response. This board always seems to be a little slow to respond, if it does at all - I know my questions on flaky input support were never answered. But showing an attitude probably won't generate any help. Also bear in mind this site is for OpenTK, not TAO.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: Unable to load DLL 'freeglut.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

That error is telling you plain as day that freeglut.dll can't found anywhere in your path - this may be related to my original post where I said that a number of unmanaged binaries that TAO uses aren't copied. Have a look in the "lib" folder of your TAO installation and add that file to your deployment. Depending on what you are using you may also need to copy a bunch of other files, I'm not hugely familiar with TAO as I only use the Tao.Sdl.dll bindings (which has the same problem in copying SDL.dll).

For the second error, unfortunately what you have posted is the outer exception which wraps the original exception. Generally speaking, if an InnerException is present, then this always has the most accurate exception data. You'll need to check that to see what it says.

That's pretty much all the time this "loud" person is willing to devote to this thread. Good luck resolving your code.

One final comment. If you suspect it is the difference between 32bit and 64bit, then change your project to compile as x86 rather than Any CPU. That will then always ensure your code runs in 32bit mode.

darkdave's picture

Ok thanks, sounds useful. I'll try.

And I'm sorry I had to sound rude , but some times its a necessary evil to get some help and attention by "trolling" a little. Otherwise if i stay polite im convinced by now still no one would have responded including yourself, but it seems to have paid off with you responding, so Thanks.

David

darkdave's picture
richardjmoss wrote:
darkdave wrote:

Seriously? After all that talk about "this is not a Tao problem" etc etc, and i finally show some concrete error messages , none of u previously loud people are willing to add anything else ?

Well, I can't really see anyone willing to help if that's going to be your response. This board always seems to be a little slow to respond, if it does at all - I know my questions on flaky input support were never answered. But showing an attitude probably won't generate any help. Also bear in mind this site is for OpenTK, not TAO.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: Unable to load DLL 'freeglut.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

That error is telling you plain as day that freeglut.dll can't found anywhere in your path - this may be related to my original post where I said that a number of unmanaged binaries that TAO uses aren't copied. Have a look in the "lib" folder of your TAO installation and add that file to your deployment. Depending on what you are using you may also need to copy a bunch of other files, I'm not hugely familiar with TAO as I only use the Tao.Sdl.dll bindings (which has the same problem in copying SDL.dll).

For the second error, unfortunately what you have posted is the outer exception which wraps the original exception. Generally speaking, if an InnerException is present, then this always has the most accurate exception data. You'll need to check that to see what it says.

That's pretty much all the time this "loud" person is willing to devote to this thread. Good luck resolving your code.

One final comment. If you suspect it is the difference between 32bit and 64bit, then change your project to compile as x86 rather than Any CPU. That will then always ensure your code runs in 32bit mode.

I've given up on OpenTK and reverted my code back to TAO. Here is where I am at based on your advice:

I did what you said and got rid of the freeglut error and also added in some cpu relevant line in the project file so that it run in x86 mode:

Here is what i did, I added in the following line into the project file:

PlatformTarget x86 PlatformTarget

Ok I had to edit the above line or else most of it wont show up since it's xml but u get the idea...

But after this modification to the project file I still had an error window when I tried to compile my visual basic 2010 express project...

And here is the error message i got in a window:
An error occurred creating the form. See Exception.InnerException for details. The error is: Could not load type 'IdleCallback' from assembly 'Tao.OpenGl, Version=2.1.0.12, Culture=neutral, PublicKeyToken=1ca010269a4501ef'.

And the EXCEPTION DETAIL:
System.InvalidOperationException was unhandled
HResult=-2146233079
Message=An error occurred creating the form. See Exception.InnerException for details. The error is: Could not load type 'IdleCallback' from assembly 'Tao.OpenGl, Version=2.1.0.12, Culture=neutral, PublicKeyToken=1ca010269a4501ef'.
Source=Part2
StackTrace:
at Part2.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at Part2.My.MyProject.MyForms.get_MyProject()
at Part2.MyProject.Main() in D:\Users\darkdave\Desktop\part2\Part2\MyProject.Designer.vb:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at System.Activator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.TypeLoadException
HResult=-2146233054
Message=Could not load type 'IdleCallback' from assembly 'Tao.OpenGl, Version=2.1.0.12, Culture=neutral, PublicKeyToken=1ca010269a4501ef'.
Source=Part2
TypeName=IdleCallback
StackTrace:
at Part2.MyProject.chkAnimation_CheckedChanged_1(Object sender, EventArgs e)
at System.Windows.Forms.CheckBox.OnCheckedChanged(EventArgs e)
at System.Windows.Forms.CheckBox.set_CheckState(CheckState value)
at System.Windows.Forms.CheckBox.set_Checked(Boolean value)
at Part2.MyProject.InitializeComponent() in D:\Users\darkdave\Desktop\part2\Part2\MyProject.Designer.vb:line 946
at Part2.MyProject..ctor() in D:\Users\darkdave\Desktop\part2\Part2\MyProject.vb:line 134
InnerException:

I can't make much sense out of this except for the idlecallback keyword stands out ... but I have no idea what this error message is telling me or what i should do.

I'll patiently wait for an answer, but seriously... how long should i wait before I give up hope on this thread? 7 days? I am not being sarcastic I just want to know honestly if I should bother hoping on this thread for an answer if I don't make any noise.

richardjmoss's picture

I did mention in an earlier reply that if "InnerException" is populated, then it's important (more important in fact) to check that as that contains the true cause of the error.

In your case, you can see InnerException is clearly set - it has an instance of System.TypeLoadException. You need to check *this* exception as it'll tell you why it couldn't load the type. Assuming you're running the app in the debugger, when the exception occurs, click View Details, then expand Inner Exception (and keep expanding if the next exception also has an inner :)). This should give you the underlying cause of your InvalidOperationException . Even just calling ToString() on the exception you have should include the full details of the inner exception.

As for responses... well tbh I've given up on these boards. If I have a problem I tend to ask on gamedev.net as I've always had prompt and helpful responses to OpenGL specific issues that I've been unable to resolve myself.