• Home
  • Products
    • Game Engine
      • Base
      • Mathematics
      • Geometry
      • Physics
      • Particles
      • Animation
      • Graphics
      • Game
      • Game UI
    • Windows Forms
      • Docking Windows
      • Text Editor Control
  • Downloads
  • Buy
    • Overview
    • Professional
    • Indie
    • Non-Commercial
  • Support
    • Overview
    • Blog
    • Forum
    • License FAQ
    • Documentation
  • About
    • About Us
      • Services
    • Contact Us
    • Press
    • Legal Terms
      • Imprint (English)
      • Imprint (German)
Select the search type
 
  • Site
  • Web
Search
DigitalRune.com
Login |Register
NEWS News RSS Feed BLOG Blog RSS Feed FORUM News RSS Feed DOCUMENTATION DigitalRune Software on YouTube DigitalRune Software on Twitter
You are here: SupportForum

If you want to contribute to the forum discussions, please Register or Login.

SearchHome
  • 1
  • 2
  • 3
  • 4
  • 5
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineModal Dialog on Vector3f constructionModal Dialog on Vector3f construction
Previous
 
Next
New Post
3/21/2012 3:34 PM
 
cjrgaming
No Ranking

Joined: 11/11/2011
Posts: 5
Modal Dialog on Vector3f construction 

I am working with Photon (a server/client API) and I was creating a flat plane for objects to move on and I'm getting this strange error. My code runs as a service but I'm confused as to why the constructor for a Vector3F would need to create a message box. The error I get is this:

2012-03-21 08:13:58,165 [1] ERROR Photon.SocketServer.ApplicationBase [(null)] - System.TypeInitializationException: The type initializer for 'DigitalRune.Geometry.Pose' threw an exception. ---> System.TypeInitializationException: The type initializer for 'DigitalRune.Mathematics.Algebra.Vector3F' threw an exception. ---> System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
   at System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp)
   at System.Windows.Forms.MessageBox.Show(String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon)
   at System.TypeInitializer.CreateInstance(Int32 guid, String assemblyName)
   at DigitalRune.Mathematics.Algebra.Vector3F..cctor()
   --- End of inner exception stack trace ---
   at DigitalRune.Geometry.Pose..cctor()
   --- End of inner exception stack trace ---
   at DigitalRune.Physics.RigidBody..ctor(Shape shape, MassFrame massFrame, IMaterial material)
   at DigitalRune.Physics.Simulation..ctor()
   at AegisBornServer.Multi.SubServer.Region.BackgroundThreads.DigitalRunePhysicsBackgroundThread.Setup() in C:\temp\AegisBorn\AegisBorn\SubServer\Region\BackgroundThreads\DigitalRunePhysicsBackgroundThread.cs:line 42
   at MMO.Photon.Application.PhotonApplication.Setup() in C:\temp\MMO\MMO.Photon\Application\PhotonApplication.cs:line 66
   at Photon.SocketServer.ApplicationBase.PhotonHostRuntimeInterfaces.IPhotonControl.OnPhotonRunning() in c:\build\photon-socketserver-sdk_3.0\src\Photon.SocketServer\ApplicationBase.cs:line 575

The code attempting to do this is:

            DigitalRune.Licensing.AddSerialNumber(...);
            Simulation = new Simulation();                                    /// Error is on Simulation Creation
            
            Simulation.Settings.Timing.MaxNumberOfSteps = 1;
            Simulation.ForceEffects.Add(new Gravity());
            Simulation.ForceEffects.Add(new Damping());
            var rigidBody = new RigidBody(new PlaneShape(Vector3F.UnitY, 0))
            {
                Name = "GroundPlane",
                Pose = Pose.Identity,
                MotionType = MotionType.Static,
            };
            Simulation.RigidBodies.Add(rigidBody);


 
New Post
3/21/2012 4:56 PM
 
cjrgaming
No Ranking

Joined: 11/11/2011
Posts: 5
Re: Modal Dialog on Vector3f construction 

I created a new project with just a console app and the code doesn't display a dialog box, it just runs fine. The code was working some time ago As far back as February 1st, but some time in the last month and a half it now errors out. I also tried downloading the latest release (the files are the same). I just can't seem to get the simulation to want to start any more.

 
New Post
3/21/2012 5:20 PM
 
