|
Kevin McFarlane wrote: I don't think so.
OK, well, you're welcome to your opinion. I hope I'm also welcome to mine.
Kevin McFarlane wrote: We don't know what the OP's context is.
That's true. However, people do still learn VB6, and some schools still teach it. I'd stand by my advice. I left a job I loved because we moved from C++ to Python, and I didn't think that learning Python was a good career move ( or, more specifically, I thought it was better to keep improving my C++ ). If I had a job that suddenly required VB6, I'd look for another. I've turned work down because it was VB, in the past.
Kevin McFarlane wrote: Lots of code being maintained in VC 6.
True, and if I have to maintain it, I often would stick with VC6. But, I sat in a room of C++ MVPs the other week, and most of them said they would write new code in VC6, because they hate the new IDE. It's still happening, and it just doesn't gel for me, the STL in VC6 was awful, there are so many deviations from the standard, why stick with it ?
Kevin McFarlane wrote: IIRC you take a dim view of MFC devs using the MFC collection classes instead of STL?
Of course, that's just ignorance. MFC containter classes offer nothing that STL classes do not, and the reverse is most certainly not true. Historically, MS wrote those classes only as a stop gap until they had an STL implimentation in their compiler.
Most of my C++ work was in MFC, but I found a huge productivity gain in moving to the STL containers, and it meant that when I was writing non MFC code, I already was intimately familiar with the containers that I had no choice but to use, when MFC was not there.
Kevin McFarlane wrote: I just think you need to find out where an OP is coming from before slagging off their choice of tools.
Were the OP to reply that they have no choice, I would offer my sympathy. It would not change my opinion of VB6 as a tool, it seems to me that VB was written to be easy to use, and that the design process for the language was sloppy, to say the least. VB.NET is full of stuff from VB6 that MS tried to do away with, and had to keep due to a revolt ( the VB6 devs are revolting... :P ). VB.NET is at least roughly as powerful as C#, but I'd still recommend C# to a new dev over VB, VB is just full of nastiness and voodoo, it's considerably harder to read, IMO, and the weak typing can lead to all sorts of nasty things happening when you didn't ask them to.
Overall, I have no problem with VB.NET, if I did, I would not be here, trying to help people who use it. I would never advise anyone to use C# over VB, unless they needed to do image processing, or something else that required pointers. VB6 is a whole different ball game. If someone is learning it in 2006, I'd seek to make sure they realise that what they are learning is a dead language.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: But, I sat in a room of C++ MVPs the other week, and most of them said they would write new code in VC6, because they hate the new IDE. I
Well, I'm with you there. I've not done any C++ with the .NET-era IDEs. But if I were told to cut some new C++ and was given a choice of IDEs, naturally I would use the up-to-date ones - even if I happened to prefer the old IDE.
Christian Graus wrote: the STL in VC6 was awful, there are so many deviations from the standard, why stick with it ?
At the start of 2005 I was doing some VC++ 6 maintenance. I used some STL and my boss at the time objected saying: "we don't use STL here." I don't think he was objecting to the VC++ 6 implementation, he just didn't see any benefit over MFC. Fortunately it was only a 3-week project.
(Actually, I've found in the past with C++ that many have barely heard of anything beyond raw arrays and pointers. Even using MFC collection classes is an advance! Stroustrup has ranted on this - in a good way.)
Christian Graus wrote: VB6 is a whole different ball game. If someone is learning it in 2006, I'd seek to make sure they realise that what they are learning is a dead language.
Fair enough.
Kevin
|
|
|
|
|
Hi guys, the name pretty much says it all, I am as far as savedialogfile but i am completly stuck. My aim is to save a .txt from a textbox with a button.
Thanks in advance, Brad
|
|
|
|
|
In VB2005, there's something like File.SaveAllText("filepath", "Text");
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi, thanks for teh reply, i still cannot get it to work. Any more ideas or anything specific to know.
Thanks
|
|
|
|
|
The problem is sufficiently trivial that if you define 'cannot get it to work' and post your code, I'm sure I can help.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Christian, At the moment i acually have no code for what i want to do as i have been trailing and erroring for a few hours now but here is screenshot of my design and the code for the form so far. 'button3' is what i want to actually save me file, as of the above posts i want to edit the textboxes and then save/overwrite teh existing file that it is reading from. Hope this helps you out with helping me.
[IMG]http://i124.photobucket.com/albums/p14/Br4dZ/code.jpg[/IMG]
Thanks again
|
|
|
|
|
I'm at a loss. I gave you one line of code, and you're saying you have no code in your app yet, but the line I gave you doesn't work ?
File.WriteAllText will indeed overwrite the file at the path you provide, with the string you pass into it. Which bit is causing you grief ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
VB kep throwing expression errors, i have tried to work around it but it is not working at all, I am 18 and been coding for a few months so please excuse my stupidness.
|
|
|
|
|
Oh, my bad.
It's System.IO.File.WriteAllText
if you don't have System.IO scoped in already, you need to put the whole thing.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
VB keeps on thrwoing expression errors when i use your code and havw tried to work around it to get it to work but no luck. Please excuse my stupidness as i have been coding for a few months.
|
|
|
|
|
My.Computer.FileSystem.WriteAllText("C:\filename.txt", TextBox1.Text, True)
That is how I have done it! Thanks for the help Christian!
|
|
|
|
|
No problem. That's a shortcut for System.IO.File.WriteAllText, it does the same thing. My is a shortcut for VB only, not C#.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Dim SaveStream As System.IO.StreamWriter<br />
SaveStream = New System.IO.StreamWriter(directoryasstring.txt)<br />
SaveStream.Write(texttosaveasstring)<br />
SaveStream.Close()
Posted by The ANZAC
|
|
|
|
|
how to add reference to the aracle database.dll
in vb.net????
|
|
|
|
|
You've asked two questions
1 - to make a dll, create a class library project.
2 - to reference to a dll, right click on the references area of the solution explorer and choose 'add reference'
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
u mean addref--.net tab--oracle database.dll
but here i cannot fine oracle database.dll
can u tell me the exact path where it actually reside
|
|
|
|
|
Probably because you haven't installed something. You can find it here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
It's System.Data.OracleClient in the list of .NET references. You do not have to add anything that's part of Oracle ( and unless it's a .NET or COM dll, you couldn't any how )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
Is it possible to specify that a sub/function argument should implement two or more interfaces?
What i mean is something like this (of course this doesnt work):
Private Sub DoSomething(ByVal x As {IFirst, ISecond})
'Do it
End Sub
Thx,
Banjobeni
|
|
|
|
|
No.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
If ISecond inherits IFirst then you could accept anything that Implements IFirst, which would also include anything that implements ISecond. However you would be limited to only the methods and properties found in IFirst. If you needed access to properties/methods found in ISecond you would have to test the object to see if it could be cast as ISecond and if so act accordingly. If those are completly seperate interfaces then no it's not possible.
|
|
|
|
|
What is the easiest way to test if an object can be cast as something?
|
|
|
|
|
if (myOb is IMyInterface)
{
}
or
IMyInterFace myInt = myOb as IMyInterface;
if (myInt != null)
{
// It worked
}
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|