Unmanaged language or library to write shell extension? - vb.net

I need to write a cascading shell extension à la 7Zip. It appears that only the .Net 4 framework supports this, but even in March 2012, MS still advises against using a managed language for this purpose.
So what unmanaged languages are available to write shell extensions for Windows (XP, Vista, 7)?
I read that writing a COM DLL is not easy even for seasoned C++ developpers, so it's probably a dead-end for non-pros. VB6 has been deadware for a decade. I looked at PureBasic and PowerBasic but they don't seem good candidates either.
So is there simply no reasonably easy language to write a cascading shell extension?
As a work-around, is there a library that I could call from VB.Net that would handle the hard part?
Thank you.

There is not a lot you can do if you're not willing to go into the unmanaged world. There is a series of articles on codeproject. This is the first of such articles. They helped me quite a bit. It is written in unmanaged c++ using visual studios ATL project which takes care of some other classes that you would otherwise have to deal with.
COM objects may not be the easiest thing to understand but once they're working they are fairly solid. If anything just treat it as a learning experience.

Related

Can VB.NET be used as a game engine?

I know VB.NET, and I've been planning on creating a simple 2d game engine. I got no problems with creating such engine and running the actual game. However, I've been told that VB.NET might not be the best choice for "working too much with graphics". I'd like to know if that's true. Can VB.NET truly not manage efficiently loads of graphics simultaneously on the screen? If no, what kind of software am I supposed to use for creating this engine?
I have found that people generally view VB.NET as a subpar language, and mostly associate it with Visual Basic 6.0 (or earlier).
In the .NET world, VB.NET is a first class citizen that simply has a verbose syntax. It's particularly because of the verbosity that I would probably choose C#, if not going with C++.
Still, you can use VB.NET to work with whatever drawing libraries that you want, and you can even use it with XNA and Managed DirectX. It can even be linked against unmanaged libraries as long as you are willing to do to the required interop.
As for managing the graphics on the screen efficiently, it really depends on how well you do it, and how much you want done. If someone can do it well in C#, then you can do it well in VB.NET with the exception of unsafe code. It's too general to say either way given the vague "simple 2D game engine" description, but chances are it is more than possible.
These days, managed code is quickly catching up to unmanaged code, and while it's not quite perfect, it is really impressively good.
It's not the language you need to consider as much as the Framework.
Suggest you look at XNA:
Your First Game - XNA Game Studio in 2D (step-by-step tutorial)
Also, DirectX:
DirectX Developer Center
Learn DirectX
VB.NET Already supports XNA including on Windows Phone 7. So if you are looking to develop games and if you language of choice is VB + XNA you are all set to go.
Take a look at the official announcement: http://blogs.msdn.com/b/lisa/archive/2011/03/28/xna-is-coming-to-visual-basic.aspx
Visual Basic's primary use is for Win 32 Apps with a standard GUI. If you are planning on building a game I definitely recommend C++. It has faster execution speed and better libraries for game development. Visual Basic will not deliver as good of performance of C++ would give you. IMO It would be better for you and the user.
I don't know much of the graphics issues in vb but as far as i have heard you can't create games for xbox using vb.net, it only supports PC.
XNA game studio can be used for game development. Although it is supposed for c#, you can find how to use it with vb in here...
http://www.alanphipps.com/VisualBasicdotNET-XNA.html
If you are still relatively new to programming then C++ is more than likely to make you quit early.
Don't aim at C++ until you have at learned C#.
C++ is a great and diverse language but definitely not friendly grounds for anyone who hasn't been programming for a long time. This is ESPECIALLY considering if your first language is one such a VB.
To Answer the Topic?
Yes vb.net can make a game, arcade,FPS,RPG,MMO or what ever you what within your ability to code. if you wanna learn some find playing with open source engines to get the feel helps. so try looking up some and give that a go.
my comment is at the person above's comment,
Visual Basic can do alot, and we find out new stuff all the time.
i seen vb6 game engines work well, graphical and feature wise.
wile visual basic is more down to earth for writing, C++ isnt ik its not, ive tried it.
but VB i can pick up easyr.
my experience ?? 2007 to present day, ive work with vb6 mmo game engine source codes,
Mirage,Elysium,Eclipse,EA,EFF
ive also tried using irrlect engine years back.
for a beginner should learn VB.net or C# .
C++ is to complex.

