Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Need help: InvalidCallException in D3D9 Managed!

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List Spell Checker
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Insert an File
Check here to include your profile signature.
Check here to subscribe to this topic.
    

T O P I C    R E V I E W
cbx Posted - Dec 28 2004 : 7:55:32 PM
OK something strange going on here, and was wondering if anyone else was having the same issues. I am using vb.net and DX9 Managed.

I was playing around with ways to simplify directx down to an aboslute minimum. What I did was create a class library. And added a bunch of modules and in those modules I added some publicly availible methods such as InitGraphics, ShutdownGraphics, EnableLighting etc etc.

Now all of the varibles like the D3D Device, and present parameters etc are module level varibles that are not visible to outside apps. They are declared friend so only the Class library can see them. Although I do provide methods for accessing those varibles indirectly through some methods, GetD3DDevice for example is one of those methods.

But it seems when I create an application that references this class library and calls the initgraphics method but then tries to get the value of a render state on that device like so ...

  
InitGraphics(Me, True) ' True means windoed mode  
msgbox(GetD3DDevice.RenderState.Lighting) ' get the Lighting renderstate property and show it  
  


I keep getting a InvalidCallException being thrown when I try to retrieve the Lighting render state!?! I get this exception when I try to access any of the render state properties.

I don't get this error when I call the EnableLighting method but I do get a InvalidCallException being thrown when I try to retrieve the value of one of the render state properties on this device!

Now here is the thing. i have also tried converting the modules in the class library into classes so that my application has to create an object in order to work with the methods. but I still get the same exception being thrown! What's up with that?

You wanna know what the really odd thing is. I have never ever had an InvalidCallException thrown before until of cource I installed the new DirectX sdk Devember 2004 a few days ago! This is what I suspect is causing me my problems.

Any thoughts on this?

VB.NET 2002 Test code
Download Attachment: dx9mtester.zip<br>38.07 KB

VB.NET 2005 aka VBExpress 2005 beta 1 test code
Download Attachment: WindowsApplication1.zip<br>57.98 KB
15   L A T E S T    R E P L I E S    (Newest First)
cbx Posted - Dec 30 2004 : 6:00:07 PM
quote:
Originally posted by Eric Coleman

On a side note, I think that video is really cool. I was surprised at how small it was given it's length.



It uses the Windows Media Video 9 Screen video codec, which has very good compression, and is designed for destop screen capture programs. It usually compresses down even further when you add it to a zip file!

Eric Coleman Posted - Dec 30 2004 : 5:53:56 PM
I thought something might be cached somewhere on my PC that was using a version of the dll or something when I compiled with an earlier version of DirectX. I deleted the bin and obj directories before pressing the "play" button, and VS recreated and recompiled the files. I also tried to view settings in my MS .NET Framework Configuration page in the Control Panel under Adminitrative Tools but that program doesn't work anymore for me. I get a "MMC cannot open the selected file" error.

One thing that's different is that I don't have .NET 1.1 or 2.0 installed. My version of the framework is still 1.0 with the .NET service pack 2 or 3 installed.

You may want to read this article on repairing a .NET installation.

On a side note, I think that video is really cool. I was surprised at how small it was given it's length.
cbx Posted - Dec 30 2004 : 2:58:15 PM
quote:
Originally posted by Eric Coleman
<br>I get "False" when I click on the form. And this is with the 9.03.91 version.



OK so thats 2 people who did not have problems getting the app to run. It must just be isolated to my machine.
So why then would the DX code cause a InvalidCallException if all the dx related code is stored in an external class library? Because if you look at my 2nd post in this thread the code that I posted work just fine.

I have also created a video of what is happening on my system if anyone is interested and how big of a problems it is for me ...


Download Attachment: dxexception.zip<br>344.87 KB
Eric Coleman Posted - Dec 30 2004 : 10:03:44 AM
I get "False" when I click on the form. And this is with the 9.03.91 version.
Lachlan87 Posted - Dec 30 2004 : 10:01:29 AM
Click. A messagebox should pop up.
Eric Coleman Posted - Dec 30 2004 : 09:29:16 AM
Ok, so does the dx9mtester program do this automatically? All I get is a black screen when I run the program.
cbx Posted - Dec 30 2004 : 02:55:04 AM
quote:
Originally posted by Eric Coleman

I now have 4 versions of Managed Directx installed on my computer. The latest version for me is "9.03.91". It's almost 2 AM for me, so I'm going to bed. When I wake up tomorrow I'll test the program.

What exactly do I need to do to reproduce the error? Does it happen when you're trying to compile or when you run the program?



It only occours when you try to retrieve the value of a render state property or the Material property, or transform, sampler states, texture state properties, etc.
Eric Coleman Posted - Dec 30 2004 : 01:46:33 AM
I now have 4 versions of Managed Directx installed on my computer. The latest version for me is "9.03.91". It's almost 2 AM for me, so I'm going to bed. When I wake up tomorrow I'll test the program.

What exactly do I need to do to reproduce the error? Does it happen when you're trying to compile or when you run the program?
cbx Posted - Dec 30 2004 : 12:38:44 AM
OK i'm about to make some choice words here. F%#KI*G Son of a beep beeping beep! COMON! MICIROSFT YOU ARE BETTER THEN THIS!

OK heres the deal, I just finished removing all trace of all versions of the managed dx assemblies from my system including the sdk. There was no managed dx on my system what so ever. Then I reinstalled only the December 2004 release of the dx sdk and tried to get my previous vb.net test projects to run and guess what,... InvalidCallException.

So having tried that I removed all trace of the dx sdk and managed assemblies again, and reinstalled the October 2004 dx sdk. And repeated my previous steps in trying to get my test app to work. !!InvalidCallException!! Again! with the same dam exception!

