Two programming questions--

Discussion in 'Trading Software' started by bungrider, Jul 15, 2003.

  1. If someone could answer, I'd be grateful--

    1)what is the diff between C++ and C#?? (Not looking for complicated answer -- just have no idea what diff is and want to know which is better to learn)

    2)can you code a password into a visual basic program to make it secure? say i have a window pop up when the program is launched that asks for a password which is hard-wired into the code and thus compiled -- the program won't go any further until that password is entered -- it'll shut down if the wrong password is entered -- is that pretty secure? or can someone with a debugger like softice still run the program?

    thanks in advance,
  2. I will let others answer the C++ vs C# question. As for the hardcoded password, it would be relatively easy to find if you just have it in the code in clear text. If you go the hardcoded route, encrypt the password, then enter the encrypted password into the code, then whenever you need to compare, encrypt the password that the user entered and compare that to the encrypted password in the code.
  3. 1. Elimination of pointers
    2. Garbage collection (eliminate those nasty memory leaks)
    3. Object-oriented framework (all classes derived in object hierarchy)

    Think of C# as a Java-nated C++.
  4. Thanks, Jerry. Is the encryption available in most VB development packages? (I'm a newbie so I'm using the MS VB 6.0 working model edition that came with my VB book :D )

    Thanks, PTR -- being a newbie, I'm wondering if you mean being java-nated is good or bad? Sounds like you're implying that C# is an improved version of C++, yes? If so, would it be better for me to go ahead with C# and skip C++?

    And how do you say "C#"? Is it 'C number' or 'C pound'?? :confused:

    Thanks again,
  5. monkey


    c-sharp. like in music.
  6. bungrider, pretty much any encryption would work. The point is mainly to make it so that its not obvious when you look at the EXE file with a hex editor where the password may be. We do that for any sensitive strings that we have in our software.
  7. bungrider - don' t take this the wrong way, but based on your questions about using a password in VB, it's probably not a good idea just yet to jump into C++ or C#. Neither are especially easy for someone new to programming (and C# needs the .NET development environment - sounds like you've got the 6.0 IDE).

    You might try pulling up a chair at Barnes & Noble or Borders and plow through a couple good books on VB first before diving in head first.

    Also, VB6 is being phased out in lieu of VB.NET - so keep that in mind (there are also a lot of differences between VB6 and VB.NET - so if you can start out with VB.NET, it'll probably be easier than unlearning old VB6 habits when you try to transition).

    C++ is a whole different animal from the VB environment. Lots of very bad C++ code out there - a lot from old C programmers that didn't make the transition well, so if you delve into it be sure what you're looking at.

    C# is different still - but if you have access to it and want to jump from VB to C, go directly to C#, do not pass C++, do not collect $200.

    Good luck.
  8. CalTrader

    CalTrader Guest

    If the password is embedded in the program, a dedicated intruder will disassemble the code, trace it, and extract any decryption/encrption if it is contained within the code. If you want a truly secure solution then this will not work - although it will deter casual intruders.

    C language is still around and works well in the hands of a skilled practitioner: C++ is better mainly because it allows inheritance which allows you to potentially reuse code. Caution: few people have enough experience to design good c++ infrastructures.

    VB6.x works very well on windows systems and you still have about 2 years of support for this: Vb.NET and C# are microsoft's replacement for VB6.x and C++: C# is meant to be a java alternative for windows systems - MS cant use java due to lawsuit issues.

    So, choose depending upon your design goal and your existing knowledge. VB6 works just fine so if your needs are modest you can use it: it wont really work for a commercial product due to lifecycle and programmer acceptance issues ....
  9. lhclin

    lhclin TickQuest

    The problem with C++ is not the
    language itself but Microsoft's framework.
    Visual C++ is mess.

    You will almost for certain get your
    job done faster with any other
    language/compiler. If you have to
    use C++, use Borland's C++ Builder.
    #10     Jul 15, 2003