Celvin

Member
  • Content count

    7
  • Joined

  • Last visited

Community Reputation

122 Neutral

About Celvin

  • Rank
    Newbie
  1. Quote: For the HINSTANCE, I think it is the handle on the process that Windows makes available to the user, when it creates the process. Nope, a HINSTANCE is not a process handle (such as returned by OpenProcess). For a quick description, see http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx If you're curious about why you need to pass a HINSTANCE to CreateWindow, see http://blogs.msdn.com/oldnewthing/archive/2005/04/18/409205.aspx
  2. It works, but only on my PC

    Quote: Try throwing out a few IsBadReadPtr() here and there, see if it helps your code. I agree with http://blogs.msdn.com/oldnewthing/archive/2006/09/27/773741.aspx
  3. How can I create a window in pixels?

    Try the AdjustWindowRectEx function to set the area of the client window rect. http://msdn2.microsoft.com/en-us/library/ms632667.aspx
  4. Exceptional problem

    Quote: [...] because DLLs and exes do not share the same heap Says who? Guess you meant to say the heap management structures could be different, depending on what toolchain / language you used to create the DLL (could be a different one as the one used to develop the application), which could corrupt objects on the heap. But in general, unless specified otherwise (HeapCreate() etc.), a DLL shares it's application's heap.
  5. Quote: Java memory allocation is actually more efficient than that of C++. Quote: Java creates objects faster than C/C++ can malloc(). That's bull actually. What both of you probably meant to say was that memory allocation in a typical Java application has reduced costs when compared to a similar application written in C/C++. It's not that these costs are part of the languages themselves, it's part of your application's / JVM's implementation. As an example, Sun's HotSpot JVM requires that the heap's virtual addresses are contiguous, thus allowing the JVM to allocate new objects on a previously allocated heap chunk by simply doing some pointer arithmetic - that's quite fast as you might imagine. What people usually don't get though, is the fact that this custom memory allocation scheme could of course also be implemented in your "average" C/C++ application - after all, that's just what the JVM is at it's heart (you would have to evaluate situations where this made sense, obviously).
  6. fprintf.c as _ASSERTE(str != NULL) error

    First of all, you are not supposed to keep on posting the same crap over and over again until somebody tells you to stop. Second, you'd really increase your chance of getting an educated answer if you would go ahead and post relevant snippets of your code, instead of asking if somebody bought the same book as you did.