• Advertisement


  • Content count

  • Joined

  • Last visited

Everything posted by mishikel

  1. When I create windows of class TOOLBARCLASSNAME (i.e. a toolbar from CommCtrls), it always has a raised edge, as if the WS_EX_WINDOWEDGE extended style was applied...which it isn't, because I'm explicitly removing that flag from the styleEx parameter sent to CreateWindowEx. I've posted a screenshot that illustrates the problem. Anyone have any insight into this? I'm using straight Win32, no MFC or anything. Thanks, Matt Edit: Needed to remove the WS_EX_DLGMODALFRAME extended style using SetWindowLong after the window was created. [Edited by - mishikel on November 17, 2005 4:09:22 PM]
  2. AFAIK, they don't exist. I look for any now and then.
  3. That's because there is only one handle type, and it's just an int.
  4. This is a rather huge issue for my development house distributing apps to XP and Windows Server 2003. Apps seem to ignore the .dlls in the local directory and require them to be in WinSxS. "Side by Side" deployment of dlls I guess. Input from others on this issue is appreciated...
  5. C++ servey type thingy

    I prefer clarity. Your style doesn't really matter, since I've written and maintained everything. Matt
  6. Some links on the subject: 64-bit Programming Models Why did the Win64 team choose the LLP64 model? In Longhorn at least, your shorts, int, and longs are still 32 bits. Your long longs (which I agree is a pretty ridiculous name) and pointers are 64 bits. This is done to keep backwards compatibility with programs that rely on the layout of certain structures to read in binary data. See Raymond Chen's example, the BITMAPINFOHEADER struct. It's pretty common to see: BITMAPINFOHEADER bih; ... fread(&bih, sizeof(BITMAPINFOHEADER), ...)
  7. From MSDN: "The SelectObject function selects an object into the specified device context (DC). The new object replaces the previous object of the same type." Selecting an HBITMAP returns the previously selected HBITMAP, no? Matt
  8. MultiThreaded Debug w/DLL?

    Cygon, maybe you should add your response to this forum's FAQ?
  9. Sorry, but please: "deprecate" and "depreciate" are not the same.
  10. Multithreading questions.

    My opinion on multithreading is that, in the past, multithreading was useful to prevent one fast resource (i.e. the CPU) from stalling while it waits on operations to complete on a slower resource (i.e. hard disk, socket, etc). Nowadays, it isn't that uncommon for machines to have multiple physical CPUs, or multiple logical CPUs if hyper-threaded. In that case, without multiple threads your application cannot access the full CPU power of the machine.
  11. OpenGL and DirectGraphics are just APIs to the graphics card. Both represent an interface to features commonly found on today's hardware. There really isn't any difference anymore. IMHO, the only valid reason to differentiate between them: 1) style 2) LH vs RH coordinate systems 3) availability of articles, code samples, tutorials, &c. 4) the cross-platform issue Honestly, if you are a graphics programmer, the API you use doesn't really matter.
  12. How familiar you are with Win32? Overview of SysLink Controls should provide you with all the necessary information.
  13. Quote:Original post by Evil Steve And I always wrap my dialog/window message procedure in a class (Using GetWindowLong and SetWindowLong to set the pointer to the class, and fetching the pointer in the static message procedure). This doesn't work too well since messages are sent to the window proc before CreateWindowEx returns. Since you haven't associated the C++ class pointer at that point you are missing a whole bunch of messages. Better yet: install a hook with SetWindowsHookEx with idHook == WH_CBT. The hook function allows you to monitor the system for certain events. When your hook is called with nCode = HCBT_CREATEWND, and you can get the HWND of the new window from the WPARAM parameter. At this point, you have the HWND even though the window hasn't yet been created. Search MSDN for SetWindowsHookEx and CBTProc for more info. Matt
  14. Quote:Original post by chollida1 The one point you mentioned, only one return statement, is one I do agree with. It makes code much easier to read and maintain. Allthough I'll agree you can always come up with a contrived example that breaks the rule. That makes sense in C. Not so much in C++ with RAII and exceptions.
  15. DLL shared memory

    An EXE and a DLL have separate heaps only when not linked against a CRT DLL.
  16. Try typename ResourceMap::iterator.
  17. Triangle mesh optimization !

    Look into nVidia's MeshMender. I believe you can download it at their web page.
  18. The two ways that immediately come to mind are passing the username/password as command line arguments or place the username/password into shared memory. The launcher creates the shared memory, creates the game process, which opens the shared memory. Search MSDN for CreateFileMapping/OpenFileMapping.
  19. Sorting std::list?

    Quote:Original post by Dead Eye if i do recall right, std::deques are guaranteed to be contiguous, and you could use a deque instead of a list. std::deques are not contiguous. Perhaps you were thinking of std::vector?
  20. The Doom 3 SDK contains what seems to be the full source for a memory allocator with some pretty intense claims. From the header: "This is a replacement for the compiler heap code (i.e. "C" malloc() and free() calls). On average 2.5-3.0 times faster than MSVC malloc()/free(). Worst case performance is 1.65 times faster and best case > 70 times." Has anyone tried compiling this allocator into their own code and testing the claim?
  21. Problem catching exceptions

    You can't throw an exception in one thread and catch it in another.
  22. Problem catching exceptions

    Quote:Original post by Leadorn ... I'm using threads, but im not throwing from one thread and catching in another. ... Nor will you, since each thread has it's own stack.
  23. Optimize through VC++ .NET?

    Quote:Original post by xsirxx ... Ive profiled in .NET and the slow down is in std::vector takes up 97% of the time. Profiled in release mode on VC6 and vector takes up about .000000000001% of the time. Its there. ... In which std::vector functions are you seeing the 97% time?
  24. Q: C++ const &

    I'll echo Enigma. const-ness of functions should follow observable state. hence the mutable keyword.
  25. class A; class B { public: B(A* a) : parent(a) { ... } A* parent; }; class A { public: A() : b(new B(this)) { ... } boost::shared_ptr< B > b; }; Writing something like this generates a level 4 warning using MSVC 8: "warning C4355: 'this' : used in base member initializer list". When is it safe to do this, and when is it not safe?
  • Advertisement