Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

berndg

@berndg
About
Posts
204
Topics
39
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • UK Panic Buying Fuel
    B berndg

    I think it's nation wide. I just saw a note in the news about it, too. I think it is that people think a petrol price rise from a little under one pound to a little over makes all the difference. I suggest driving less in the first place.

    The Lounge question

  • Is there a #define for Multi-Threading?
    B berndg

    I see. Duno.

    C / C++ / MFC c++ question

  • Is there a #define for Multi-Threading?
    B berndg

    Since it is your process that actually creates those threads, wouldn't you be the best person to know whether or how many threads are in use? It seems a bit hard expecting Microsoft to predict your source code. What am I missing?

    C / C++ / MFC c++ question

  • dynamic class instantiation in c++?
    B berndg

    The typical C++ approach to this would be like so: 1. Create an abstract base class that defined the interface common to all classes that might be instantiated with this mechanism. Assuming the popular musical example, make this base class an "Instrument" and give it virtual methods like "Play", "Tune", "ThrowAway", etc. 2. Create all classes that need instantiating so, and make sure they all derive from this base class: Flute, Piano, Viola, etc. 3. Read your configuration file, and evaluate it using a simple (or powerful) parser, like so: Instrument* parse(const char* word) { Instrument* result = NULL; if (!strcmp(word, "Flute")) { Instrument = new Flute(); } else if (!strcmp(word, "Viola")) { Instrument = new Viola(); } else ... ... } return Instrument; }

    C / C++ / MFC question c++ wpf linux help

  • Escape from Yesterworld
    B berndg

    Such a shame I have no use for Microsoft SQL Server. These guys certainly did a brilliant job advertising[^] it.

    The Lounge database sql-server com sysadmin career

  • Use of string in switch case
    B berndg

    I would recommend not to use the hash approach, for at least these: i) it is hard to maintain - always think a couple of years and several generations of fellow programmers ahead. Who's going to remember how to create the keys, why and when? ii) it is doomed to fail - hash keys are not unique, so there is a chance that two different strings produce the same key.

    C / C++ / MFC help

  • Use of string in switch case
    B berndg

    I can only guess and believe you might want to do something like this: switch (myString) { case "Blue": ... break; case "Red": ... break; ... } Trouble is, the C or C++ languages don't do that. C# does. Thus, one solution is to use C#. If you want to use C/C++, you must use nested if/else clauses to emulate the same effect, something like so: if (_tcsicmp(myString, _T("blue")) == 0) { ... } else if (_tcsicmp(myString, _T("red")) == 0) { ... ... } Doesn't look as nice, but, compared to the above fictivious switch statement, gives you control over the comparison algorithm (e.g. use _tcsicmp for case-insensitive comparison, or _tcscmp for case-sensitive comparison), etc.

    C / C++ / MFC help

  • pls suggest a gift
    B berndg

    http://www.iwantoneofthose.com/[^] always comes nice for small and funny presents fit for use with geek colleagues. The gyroscopic arm twister[^] or the L39 Fighter Jet[^]always come nicely.

    The Lounge

  • WinExec
    B berndg

    You may not have VS, but you have the Internet[^]. ShellExecute performs verbs on an object. This can be "open" (verb) abc.zip (object), or "print" zorro.doc - anything that is registered within the local system. Your application need not even know what the application is; and it will automatically use the user's default application. For instance, "edit" readme.txt will laucnh that file in the user's preferred editor for txt file.

    C / C++ / MFC

  • WinExec
    B berndg

    You're looking at ShellExecute(). Or, you should be.

    C / C++ / MFC

  • DLL
    B berndg

    Michael Dunn wrote: The DLL should go in the same directory as your EXE. ... or anywhere else on your search path. The MSDN description of the ::LoadLibrary() function details the search algorithm.

    C / C++ / MFC question

  • array in enum?
    B berndg

    As unsure as DavidCrow in what you mean. Assuming you mean an array of enumerated values, then the answer is simple: typedef enum { Blue, Red, Yellow } Color; Color colors[100]; Otherwise... please clarify.

    C / C++ / MFC data-structures tutorial question

  • Latest Microsoft patch deleted my user account
    B berndg

    You'll find that kind of effect if your account has been locked. This could happen if you (or maybe some software) tries to log on against cached account information (i.e. your domain controller is not accessible) with the wrong password more than 3 (?) times. This happened to me recently, but in my case I simply had accidentally used the old password. The fix involved driving 26 miles through London suburbia so that I could access the domain controller on its own network, reboot, log on, done. Account restored.

    The Lounge help csharp com security announcement

  • MP3 -> MIDI
    B berndg

    Google's your friend[^].

    The Lounge question

  • To Do or Not to Do
    B berndg

    Join the big company. You need experience first, and contacts, and a name in the industry. If everything still looks cool in 3 to 5 years, then revisist this decision.

    The Lounge question discussion lounge career

  • hang that hard drive
    B berndg

    I bought an external hard drive[^] - which is great but contains an annoyingly noisy fan for forced ventilation. Contained is a Hitachi Deskstar drive. Like most hard drives, this is only specified for horicontal use, or vertical use "on the side". I would like to hang it, or stand it up on the IDE connector (not physically, but orientiation-wise) - the idea being to allow for convection to flow freely without the noisy little bugger. Has anyone tried using hard drives in this orientation before? Good idea? Bad idea? Thanks.

    The Lounge visual-studio com sysadmin question

  • Google in the 60's....
    B berndg

    :-D:-D:-D:-D

    The Lounge com

  • Arrrrg. I need to vent off.
    B berndg

    No, C++ is not a type-safe language. It has better type-safety as ANSI-C does, but that's the begin and that end of it. Example: int eBool; bool bBool; enum { FALSE, TRUE } eBool; eBool = bBool = eBool = 1u; Where is that type-safe?

    The Lounge help learning

  • Arrrrg. I need to vent off.
    B berndg

    I don't have the time to dig through the ANSI-C papers, but I am pretty sure this is a valid (though unhelpful) C assignment, just like all these: unsigned int a = -2; signed char b = 128; unsigned char c = 500; unsigned short s = -1L;

    The Lounge help learning

  • Arrrrg. I need to vent off.
    B berndg

    You might expect a warning from a modern compiler maybe, but clearly it is not the compiler, but the ANSI-C specification that needs to face the criminal charges here. The assignment is as legal as assigning +128 to a signed (8 bit) integer, and many other cases. As long as implicit conversion rules allow for the conversion, it's fine as far as the language standard is concerned. Use PC-Lint to find these, and many other, issues!

    The Lounge help learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups