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
N

nachilau

@nachilau
About
Posts
32
Topics
20
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Question about console windows
    N nachilau

    The way that I do it is AllocConsole(); m_hout = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleMode(m_hout, ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT); If you say that it is not true that when the child process get deleted, the parent process also get deleted, then I don't understand why my GUI get closed when the user close the console window.

    C / C++ / MFC question performance

  • Question about console windows
    N nachilau

    Hello all, I have written a program which contains a GUI windows and also a console windows. When the program start, I allocate a console window from Windows. When the user close the console window during the programming is running, my main GUI get closed at the same time too. What I think is that may be the console window process is a child process of the main GUI window, when the child prcoess get closed, its parent process will also be destoryed. However, the destcutor of my main GUI porcess didn't get called when the console get closed which cause a lot of memory leaks. Do anyone know why my main GUI window destructor did get called when one of it child process get closed? :)

    C / C++ / MFC question performance

  • Question about static variable that define in a function
    N nachilau

    Hello, Yes, I know that the static will created only once. But I want to know how C++ actualy implement this. And I want to know whether doing inline of f() will break the rule? Thanks! Nacho:)

    C / C++ / MFC question c++

  • Question about static variable that define in a function
    N nachilau

    Hello all, Would anyone tell me that how C++ prevent the static variable been created more than one? Eg, if I have a function that contains a static variable: void f() { static classA a; a.print(); } void main() { f(); f(); } How C++ prevents the static variable "a" inside the function to be constructed twice rather than once? If I inline the function f(), will it still works? Thanks!!!:) Nacho

    C / C++ / MFC question c++

  • Way to Prevent memeory leak?
    N nachilau

    Thanks! But do you know how the OS clean is up for me? You mean the OS will keep doing a background search for the memory leak? Am I right? Thanks!

    C / C++ / MFC question help tutorial performance

  • Way to Prevent memeory leak?
    N nachilau

    Thanks for your suggestion. I know the way the smart pointer works, but as what you said, since the Assert function never return, smart pointer is no use in this case. Also, if I throw an exception, then, the try and catch block will go around in my code. That is so messy then! But thanks for your comment!!

    C / C++ / MFC question help tutorial performance

  • Way to Prevent memeory leak?
    N nachilau

    Hello all, I have a question on about how to prevent to prevent the memory leak? I am writing a window program, and I have an Assert() so that if any fatal erorr occured, the Assert() will call Sleep(INFIITE) to stop the program, and print out the error message to the user. By doing that, the only way to exit the program after Assert() has been called is to close the window. However, it causes a problem which is that even though the desturctor of each classes in the program will be called when the user close the window, there may still some memory leak in the local scoop when I use Assert() like this, eg in funciton f() f() { char* name = new char[10]; Assert(AnyError(), "Fatal Error!"); strcpy(name, "Hello"); delete [] name; } For example, if I get the Assert() if I get any error in f(), then when the user close the window, I will have a memory leak for 10 bytes. What is the best way to solve the problem? I don't want to use the try and catch block since the code will be mess up with all those try and catch block. And I really want to stop the program when the fatal error occurs. Any ideas? Thanks! Nacho

    C / C++ / MFC question help tutorial performance

  • Big Endian and small endian
    N nachilau

    Hello All, Can someone suggest a fast ways to convert big endian to small endina? Thanks! Nachi

    C / C++ / MFC question

  • Reading .PSD file
    N nachilau

    Hello, Can anyone provide me some ideas or resources in order to read the .PSD file? I am more interest to know how can I read the layer information of in the .PSD file. Thanks! Nachi

    C / C++ / MFC question

  • Some questions about inline function
    N nachilau

    Hello all, I have some questions about inline function, if I have something like this class myClass { protected: int i; public: inline Set_I(int val) {i = val;}; } int main() { myClass c; c.Set_I(10); } I want to know what will actually happen. Since Set_I() is an inline function, the compiler will replcae the definition of the function in where the function has been invoked. However, in this case the inline is actually accessing the protected member of the class, so what will happen?? Thanks! Nachi

    C / C++ / MFC question

  • Questions about defining a funciton
    N nachilau

    Hello, You are right, I know that it does not make any sense, but I still don't know what is this, int const f(); even thought I never use it in my programming experience. But in some C++ test, people ask something about this, and what I know and what I have used is only something like this, void f(const int); or void f(int) const; and these both make sense to me, but not int const f(); therefore, the's why I would like to know whether this signature make sense to any of you. But anyway, thank you for all your suggestio! Nachi

    C / C++ / MFC question

  • Questions about defining a funciton
    N nachilau

    Sorry, it doesn't really help, I know how to use a constant data in a program, but I have some confussion when using in the definition of functions Thanks! Nachi

    C / C++ / MFC question

  • Questions about defining a funciton
    N nachilau

    Ummm, You said the second one char* const f(); does not exist, but if I write this in Visual C++, the compiler does not complain. Also, for the first one, I can actualy return something which is not a const, eg, const int f() { int i = 10; return i; } and it also works in Visual C++ too. And would you mind to tell me why's that? Thank you very much! ;) Nachi

    C / C++ / MFC question

  • Questions about defining a funciton
    N nachilau

    Hello All, Can anyone tell me that what is the different when declare function like const char* f(); and char* const f(); I would like to know what does this two function signature means. Thanks! :)Nachi

    C / C++ / MFC question

  • Some questions when declare a function
    N nachilau

    Hello, I have some questions about declare functions, when I declare a function, what is the different between const char* f(); and char* const f(); Thank for your help! Nachi:)

    C / C++ / MFC help question

  • How can I get the file size of a file
    N nachilau

    Hello, How can I get the file size of a file using standard C++ library (not MFC)? Thanks!! Nachi

    C / C++ / MFC c++ question

  • How can I check whether the folder is exist or not?
    N nachilau

    Hello all, I would like to know how can I check whether the folder is exist or not? Which function should I use in visual C++? and which library should I included into my program? Thanks! Nachi

    C / C++ / MFC c++ question

  • How to create an empty folder in Visaul C++
    N nachilau

    Hello, I would like to create an empty folder on the disk, which command should I used in Visual C++? Thank you for your help! Nachi

    C / C++ / MFC c++ help tutorial question

  • How to open a folder using MFC
    N nachilau

    Sorry, I am not really know how to use this function, is there any example so that I can study on, thanks! Nachi

    C / C++ / MFC c++ tutorial question

  • How to open a folder using MFC
    N nachilau

    Hello all, Currently, I need to write a program which allows the users to select a specific folder on the hard drive. However, I only know how to use MFC to allow the users to select specific file on the drive by using "GetOpenFileName()". Is there any way which allows users to select a folder rather than a file in MFC? Thanks!!!! Nachi

    C / C++ / MFC c++ tutorial question
  • Login

  • Don't have an account? Register

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