So then I began to repeat my previous steps of removing the dx sdk and managed assemblies and reinstalling the Summer 2004 sdk and managed assemblies. Hell ya I got the InvalidCallException exception being thrown.

It seems the only version that I can only get working on my system now is v1.0.900.0. So somthing about that December 2004 update is screwing somthing up some where and reaking havok on on my system resulting in InvalidCallException being thown every times I try to retrieve the value from the device. I will be interested to see if eroc has any problems if he decides to install the december 2004 update....

I have also since tried to install ALL of the dx sdk's at the dame time in order from the 2004 summer update thru to December 2004 update and still get the same InvalidCallException being thrown.

Something I did notice is that I installed 3 versions of the sdk but only 2 versions of the manages assemblies apear to be installed.

C:\WINDOWS\Microsoft.NET\Managed DirectX\v9.02.3900 and
C:\WINDOWS\Microsoft.NET\Managed DirectX\v9.03.91

Perhaps my InvalidCallException is a result of the sdk installation trying to install over top of a previously installed assembly? I just don't know any more..... If anyone has had related problems with the directx december 2004 sdk update please make a post so that we can get an idea if this is a isolated incedent or if we should all start a mass panic.

BTW: I have made some inquaries on other fourms asking if anyone using C# and the December 2004 sdk are also having similar problems and will let you know I hear anything more on this.

Something else rather strange in VBExpress 2005 Beta 1, when I try to add a reference to dx assemblies from a cirtian folder they get added to the references list but the added dx references are not the ones I selected to add in the first palce! See the attached video for a demonstration of what I am talking about. I need to explicitly specify a reference path to the v9.03.91 folder other wise I can't add dx assmeblies from the v9.03.91 folder they keep being adde to the project references list from the v9.02.3900 folder.

Also specifying the "Copy Local" flag to copy the dx references to my apps folder still does not help.

Download Attachment: wtfdxerr.zip<br>276.16 KB
cbx Posted - Dec 29 2004 : 5:30:07 PM
Alrighty then, Just finished doing some testing and sure enough I'm convinced that it was the December 2004 instalation of directx that is causing me problems.

I changed the references for the vb.net 2002 and vb.net 2005 projects to use the dx assemblies in the v1.0.900.0 folder and presto it wored fine. So then I removed those dx references and added references to the dx files under the v9.03.91 folder IE the December 2004 release and crash boom bam a InvalidCallException exception is thrown! Using the v9.02.3900 assemblies also causes InvalidCallException to be thrown.

Heck i have even tried switching between retail and debug version of the managed assemblies but still keep getting the same InvalidCallException exception.

So how many stike outs is that now? 3, 4 maybe. The first release of managed directx that was made availible had unfinished documentation. The next release had that byref byval DrawText bug. Not to mention it did not install any previous versions of managed directx assemblies. And now it seems the December 2004 release goes a step further by throwing InvalidCallException exceptions all over the place! Ladies and gentlemen if the upcomming feburary release does not go smoothly... Tom Miller is gonna get some serious spam flooding from me demanding what the hell is going on over there in redmond.
Eric Coleman Posted - Dec 29 2004 : 5:28:56 PM
quote:
Originally posted by cbx

As I suspected. Has anyone else got it working who does not have December 2004 installed?


Read my previous post I got the program to compile and run with the Oct 2004 release. I'll download the December 2004 update to see if that causes any problems for me.
cbx Posted - Dec 29 2004 : 5:03:16 PM
quote:
Originally posted by Lachlan87
<br>Here's what you didn't want to be told. . . I downloaded your code and it works fine on my computer.

I guess you know what that means. (I only have the summer update)



As I suspected. Has anyone else got it working who does not have December 2004 installed?

As for eric not being able to reference the DirectX dll's you can find the files under the C:\WINDOWS\Microsoft.NET\Managed DirectX\v9.02.3900 folder.

The problem with vs.net is that it will only list asselblies that are the same version it uses or lower. For example in VS.net 2003 when you add a reference it will only populate the availible references list with assemblies compiled for .NET framework 1.0 and 1.1 But vs.net 2002 will only populate the availible references list with assemblies compiled only for .NET framework 1.0.

With VBExpress 2005 beta 1 all 1.0, 1.1, and 2.0 assemblies can are visible in the list.

Unfortunatly it appears if the December 2004 dx release is causing my problems I will have to wait until the next dx release in Feburary to see if that update will fix my problem.
Eric Coleman Posted - Dec 29 2004 : 10:08:20 AM
Ok, I got the program to compile when using the files in the 9.02.3900 folder. The test program works as well (except when I resize it too large I get an out of video memory error, LOL)
Lachlan87 Posted - Dec 29 2004 : 09:16:35 AM
Yeah, it's a common problem with 2002. Add the references yourself---to both of the projects in the solution. If your like me though, VB 2002 won't like the version of the DX dll's he uses though. It'll tell you something about it not liking the version of .NET runtimes the DX dll's use. I had to open his solution with VB.NET 2003 to get it to work.

VB.NET 2002 has problems, that's for sure.
Eric Coleman Posted - Dec 29 2004 : 08:52:11 AM
This is unrelated to your problem, but when I start VS 2002 I have the green X in the splash page to show that I have the directX sdk installed. However, I can't load your project file. It says I'm missing Managed.DirectX.dll. However, I have 3 of them, or at least 3 directories under Microsoft.Net/Managed DirectX/. 9.00.0900, 9.00.1126, and 9.02.3900. I have the October 2004 Update installed. However, I can't create any type of directx project. Even the VS directx wizard fails by saying that I'm missing that dll.

VBGamer © Go To Top Of Page
This page was generated in 0.19 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.