Jump to content

D3D11SharpAppForm


photo

Recommended Posts

Hi there,

 

I've been trying to compile the c# examples that come with 2.0 beta and I'm getting the following error when trying to compile:

 

 

An unhandled exception of type 'System.DllNotFoundException' occurred in UnigineSharp_x86d.dll

Additional information: Unable to load DLL 'UnigineWrapper_x86d': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

 

 

Is there something I'm missing here?  There was no instructions that said I need to add in UnigineSharp_x86d.dll.

 

Any ideas?

 

Thanks,

Simon 

 

Link to comment

Hi Simon,

 

To fix it just copy and rename main.exe.config to main_x86.exe.config in the directory <SDK>\source\csharp\samples\App\D3D11SharpAppForm. Also, please don't forget to modify contents of this file if you are using x86 builds (UnigineSharp_x64d.dll -> UnigineSharp_x86d.dll).

 

This is known issue and I believe it would be fixed in the next SDK update.

 

Sorry for the inconvenience caused.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Ok thanks,

 

So, now I've started a c# project from scratch and getting the same error:

 

An unhandled exception of type 'System.DllNotFoundException' occurred in UnigineSharp_x64d.dll

Additional information: Unable to load DLL 'UnigineWrapper_x64d': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

 

Is the solution something similar?

 

 

Also, I'm creating a winforms app with actual winforms in it.  The following mainline compiles but nothing shows up when I run it without debugging:

 

static void Main()
        {
            // wrapper initialization
            Wrapper.init();

            string[] args = new string[]{ @"-data_path", @"../../.." };

            // engine initialization
            Engine engine = Engine.init(Engine.VERSION, args);

            // start main loop
            engine.main();

            // engine shutdown
            Engine.shutdown();
           
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }

 

Is there something I'm doing wrong?  I'd like to see the unigine viewport appear with a winforms container.

 

 

Thanks,

 

Simon

Link to comment

Hi Simon,
 
There are different solutions to the following problem:

Unable to load DLL 'UnigineWrapper_x64d': The specified module could not be found.

  • Adding the full path to the <UnigineSDK>/lib directory to the PATH variable;
  • Copy all the required libs (including Unigine_x64/x86) to the current application directory;
  • Adding <TargetFileName>.config file, (where <TargetFileName> is currently built *.exe program from Visual Studio) with the contents similar to the existing main.exe.config file.

Also, we recommend to use Visual Studio 2013 for the C# projects.

 

About winforms application issue I will ask devs to help.

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Thanks,

 

Any info on the winforms controls?  I'd like to have winforms drop-downs, edit boxes etc. hook into unigine.  Is this possible?

Link to comment

Ok, so I've done all that and am still getting the error.  

 

Keep in mind - I'm am pushing "F5" with (Debug and x64 set).  So, basically I'm attempting to debug the application.  

 

When I push F7 (run without debug) nothing happens - the window doesn't load at all.   However, I am not running a console application - I'm running a winforms application.

 

Can I please get some help with this?

 

Thanks,

Simon 

Link to comment

Simon,

 

Basically, you need to place Unigine_x64d.dll, UnigineWrapper_x64d.dll, UnigineSharp_x64d.dll near your executable. The working directory may be different according to how you're launching your app. It could be solution directory or output directory so please keep that in mind and place dlls properly.

 

All you need to do in order to use engine with winforms is to wrap our AppForm class. Have a look at <sdkroot>/source/csharp/samples/App/common/AppForm.cs file as it contains that wrap sample.

Link to comment

Ok thanks - so that's all fine and it compiles and the console application can run (still kicks an error if I try to run the debugger over it - But I can run it from the windows folder).

 

I've taken a look at AppForm.cs.  Two things:

 

1.  It inherits from class 'App'  -   class AppForm : App    -  I can't find this anywhere - what is this?

 

2.  What do I put in the main line?  a proper winforms app has no command line args, so I "hacked" them in myself - is this correct?:

 

static void Main()
        {
            // wrapper initialization
            Wrapper.init();
            string[] args = new string[]{ @"-data_path", @"../../.." };
            // engine initialization

            Engine engine = Engine.init(Engine.VERSION, args);

            .

            .

            .

 

Instead - is there an actual  sample I can download from somewhere that has a winforms control working?

 

Thanks,

Simon

Link to comment
×
×
  • Create New...