Sign in to follow this  
dmiannay

Question About Visual Basic 2005 Express and SimConnect

Recommended Posts

I've read Brian's very helpful overview of SimConnect but remain a bit unsure of the optimal language required to create applications for FSX. I am new to programming but am intrigued about all the possibilities with FSX. I have been learning Visual Basic 2005 (.NET) and wonder if it'll do just fine or do I really need to learn C# or C++.Opinions please on whether Visual Basic 2005 will work fine with SimConnect... and thanks!DougDell XPS Gen3 (3.6GHz/800FSB) | 2GB DDR SDRAM | 74GB SATA, 10k RPM (C: ) | 120GB SATA (D: ) | 512MB ATI Radeon X1900XTX (Catalyst 6.8) | Audigy 2 ZS Sound | MS Force Feedback 2 | WindowsXP Pro (SP2) | DirectX 9.0c

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi DougI use VS2005 both VB and C#. I have not really looked at Simconnect yet, but given that both C# and VB.Net are CLR compliant languages I would expect to be able to program SimConnect using either language. The issue will be that the samples etc are going to be in C# for the managed interface (that's the one that will be programmed using C#). There is an unmanaged one which is programmed via C++. The real interface with FS will be using the C++ libraries. The managed libraries are 'wrapper's to make the C++ libraries easier to use. There are people who will tell you that C++ code will be better and faster than C#. certainly you are closer to the coalface. One big difference between managed (C# VB.Net) and C++ is the management of memory and resources. im a managed environment this is mostly taken care of (although not always) whereas in C++ you do need to dispose of your resources otherwise you will get memory leaks etc. Sometimes I hear that dotNET must be slower in some way or it is not compiled like C++. It is and once compiled to machine code it should be pretty much as quick.Almost everything Microsoft releases these days (SDKs and so on) will have it's examples, support code etc for dotNET in C#. Working with Simconnect in VB means at a minimum that you have the extra step of converting the C# samples etc into VB code first. C# is my language of choice though I was a VB programmer for a long time. If you are not already using VB.NET in a big way then I might suggest you take a look at C#. Even if you are then the transition to C# is quite easy. You can get both C# Express and VB Express free from Microsoft.My advice for what it is worth (others may disagree though :-) ) would be to use C# and the managed interface to Simconnect.

Share this post


Link to post
Share on other sites

I appreciate your straightforward reply Jon... thanks! I am quite new to programming although I've dabbled some over the years. I've never really gotten serious hence I've never really "learned" a language to a great degree. FSX and SimConnect have changed all that and my interest is renewed in a big way.I looked at VB, C# and C++ and decided that VB had the most straightforward English-like programming code and decided to head that way. When looking at C# it was hard to get my arms around the criptic statements and conventions used in writing the code. My fear is that trying to understand C# just might scare me away from programming altogether because it seems so difficult to comprehend and come to grips with.I do, however, understand what you mean. I have looked through the SimConnect SDK and it's clear that using C# is the better way to go. I've decided to head over to C# and give it a go. Any suggestions on a good beginners C# book would be appreciated!Again, I appreciate your opinion.DougDell XPS Gen3 (3.6GHz/800FSB) | 2GB DDR SDRAM | 74GB SATA, 10k RPM (C: ) | 120GB SATA (D: ) | 512MB ATI Radeon X1900XTX (Catalyst 6.8) | Audigy 2 ZS Sound | MS Force Feedback 2 | WindowsXP Pro (SP2) | DirectX 9.0c

Share this post


Link to post
Share on other sites

Hey Doug,>Any suggestions on a good beginners C# book would be>appreciated!>C# is not to difficult to learn. Don't let the syntax scare you. If you take the time to master C#, then you will have a very capable tool in you personal toolbox.Here are some good books to look at;Beginning Visual C# 2005 by Wrox Press (Red books with the authors faces on them) - This book is a good starter book on C#. It assumes very little programming knowledge. It does a good job of explaining C# concepts clearly. However, it is also very complete as a reference tool.Professional C# 2005 by Wrox Press - It takes off where the beginning book leaves. It first few chapters are a review but it gets into some in-depth subjects fairly soon.C# 2.0: The Complete Reference, Second Edition by McGraw Hill / Osborne - The name says it all. A great book!Programming Microsoft Visual C# 2005: The Language by Microsoft Press - This book comes from the folks that made C#. One thing to remember, C# or Visual Basic are just yet another series of programming languages. Their real strength comes from the .NET framework. The books above will teach you the syntax of the language and how to use the framework, however, to really utilize the power of .NET, you need to get a good understanding of it's capabilities too. Many complex tasks of the past can now be handled by creating an instance of a .NET class and using it's properties and methods. If you don't know what I am talking about, then the books above will help as they all have discussions about Object Oriented Programming.If you want the best of both worlds, .NET capability and good old Win32 API unmanaged code, I also suggest you look at Borland's latest Delphi offering. The language is Object Pascal, which is as easy to learn as Visual Basic, but it has almost the same power of C++. And it also has Delphi.NET, and C#.NET all in one package. Delphi has always been an unloved stepchild of professional programmers. It's a great development platform. If it didn't exist, .NET probably wouldn't exist in it's current form either. The Delphi VCF and .NET are very similar and you can use either in Delphi. But the VCF utilizes the Win32 API like the foundation classes for C++. The lead developer for Delphi is also one of the leads who created C#. In any case, take a look, and if you don't like Pascal, it also comes with C#.NET built in.Hope this helps.Lee Steffensen.

Share this post


Link to post
Share on other sites

Thanks Lee, and you too Jon! This is all very helpful, but I admit a bit overwhelming. I really am a newbie at this but very intrigued. My focus is to learn what I can to allow me to create applications that interact with FSX. It seems at this stage that I'll move away from Visual Basic 2005 Express and start with Visual C# 2005 Express to begin wetting my feet. It's good to know there are folks out there willing to help!Thanks again!DougDell XPS Gen3 (3.6GHz/800FSB) | 2GB DDR SDRAM | 74GB SATA, 10k RPM (C: ) | 120GB SATA (D: ) | 512MB ATI Radeon X1900XTX (Catalyst 6.8) | Audigy 2 ZS Sound | MS Force Feedback 2 | WindowsXP Pro (SP2) | DirectX 9.0c

Share this post


Link to post
Share on other sites

VB 2005 .NET should work just fine with SimConnect (as it is a .NET language), but if you have not invested too much time in learning VB you might want to consider switching to C# at this point, because the .NET samples that come with the beta SDK are written in C# and because you are more likely to get help with C# questions as more people are using it.At the end of the day it is a personal choice though ...

Share this post


Link to post
Share on other sites

I've been cramming with VB now for the past 8 days or so... not too much time in the great scheme of things. I downloaded and installed Visual C# 2005 Express and will start with some tutorials tomorrow.I appreciate all the responses!DougDell XPS Gen3 (3.6GHz/800FSB) | 2GB DDR SDRAM | 74GB SATA, 10k RPM (C: ) | 120GB SATA (D: ) | 512MB ATI Radeon X1900XTX (Catalyst 6.8) | Audigy 2 ZS Sound | MS Force Feedback 2 | WindowsXP Pro (SP2) | DirectX 9.0c

Share this post


Link to post
Share on other sites

DougYou might want to look at Beginning Visula C# 2005 Express Edition by Peter Wright, Published by Apress www.apress.com. You can get it either as a hard copy of for about half price as an eBook (pdf file).I think it is a good starter book for C#. I think most of the books described above are also available from Apress - dunno if they have taken over from Wrox. but they have sample chapters and indexes which you can download before buying. I find that useful - the sample chapters certainly give a good idea of the writers style and approach. In any case if you have question please ask either here or send me an email.

Share this post


Link to post
Share on other sites

Its personal choice, personally I can't stand the VB syntax and I know Java, and C# is basically Java anyway (with all the extra MS gobble de goop). If you prefer VB use that. There are a number of code converters for C# to VB.

Share this post


Link to post
Share on other sites

Good day all;I recently had problems with my fs2phidgets and as a result decided to 'get rid of' the middleman. I have begun writing my own interface program using VB Express.Essentially, I have created a panel page which on an experimental basis, works fairly well. (further 'tweaking needed'). From the panel page I open a flight controls page which is populated by a throttle trackbar, an elevator trackbar, an aileron trackbar, and a rudder trackbar. The controls page works at this point, however I am only getting half values. For example... ailerons will only go to the left and the throttle will inly register from 50% to full. (Rudders are the only item that do not work - it doesn't seem to recognize "AXIS_RUDDER_SET"Simconnect Aileron offset values are 16383 to -16383 however, when I perform calculations to go into the negative side... I get an error message "overwright - not divisible by 0"Are there any VB programmers out there who might know how to resolve this, I am comfortable in VB but by no means an expert? My form and its code are attached below.Eventually, Phidgets will be programed in to sync with the trackbars and switches on the main panel screen.code is attached.Thanks in advance;Daryl

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this