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.
Related
I am looking for an interpreter (compiler would work too) for Visual Basic or VBA. I am not looking for any kind of UI support. Basically, I have a series of somewhat complex VBA modules which make no reference to any external DLLs and make no use of any user interfaces. Is there any such tool available short of having Microsoft Office or Microsoft Visual Basic for the Windows operating system?
VBA only exists as an embedded "macro language" inside a host application like Excel. At one time you could even buy the SDK to embed VBA in your own applications, but there was never any "stand alone VBA."
VBScript is close to VBA and VB in syntax and semantics, but it also requires a host. Common desktop hosts include WSH, MSHTA, and the Vista/Win7 "gadget" framework. That's probably your best bet if it meets your needs.
It is remotely possible to do what you want using VB5CCE (Control Creation Edition) if you can find it. This was free, but could not compile to EXEs. It might have worked as an interpreter however by running it with the /run switch. I'm not certain of that though.
There are 3rd party freebies as well such as Jabaco which uses a very VB/VBA-like syntax.
Update: VB5CCE does not support the /run switch.
This might be worth a peek if VB.NET is a fit. Visual Studio Express ... I'm not sure what the free version leaves out though.
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-basic-express
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™
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?
In Ironpython site exists references to a language called VBx using DLR. But i can't find any reference to this in google. Where is it?
Edit: Is a Implement of Visual Basic 6.0 in DLR? if yes is so cool. Is more expected for people using VB6 yet and can't migrate because big frameworks.
From this mailing list post:
VBx was an implementation of Visual Basic on the DLR. It was first meant
to be in Silverlight, but the VB team decided they'd rather put VB.NET in
Silverlight rather than build a new implementation up from scratch. So, VBx
is on hold.
Apparently it's an implementation of VB in the DLR:
http://www.mail-archive.com/users#lists.ironpython.com/msg05933.html
Straight from the mouth of Paul Vick (long time VB architect)
What is VBx?
VBx was one of the four language implementations that were originally driving the design of the DLR, the other three being IronPython (from which the DLR was extracted in the first place), IronRuby and Managed JavaScript.
VBx was intended to be a dynamic version of Visual Basic.NET or a .NET version of Visual Basic 6, whichever way you want to look at it. It was primarily intended as a testbed for the flexibility of the DLR, secondarily as a testbed for a more dynamic version of VB.NET and tertiarily (is that a word?) as a scripting language for Silverlight. It has fulfilled its primary goal and the designers of VB.NET decided that they want to pursue goals two and three within the existing VB.NET language, rather than producing yet another slightly different incompatible version of VB. (You already have VB.NET, VB, VBA and VBScript.)
Managed JavaScript was also abandoned, the team was folded into the IE team and is responsible for the ECMAScript 5 engine in IE 9.
I am less than a week into my Visual Basic education. I have downloaded Visual Studio 2008 and am teaching myself Visual Basic 2008 in hopes of landing a particular contract position.
In the meantime, a friend of mine told me that it is not recommended to write a Windows Service with Visual Basic. Is that true? Could he be referring to some much older version than 2008? Does the .NET version come into play?
What is at stake is that the company that my friend works for is going to completely re-write a component of their flagship product at great cost and expense and simply abandon their existing VB code. If the only hang-up is getting it to run as a service then they could save a lot of money if Visual Basic could, in fact, run reliably as a service.
You can write .NET services in any CLR language, including VB.NET --- your friend was thinking of VB6 and earlier.
(I do recall some fairly crazy kludges that allowed services to be written in VB6, but for all practical purposes, services written in VB6 weren't really a viable solution...)
There is no reason that Visual Basic .Net can't write a windows service. You can select a project which will create a windows service under the "Windows" projects in the Visual Basic section.
Writing a Windows Service in VB.NET (using any version of Visual Studio >= 2003) is just as effective as writing a Windows service in any other language.
Your friend may have been thinking of Visual Basic 6...or he's partial to another .NET language.
In either case...you should be fine to keep going on your path the way you are.
Your friend may be referring to Visual Basic, not VB.NET.
While VB.NET has syntax that is similar to Visual Basic and some convenience functions are still present, they are two entirely different languages and environments.
Your friend is correct in stating that Visual Basic (meaning 6 and earlier, not VB.NET) is a poor choice of a language for a service (or any new application), but VB.NET is every bit as legitimate as C# or any other CLR language.
It may be useful to refer to what you're learning as "VB.NET" or "Visual Basic .NET", rather than just "Visual Basic".
.NET certainly allows you to use Visual Basic to write a Windows Service. I believe there is even a default project template to do so. Here is an tutorial as such: http://www.vbdotnetheaven.com/UploadFile/mahesh/Winservvb11172005233242PM/Winservvb.aspx
All .NET code is converted to an intermediary language that is executed, thus all .NET languages can be used to write a windows service.