CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: LarryChen

Page 1 of 5 1 2 3 4

Search: Search took 0.04 seconds.

  1. Replies
    5
    Views
    231

    Re: A question regarding try/catch

    The function foo is designed like that turns out to be bad, right? So my understanding is that the function foo either re-throws that exception within the catch clause or doesn't catch that...
  2. Replies
    5
    Views
    231

    A question regarding try/catch

    Suppose someone else writes a function foo like this,



    void foo()
    {
    try{
    do something...
    }
    catch(CSomeException* e)
  3. Where should I put _CrtDumpMemoryLeaks in the code?

    To enable memory leaks detection, where should I put _CrtDumpMemoryLeaks in the code? For example, in the program I define a class A. A member function Load is defined in class A. The function Load...
  4. Replies
    2
    Views
    267

    A question regarding stl set

    Here is the code,


    #include <set>

    using namespace std;

    class A
    {
    public:
  5. Replies
    4
    Views
    296

    Re: A question regarding try/catch

    The problem is there is no way to decide whether it should return true or false when an exception is thrown. For example, when we call the statement "if thing one is not done" , it may throw an...
  6. Replies
    4
    Views
    296

    A question regarding try/catch

    Here is the code(psedo code),


    bool foo()
    {
    try{
    if thing one is not done
    return false;

    if thing two is not done
  7. Replies
    4
    Views
    261

    Re: A question regarding DestroyWindow

    Yes, DestroyWindow docs does reference CreateWindow and CreateWindowEx. Okey, I may assume if a window is created by calling CreateWindow, then it must be destroyed by calling DestroyWindow. But what...
  8. Replies
    4
    Views
    261

    A question regarding DestroyWindow

    If a window is created by calling Create, the function DestroyWindow must be called to destroyed it at the end? Thanks.
  9. Replies
    8
    Views
    499

    Re: A question regarding switch/case

    I thought case statement is like if statement. So in my example, when i is 4 and it meets case 1, then case 1 is not going to be entered. Why am I wrong? Thanks.
  10. Replies
    8
    Views
    499

    Re: A question regarding switch/case

    Actually, I expected the output to be just "zero". Since i is 4, so it doesn't satisfy case 1.
  11. Replies
    8
    Views
    499

    A question regarding switch/case

    Here is the code,



    int main()
    {
    int i=4;
    switch(i)
    {
    default:printf("zero\n");
  12. Re: A question regarding passing a variable from CView to CDocument

    I already fixed a problem you mentioned. I am storing a pointer to a object in heap instead of a temporary object. I attach the updated project with the post. If I don't store pointers(bool*), what...
  13. Replies
    10
    Views
    653

    Re: what is the type specifier for boolean?

    Okey, can I do something like this,



    char s[64];
    bool bVar = false;

    sprintf(s, "This is a boolean variable bVar = %d", bVar);
  14. A question regarding passing a variable from CView to CDocument

    I am attaching a sample project. Basically what this project does is that I initialize a variable map<CString, bool*> m_mapTest in CView::OnInitialUpdate and then pass the variable to CDocument...
  15. Replies
    10
    Views
    653

    Re: what is the type specifier for boolean?

    If there is not boolean specifier, then what is supposed to be the specifier for boolean variable in C++? Thanks.
  16. Replies
    10
    Views
    653

    Re: what is the type specifier for boolean?

    I did google it but didn't find the answer.
  17. Replies
    10
    Views
    653

    what is the type specifier for boolean?

    In the following exmple, how 'd I use sprintf when I have a boolean type of variable?


    char s[64];
    bool bVar = false;

    sprintf(s, "This is a boolean variable bVar = %?", bVar);

    What is...
  18. How to convert a regular dll project to a MFC extension dll project?

    If I drop this regular dll project and create a new MFC extension dll project, it will involve too much work. I wonder if there is relatively easier way to convert an existing regular dll project to...
  19. Re: A question regarding dllexport and dllimport

    Thanks for your reply. So in what situation the code is going to fail?
  20. Re: A question regarding dllexport and dllimport

    It is very simple. Here is the code,


    //AClass.h
    class AClass
    {
    public:
    __declspec(dllexport) void foo();
    __declspec(dllexport) void bar();
    };
  21. Re: A question regarding dllexport and dllimport

    In my last post, I tried to explain that if I use dllexport only without using a macro to switch between dllexport and dllimport, my app still works. In other words, I don't see why I need dllimport....
  22. A question regarding dllexport and dllimport

    Usually we use the following statements to export a class or member functions,



    #ifdef DLLMICRO
    #define DLLIO __declspec(dllexport)
    #else
    #define DLLIO __declspec(dllimport)
    #endif
  23. Replies
    4
    Views
    529

    Re: A question regarding array

    Thanks for the clarification!
  24. Replies
    4
    Views
    529

    Re: A question regarding array

    It is a shame I didn't know that. Thanks a lot for the tutorial.
  25. Replies
    4
    Views
    529

    A question regarding array

    Here is the code,


    #include <iostream>

    using namespace std;

    class B
    {
    public:
Results 1 to 25 of 120
Page 1 of 5 1 2 3 4



HTML5 Development Center

Click Here to Expand Forum to Full Width