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
S

Shankar Chandra Bose

@Shankar Chandra Bose
About
Posts
24
Topics
14
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Sniffer
    S Shankar Chandra Bose

    Yes, I know that's not a very appealing name, but I am working on a module that needs to detect the type of file...not whether .doc or .rtf or the like, but more like...whether it's a CSV file, XML file, line printer file ... you get the idea. This is to make the user's life easier by detecting/pre-scanning what file he's selected, so I can make some informed choices on his behalf earlier (surprise! intelligent software!!). There are additional complexities, such as if it's a CSV file the delimiters could vary etc. Are there any good algorithms anyone can point me to? Or just even some general coding ideas would be great.

    IT & Infrastructure xml question lounge

  • CListCtrl - 2
    S Shankar Chandra Bose

    Hi, Am using an owner drawn list control, and I handle the WM_MEASUREITEM message to set the item height. Problem is, this message is sent only when a window is created (or so the MSDN documentation says). I'd like to set the item height, in response to user button clicks (to provide for the effect of zooming items)-this would let the user increase or decrease item heights by clicking buttons. Problem is, as noted earlier, the message is sent only when the list control is created-how do I set the item height, without destroying and creating the control again? Any help is much appreciated. --Shanker. "When it's done" - 3D Realms.

    C / C++ / MFC help question

  • S.O.S ---- CListCtrl
    S Shankar Chandra Bose

    Chaps, Am using an ownerdraw VIRTUAL list control (an example of this can be found at codeproject in an earlier program I wrote-the hextext control). How do I set the HEIGHT of an item in CListCtrl? I am not using any image lists/bmps or the sort at all...totall owner drawn, I do my drawing in OnDrawItem. I am passed a DRAWITEMSTRUCT pointer that contains the bounding rect, hdc, etc...that I need. Problem is, I want to set the item HEIGHT. In other words, I need a way to alter the bounding rect-before I get it in the OnDrawItem. Icons/imagelists are out, as I am usign the virtual style. Each item is completely under my control-I am responsible for rendering it. Any suggestions would be very much appreciated. "When it's done." - 3D Realms.

    C / C++ / MFC question graphics help tutorial

  • If you're interested in graphics...
    S Shankar Chandra Bose

    Anyone into hardcore graphics? (Christian, DO YOU HEAR ME???) Well, rejoice, because Michael Abrash's Graphics Programming Black Book is available for download on the web. )(This book, by the way, is now out of print). Try the following URL: http://www.ddj.com/articles/2001/0165/0165f/0165f.htm Of course, you can also order the DDJ CD with this book on it, as well as some other cool graphics books. But once I knew you could download this mother of a book...

    The Lounge learning com graphics question

  • It might be easier if somebody just shot me
    S Shankar Chandra Bose

    Check out GetTextExtentPoint32() API function. I've a strong feeling this is what you need. -Shanker.

    C / C++ / MFC com help tutorial

  • So, how good are you? ;) (C/C++)
    S Shankar Chandra Bose

    Bingo! I'd say your wife is lucky. On the other hand, you could be a nerd...:)

    C / C++ / MFC c++ question

  • So, how good are you? ;) (C/C++)
    S Shankar Chandra Bose

    oops, wrong answer, Frederick! See the other posts!

    C / C++ / MFC c++ question

  • So, how good are you? ;) (C/C++)
    S Shankar Chandra Bose

    Here's a test for all you C/C++ programmers: anything strange in the following code fragment? (Try not to compile it, okay? Just see if you can spot anything strange!) char ch; for (ch = 0;ch <= 255;ch++) std::cout << ch;

    C / C++ / MFC c++ question

  • STL container of multiple types
    S Shankar Chandra Bose

    Hmmm, off the top of my head, may I suggest you try creating your own struct/class that holds a string, float, int, etc. Infact, this is how VARIANTs in VB/COM are implemented under the hood anyway. Then use this struct/class in your maps, lists, and other STL structures. You might want to experiment with unions as well. You could also take a look at MFC's COleVariant, and see if you can bend it to meet your needs (this is mostly used for database related stuff, but am sure you can use it for other needs as well).

    C / C++ / MFC c++ docker data-structures question

  • Simply Awesome-check this out
    S Shankar Chandra Bose

    http://www.geisswerks.com/drempels Cheers, Shanker.

    The Lounge com

  • Ah, pointers...
    S Shankar Chandra Bose

    Won't forget that in a hurry-it works, thanx Mike. I did try (char*)[10] - this didn't work, though I thought that was intuitive :) Looks like the right to left rule of reading declarations might come in handy even in areas such as this! Cheers, Shanker.

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

  • Ah, pointers...
    S Shankar Chandra Bose

    Chaps and fellow geeks, I have a pointer to an array of 10 chars (note that this is different from an array of ten chars, which allocates 10 bytes, the former allocates 4 bytes). This means, whenever I increment the pointer, I can skip by 10 bytes. I then proceed to allocate 100 bytes of storage (as I want to treat it as a 10 by 10 array). Trouble is (well, not really trouble), when I use new to allocate 100 bytes for the pointer I need to typecast the pointer returned by the new operator to the type of "pointer to an array". Towards this end, I have typedefed CHARTENARRAY as a pointer to an array of 10 bytes. I then typecast the return value of new like so: pArray = (CHARTENARRAY) new char[100]; I would like to know if there is a way of doing this *without* the typedef. How would I typecast it? In general, what would be the cast for a pointer to an array of x bytes that is returned, by the new operator when it is used to allocate x bytes? To make things clear, here is the source (with lots of comments), you can compile it and run it if you'd like to experiment: typedef char (*CHARTENARRAY)[10]; // typedefines CHARTENARRAY to be a pointer to an array of 10 b CHARTENARRAY pArray = NULL; pArray = (CHARTENARRAY) new char[100]; // need to do this WITHOUT the (CHARTENARRAY) typedef. for(int i = 0; i < 10; ++i) { strcpy(*pArray, "HELLO!"); // Fill in 10 "HELLO!" strings in 10 slots ++pArray; // increment by 10 bytes (scalar) } pArray -= 10; // Go to array start (will decrement by 100 bytes, since scalar is 10) for(i = 0; i < 10; ++i) // Display routine { puts(*pArray); ++pArray; // Go to next string } pArray -= 10; // Go to array start delete [] pArray; // Free

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

  • Creative Coasters?
    S Shankar Chandra Bose

    Chaps, I've collected heaps of CD coasters over the years (no doubt many of you will have, too). Before I throw them out, I'd like to ask: has anyone come up with a creative use for CD coasters? (other than a coaster, that is) Anything...some new age artwork, decoration in your office, other innovative uses? Let's hear it, 'cos I'd like to put my dead CDs to good use! -Shanker. "It *is* rocket science".

    The Lounge question

  • Pictures from E3
    S Shankar Chandra Bose

    Geez Chris, you're missing out on some of the finest gaming entertainment out there. I play games to stay sane :) Nothing like a game to let u unwind for the day-you feel much refreshed, ready to program again after a while ;) For insane action, Quake 2's my fav. Of course, some of the better/addictive games u could try are Diablo 2 and Half Life (though I wonder if you've already played any) Wonder how many of our fellow codeprojecters play games? Did we have a poll?? Cheers, Shanker.

    The Lounge html com

  • Unicode File I/O
    S Shankar Chandra Bose

    I've been trying to use std::wifstream to read a unicode file, like so (in a project with UNICODE on): std::wifstream wf; wchar_t wch; wf.open("unicode.txt"); while(wf.get(wch)) { std::wcout << wch; } wf.close(); Funny thing is, this *still* reads the file byte by byte, NOT wchar_t by wchar_t. This means that if you had a 000D in the file, you'd get a 00 followed by a 0D, NOT a 0D as you'd expect. On the other hand, using the C style FILE* does work properly, as: FILE* fp = _wfopen(L"unicode.txt", L"r+b"); wchar_t wch; while(!feof(fp)) { wch = fgetwc(fp); std::wcout << wch; } fcloseall(); The above code accomplishes what I want. However, as I am not too keen on using just C or Win32 functions, can someone shed somelight on what's going on? Thanks in advance, Shanker.

    C / C++ / MFC question

  • Feedback wanted
    S Shankar Chandra Bose

    Heck, you'd love it!! Hopefully we will start off in Aus next time :) Cheers, Shanker. If at first you don't succeed, then perhaps sky-diving isn't for you.

    The Lounge beta-testing tools question code-review

  • Feedback wanted
    S Shankar Chandra Bose

    Ah...so you're a FRIENDS fan, eh Chris? Heh heh...let me know when you're gonna be in Melb-we can catch up if you're free. Cheers, Shanker.

    The Lounge beta-testing tools question code-review

  • Feedback wanted
    S Shankar Chandra Bose

    I'm in ;) Pity the tour got grounded-hope the next one kicks off in Australia. Cheers, Shanker.

    The Lounge beta-testing tools question code-review

  • E-TEAM
    S Shankar Chandra Bose

    Well, we sure have some responses and ideas. I personally like the idea of starting off by writing a VC++ plug-in that would let the user plan his project-bug lists, TODO lists, feature list and manage all this. Ofcourse, it's my opinion-so please everyone else voice your opinion. As of now, Chris, Frank, Colin, myself and (Mark?) comprise of a group that's interested in taking this further. Who else is in?

    C / C++ / MFC c++ collaboration help question

  • E-TEAM
    S Shankar Chandra Bose

    Chris, I agree with you. Collin Davies has made lots of useful suggestions-for ex, charge a small registration fee for use of the program. Anyways, as far as the projects themselves go I think a Windows Installer sounds good too. Or maybe even and ATL Chat control (client and server) exclusively for use at codeproject across members. Or how about an XML parser? Any more useful ideas on what we can work on? I do agree that starting off on a small to mid-size project is better as we can reap the results faster. Hopefully, members will vote for a project that is really useful. Looks like we're already 4-5 strong-hope it gets bigger. Once we get the team strength sorted out, we shall decide on what to work on. After that, we can move on to other issues like organizing lists for discussions, etc. ICQ and e-mail are great ways to communicate too. Not to mention Yahoo or MSN messenger. As noted before, we need IDEAS!! Let's hear more!

    C / C++ / MFC collaboration help question discussion
  • Login

  • Don't have an account? Register

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