HelmutG
6th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 565
Re: Modal Dialog on Vector3f construction 

The licensing code will try to show a message box if the license key (set with AddSerialNumber) is invalid. This can happen if:

- you use no license key, an invalid license key or a trial license key and the trial period has expired.
- you use a non-commercial key and it is expired (see expiration date in the email that issued the key).

Please make sure that the system date on the PC is up-to-date. Did you test the console application and the service on the same machine?

We have tested the licensing in a windows service. If the key and date are ok, it should work. Only if key/date are invalid, then we get the exception. (In the next DigitalRune Engine version we will try to avoid the licensing message box in windows services.)

 
New Post
3/21/2012 7:02 PM
 
cjrgaming
No Ranking

Joined: 11/11/2011
Posts: 5
Re: Modal Dialog on Vector3f construction 

Yes, I ran both on the same machine. The "..." in the license is the same in both and it doesn't expire until Nov 2012. I am unaware of any changes I would have made as it is happening on the second line and the console version is behaving without a message box.

 
New Post
3/22/2012 8:30 AM
 
HelmutG
6th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 565
Re: Modal Dialog on Vector3f construction 
Please send us an email with your license key and a simple test project with a service where the exception occurs. Hopefully we can reproduce the behavior with your test project. (I have tested a windows service with your license key but couldn't reproduce the exception so far.)
 
New Post
3/22/2012 4:09 PM
 
cjrgaming
No Ranking

Joined: 11/11/2011
Posts: 5
Re: Modal Dialog on Vector3f construction 

I am using Digital Rune through Photon. Thankfully I was able to run it as an application. For whatever reason, when i run through photon the popup I am getting is saying:

"Thank you for evaluating DigitalRune Mathematics.

Your evaluation period has expired. To continue using the software please purchase a license... If you have a license, please enter the license keys using DigitalRune.Licensing.AddSerialNumber()"

But as you can see, I am using the AddSerialNumber and it works fine in every case except when I try to use Photon.

The basic gist of what I'm doing is starting my photon service then starting the physics piece in a background thread so that my networking and physics are on separate threads.

 
New Post
3/22/2012 4:24 PM
 
HelmutG
6th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 565
Re: Modal Dialog on Vector3f construction 
The licensing software that we use is a third-party solution. And we are not familiar with Photon. This makes it a bit difficult to pinpoint the problem. Can you send us (per email) a project to help us reproduce the problem? Meanwhile we will try to get a Photon trial for testing.
 
New Post
3/22/2012 5:15 PM
 
cjrgaming
No Ranking

Joined: 11/11/2011
Posts: 5
Re: Modal Dialog on Vector3f construction 

I found a fix. Its interesting to note how I broke it. My setup is this:

Photon is based off a launch point, the ApplicationBase. This can be launched as a service or as an application. Inside my application I use Autofaq to register all my components. Once everything is registered, anything marked as IBackgroundThread is started on its own thread. It was inside the setup of this thread that I had my AddSerialNumber function.

I had it working previously when I would create the physics thread inside the setup of my Application. Since then I moved it a background thread and used Autofaq to register it as a component, and I had it marked as a SingleInstance. Autofaq+Photon must be doing something with it because it breaks.

I decided to move the AddSerialNumber line out of the BackgroundThread and instead put it in the Setup of the Application and the problem clears up. I think it is a very very remote edge case that probably shouldn't be explored.

 
New Post
3/23/2012 9:04 AM
 
HelmutG
6th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 565
Re: Modal Dialog on Vector3f construction 
Oh yes, that is really not the typical use-case. ;-)
 
 Page 1 of 1
Previous
 
Next
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineModal Dialog on Vector3f constructionModal Dialog on Vector3f construction


DigitalRune is a trademark of Garstenauer Information Technology OG.

Garstenauer Information Technology OG
Weingartenstrasse 35, 4452 Ternberg
Austria (EUROPE)
office@digitalrune.com

Home Products Downloads Buy Support About Us
Game Engine Particles Windows Forms Professional Blog Services
Base Animation Docking Windows Indie Forum Contact Us
Mathematics Graphics Text Editor Control Non-Commercial License FAQ Press (News)
Geometry Game Documentation Legal Terms
Physics Game UI Imprint
Impressum
Copyright © 2006-2012 Garstenauer Information Technology OG Terms Of UsePrivacy Statement