Jump to content

  • Log In with Google      Sign In   
  • Create Account

SlimDX vb.net sample won't compile


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 geraldft   Members   -  Reputation: 100

Like
0Likes
Like

Posted 13 January 2012 - 09:36 PM

Hi - I'm new to directx wanted to try out slimdx with vb.net VS 2008 under WinXP sp3

Installed latest SlimDX for developers sept 2011
Loaded simple triangle project.

First lots of errors so added reference to slimdx. Only one slimdx available so chose that.

OK - errors disappear now try to build but get an exception error.

"Could not load file or assembly 'SlimDX, Version=2.0.7.41"

Checked in references and there are two slimdx related lines

One for sampleframework 1.0.0.0 refering to the project folder location sampleframework.dll
Second for SlimDX 2.0.12.43 in the slimdx sdk

SO - not sure why the program has this reference to ver 20741 - where does this come from? Is it the sampleframework?

So do I need to install an earlier version of the sdk?

Any help appreciated. BTW the pre-compiled exe with the tutorial does run...

Thanks

Sponsor:

#2 thomasvt   Members   -  Reputation: 109

Like
0Likes
Like

Posted 14 January 2012 - 01:31 AM

I'm a SlimDX noob too, but this is merely a .NET problem, which i DO know very well.

You have at least two projects: your test client project and the sampleframework from SlimDX. These both need a reference to SlimDX.dll.

Therefore, when you reference and use the sampleframework you indirectly are using things from SlimDX through the SampleFramework. It's probably there where you get conflicts with the SlimDX dll that is directly referenced in your client project.

Your project references to version A of SlimDX, while SampleFramework points to another version B.