Does Mono support visual basic (not .NET)?

Someone asked me today if it was possible to port a visual basic application to Linux or similar platform, I assumed it was .NET so I suggested to use Mono, but noticed that on their vb support page they only talk about vb 8 (.NET)
Does mono support non-.NET vb? In fact I'm not sure what he is using, I think vb6, I'm not sure of the versioning at all though.
No, VB6 is an entirely different beast from VB.NET. Mono is basically there to run (via JITting, interpreting or AOT-compiling) IL - the Intermediate Language that VB.NET and C# compile down to. (Of course it also provides the libraries and compilers.)
Running VB6 requires an entirely different execution environment, basically.
No, but you could take a look at gambas
Gambas is a free development
environment based on a Basic
interpreter with object extensions, a
bit like Visual Basic™

VB6 Parser/Lexer/Scripter

I've got a game in VB6 and it works great and all, but I have been toying with the idea of creating a scripting engine. Ii'm thinking I'd like VB6 to read in flat text script files for me and then lex/parse/execute them.
I have good programming experience, and I've built a simple C compiler, as well as a LOGO emulator before.
My question is:
Are there any tools that I can use, like Lexx/Yakk/Bison to help me? How should I approach this problem in regards to lexing, parsing, and feeding the commands back to VB6 so I can handle them? Is this idea a BAD IDEA in the sense that there are too many obstacles in the way (For example, building minesweeper in assembly, though not impossible, is very difficult, and a bad idea.)?
Use the Microsoft® Windows® Script Control because it is easy to integrate into existing VB6 applications. The control supports VBScript, JScript, or any other "Active Script" implementation.
I have used the Windows Script Control in four projects and it works extremely well. Very easy to integrate. I wish Microsoft would have given us a replacement in .NET, and made it as easy to use. (I understand the control is not needed in .NET, but having the ability to simply create an object that handles everything is nice.)
Windows Script Control
The Microsoft® Windows® Script Control
is an ActiveX® control that provides
developers with an easy way to make
their applications scriptable. This,
in turn, enables users to extend
application functionality through
scripts, much as they do with macros
today.
INFO: Where to Obtain the Script Control at http://support.microsoft.com/kb/184739. Includes links to other howto support articles.
Chapter 13: Adding Scripting Support to Your Application at http://msdn.microsoft.com/en-us/library/aa227413(VS.60).aspx
Designing a Calculator at http://msdn.microsoft.com/en-us/library/aa227421(VS.60).aspx
How To Use Script Control Modules and Procedures Collections, Inserted from http://support.microsoft.com/kb/184745
How To Use the AddObject Method of the Script Control, Inserted from http://support.microsoft.com/kb/185697
SAMPLE: SCRIPTEX.EXE Uses the ScriptControl with Visual Basic, Inserted from http://support.microsoft.com/kb/189484
Windows Script Control can be downloaded at http://www.microsoft.com/downloads/details.aspx?familyid=d7e31492-2595-49e6-8c02-1426fec693ac&displaylang=en. (Supported Operating Systems: Windows 2000; Windows 98 Second Edition; Windows ME; Windows NT; Windows Server 2003; Windows XP)
MSDN Search of "MSScriptControl.ScriptControlClass" at http://social.msdn.microsoft.com/Search/en-US?query=%22MSScriptControl.ScriptControlClass%22&ac=8
MSDN Search of "Windows Script Control" at http://social.msdn.microsoft.com/Search/en-US?query=%22Windows+Script+Control%22&ac=8
MSDN Search of "MSSCRIPT" at http://social.msdn.microsoft.com/Search/en-US?query=MSSCRIPT&ac=8
Unless you're doing it for your own instruction, you may want to try using Lua: VB6 - Lua Integration
If you're willing to use VBScript rather than VB6 you might be able to just use the MSScriptControl to run the commands rather than creating your own. Here's an article discussing using it from a .Net app, though it's an ActiveX control so should give you quite a bit of flexibility.
The control can be downloaded from here.
I've actually seen some quite reasonable implementations of compilers/interpreters in VB6[1] - It's not the language I would choose (few functional features, insufficent static type system), but with experience, you can outweigh these drawbacks and be quite productive - So why not.
You can use the GOLD parser generator that supports VB6 as a start.
[1]: Somewhere on PSC or in this download repository I think ...
Note that there is the MSScriptControl too.
There also appears to be an additonal alternative for VB6:
SadScript is an variant of VB6 most prominently used for VB6 as an scripting engine in MMORPGS .
See here for more : What is sadscript? Can I use it in vb.net? Why hasn't anyone I have asked heard of it?

Differences between migrating from vb6 to vb2005, vb2008, vb2010

I own a copy of vb2005 professional.
I need to migrate a vb6 project to vb.net
Is there any difference in terms of effort to migrating to these
editions of vb.net
thanks
I think it's slightly easier to target the later versions. I believe the PowerPack 3.0 was added for Visual Studio 2005: it included extra support for emulating the VB6 Printer object and shape controls.
Anyone who's read my other answers about VB6 migration should stop reading now because I've said this before... but I think it's relevant, so I'll say it again anyway.
Check out the Microsoft UK advice with a screencast explaining the 5 basic options for .Net migration. Decide which is best. People may advise you to just rewrite from scratch in .Net. Be cautious about this - you say your codebase is big, which is a danger sign for rewriting. Microsoft UK say
Performing a complete rewrite to .NET is far more costly and difficult to do well [than converting] ... we would only recommend this approach for a small number of situations.
I'm rewriting a lot of VB6 currently and what I've found so far is that the previous developers had to use a lot of third party and custom modules to implement what they need when a lot of it has been included in the base class library for .Net since then.
From what I've seen there's no easy way to migrate from one to another. A lot of effort goes into these migrations. The best thing to consider is whether you want to try to go line by line or examine the code, document core functionality, evaluate how well the software has worked over it's lifetime and then engineer a new design.
That's what I've ended up doing because a line for line rewrite is nearly impossible and a large pain. Compiling libraries and modules into COM to bring the functionality into .Net applications is a lot of effort and kind of a "McGyver" approach. That's why I just documented everything well, understood the process, then wrote as .Net software.
Specifically, what functionality are you trying to maintain? Have you written in .Net before?
In my experience the "migrate" is really a rewrite so it doesn't make any difference what version of Visual Studio you use. I'd use the latest.

Active X Development: VC++ or VB or Other technologies

We are in the process of creating active-x controls used within our application.
Since Microsoft stopped supporting classic Visual Basic, is it wise to use Visual Basic to develop the Active X control or the latest VC++/ATL/MFC libraries provide more feature where we can create controls faster by leaving Visual Basic flexibility?
We will not be able to use .NET/VB.NET/C# since the application is supposed to work inside containers and containers may not support latest .NET runtime.
Any other language is best fit for Active X control development other than VB and VC++?
I, personally, would recommend using Delphi for this. It is still actively developed, and has the control you get with C++, but a rapid development environment more like VB.NET.
#nobugz: If you are really interested what is ActiveX in Delphi, look at docwiki. Normally it is 100% source code (yours + VCL, VCL is also available as sources) with autogenerated COM wrappers. So all potential security problems are also in source code. If you find a security problem in VCL, please send a bug report to Quality Central.
Here is a good example on how to create ActiveX Controls with C# .NET
http://www.codeproject.com/KB/cs/CreateActiveXDotNet.aspx
By all means VB6 is the best language. After reading your question I feel that you are a VB6 developer. If you know VB6 and use it then why hesitate using it for producing ActiveX controls.
I program in Delphi as well as VB6 along with VB.NET and C# but creating ActiveX controls is the easiest in VB6 compares to all other development tools.
If you are hell bent on not using VB and if you are looking for an alternative then try out PowerBasic (commercial - very costly) or PureBasic (commercial but affordable) Get it from here or better still MinGW (a GNU C++ compiler).
I have to say that VB6 with a good book like Developing COM/ActiveX Components with VB6: A Guide to the Perplexed you will be up and running faster.