So, I think you will have to check all references to SlimDX in ALL projects and make sure they point to physically the same dll (actually, it's the version that counts, but physical is extra safe Posted Image )


If I can give you a tip: download VS.NET 2010 Express C# edition and learn C#. It works almost identical to VB.NET but with other syntax. It's not like shifting to Java or C++, it's not hard, I bet you will already be getting more comfortable with it after a few sessions. C# is the leading language in Microsoft samples, and in any Microsoft technology community I know of. Therefore, learning C# is a minor effort to get the benefit of getting a lot more learning material to play with.

Besides, the internet is packed with "comparisons between VB.NET and C#" so you will barely ever not find how to do things in C# that you know in VB.NET.

I may be wrong, but the VB.NET samples of SlimDX may have gotten less attention and may be buggy? I have used the C# demo's, and those work fine.

Btw, if you stick to VB.NET, and my help didn't solve the problem, just let me know where and which sample you're talking about, I'll give it a look.

Hope this helps

#3 geraldft   Members   -  Reputation: 100

Like
0Likes
Like

Posted 14 January 2012 - 03:01 AM

Hi Thomas

Thanks for the reply. Not sure I can get anywhere with this still. There is a sampleframework.dll referenced directly by the project. Only one version seems to exist amongst all the stuff that came with the install. There is a totally separate sampleframework project in another folder with lots of subprograms under categories like core, device settings, enumeration, rendering, utilities etc etc whose purpose is not immediately evident., and no idea how this relates to the sampleframework.dll Can it build a new dll ? I pointed it's broken reference to the more recent slimdx.dll and tried to build the project - assuming it makes a new dll? But it has errors too. I fixed a couple of obvious ambiguous reference errors but this one gets me...

Direct3D10.SwapChain.GetBuffer(Of Texture2D)(0) "Getbuffer is not a member of slimdx.dxgi.swapchain"

The main reason I am trying this slimdx is because I found a problem with ms directx managed code in .net where some features are not upwardly compatible with Windows 7. So far all the samples I tried have the same error. hmmm

Thanks G

#4 thomasvt   Members   -  Reputation: 109

Like
1Likes
Like

Posted 14 January 2012 - 08:03 AM

I have googled around a bit, and I think you're using these translated examples: http://www.ventsim.com/files/samplesvb.zip

If it's those, I looked at them for a bit, and they don't seem to compile indeed even after messing around with it for a while.

It seems like a bizarre version of SlimDX.dll he's sending with the zip package because when I use the "official" dll from slimdx for .NET 2, I get non existing methods, while the dll that's in the sample package doesn't have these errors. Then again, running with the dll provided gives the runtime problem you mentioned.
Maybe, this is fixable, but why bother?

Just follow my advice: download Visual Studio Express 2010 C# (it's free, and legal) and get the latest SlimDX. You can even consider XNA 4.0 which is even easier to get started with and is powerful too. XNA is a game framework on DirectX, so you won't have to write a lot of basic math/rendering logic yourself. XNA 4 is DirectX 9, which you are using anyway. It's really a no-brainer, you'll thank yourself in a few weeks you learned C#; trust me :)

#5 geraldft   Members   -  Reputation: 100

Like
0Likes
Like

Posted 15 January 2012 - 12:55 AM

HI thanks again. Yes coming to same conclusion - why bother... and yes those are the samples which I think are in a link from the official SLimDX site?

All I wanted to do was upgrade an existing application I have written in VB which has interactive keyframe graphs for creating animation curves. I am currently using GDI - which works fine mostly but has some flicker problems and drags down the GUI response. I can probably still optimise the code but I was hoping directx or similar would have faster drawing and be more efficient. I don't really need 3D at this stage but it might be useful in the future.

re XNA I am using VS 2008 pro which seems I can only use XNA 3.1 - otherwise I need to upgrade to 2010 to use XNA 4 Not sure if this matters.
But I'm trying to keep the program as portable as possible with minimal install requirements... XNA looks like it needs an install package. More junk for the computer...

BTW - Originally I tried microsoft managed direct3d which did transport to Win7 fine. It was only when I used D3DX that it failed. Just tried a new dll file version and now it works hey! So maybeI will stick with direct3d - main reason it doesn't require any special installs on other computers to run the program since it's base requirement seems to be dx9c which is installed just about everything...

THanks again.. Thomas

I will look at C# - but what is the real advantage of using it? I can do everything I need in VB so why change? Is there something compelling?

#6 thomasvt   Members   -  Reputation: 109

Like
0Likes
Like

Posted 16 January 2012 - 03:26 PM

The sole reason i advise you to go to C#, as I explained before, is because you will find much more samples and learning material on the internet. Most people on forums (like this one) will prefer using C# to answer your questions. the difference is quite huge. You experienced it yourself with the VB.NET samples that won't work. And me finding the same examples in one google search (meaning there are very little different vb.net resources for SlimDX out there).

It's just the prefered language in .NET communities, resulting in making your life a lot easier :)

You need to get the hang of it a bit, but it's really not hard.

#7 Monza   Members   -  Reputation: 140

Like
0Likes
Like

Posted 17 January 2012 - 06:09 AM

If it's those, I looked at them for a bit, and they don't seem to compile indeed even after messing around with it for a while.

It seems like a bizarre version of SlimDX.dll he's sending with the zip package because when I use the "official" dll from slimdx for .NET 2, I get non existing methods, while the dll that's in the sample package doesn't have these errors. Then again, running with the dll provided gives the runtime problem you mentioned.


The samples use an early version of SLIMDX. Unfortunately some of the methods used in the framework are now depreciated and no longer work with recent versions of SLIMDX. The simple examples such as 'Simple Tri" which do not use the framework will work if you relink the SLIMDX dll resource in the archive.



#8 geraldft   Members   -  Reputation: 100

Like
0Likes
Like

Posted 17 January 2012 - 07:13 AM

Yes that works - how simple! The ones that use framework still don't work.. Anyway now I'm wondering why I tried this? I have started with my new code using normal old unmanaged direct3d and it's working ok after a few headbutting moments ... seems to work in older XP setups as well as Win7 64bit... :)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS