Search:

Type: Posts; User: derder

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. What is the difference between const TCHAR*...

    What is the difference between const TCHAR* tempString and LPWSTR? According to msn.microsoft website LPWSTR is


    typedef wchar_t* LPWSTR, *PWSTR

    so LPWSTR is just a convention for easier...
  2. Displays text using DrawText after loading it from a file

    Hello, I am trying to display the text in win32 console window using DrawText after loading the string lines from a text file.

    Here's the code for the file loading:


    ...
  3. Replies
    1
    Views
    1,882

    Class Redefinition error

    Hello,
    I have a class in ClassManager.h declared as follows:



    #include "DebugWriter.h"

    class OutputManager : public DebugWriter {
  4. Replies
    1
    Views
    1,011

    C++ objects behave upon assignment

    Hello,
    I am trying to understand how C++ object behave in the following case.

    I declare a handle using windows HDC as follows: HDC myHDC.

    version 1:
    My function is delcared as follows:

    ...
  5. Replies
    3
    Views
    1,164

    How do you use enum delcared in a class?

    Hello,
    I have delcared a class with enum as follows:



    class TokenPrint {
    protected:
    public:
    static enum TokenType {TOKEN_ANCHOR=0, TOKEN_ARGUMENT_STRING=1,
    TOKEN_ARGUMENT_INT=2,...
  6. I am disgressing from my original subject in this...

    I am disgressing from my original subject in this post a bit, but I tried calling with string& and got a compiler error. Here's what I have delcared:


    TokenItem::TokenItem(char del, string &tok)...
  7. Question #3 When a C++ copy is made, does it make...

    Question #3 When a C++ copy is made, does it make a deep copy or shallow?
    I would all the primtivies such as int and anything can added to a stack is copied.
    How would an C++ object inside an...
  8. When is a c++ class deallocated if inserted vector but it goes out of scope

    I need to know when a C++ class is deallocated if it's inserted into a vector but later goes out of scope because it exits from a function call.


    I have written a function called Tokenize that...
  9. Replies
    7
    Views
    2,536

    I've found this code on the net: void...

    I've found this code on the net:


    void Tokenize(const string str, vector<string>& tokens, const string& delimiters){
    int startpos = 0;
    int pos = str.find_first_of(delimiters, startpos);...
  10. Replies
    18
    Views
    2,459

    Thanks!! That was the answer I was looking for....

    Thanks!! That was the answer I was looking for. So it seems passing objects without references is a much object-oriented and cleaner way of doing things. On the other hand, it's not very efficient.
    ...
  11. Replies
    18
    Views
    2,459

    That's say at the main.cpp, I declare the myObj...

    That's say at the main.cpp, I declare the myObj globally as follows:


    object_type myObj;

    Then at the main routine I have the following code and later passed to myFunctionReference and...
  12. Replies
    18
    Views
    2,459

    I initially asked if objects are created in my...

    I initially asked if objects are created in my declaraton:


    DCManager dcManger;

    You said no. However reading your quote above, it seems you need to add a default constructor. This implies that...
  13. LoadBitmap requires GetModuleHandle(NULL) as argument instead of hInstance

    Hello,
    I was playing around with LoadBitmap. Originally I got it working. Then the screen it load was "white" meaning the HBITMAP it returned was not NULL, but it was just as if nothing is...
  14. Replies
    3
    Views
    3,389

    I don't know what this means. I used Visual C++...

    I don't know what this means. I used Visual C++ 2011 expression to create a new C++ project.
  15. Replies
    18
    Views
    2,459

    I haven't been programming for 4 years. The...

    I haven't been programming for 4 years. The language I am thinking off when I wrote the question was c pointers. I can visualize c pointers as follows:


    int x=0;
    int *y=&x;
    int z=0;
    ...
  16. Replies
    18
    Views
    2,459

    If no then why is it in my code DCManager...

    If no then why is it in my code



    DCManager dcManager;
    ...
    WM_CREATE:
    dcManager= DCManager(dcImage);
  17. Replies
    18
    Views
    2,459

    I was too vague on the pass by reference with...

    I was too vague on the pass by reference with question 2. Here's what I meant:


    public:
    MYObj myObj;

    OutputManager::OutputManager(MyObj &_myObjArg) {
    myObj= _myObjArg;
    }
  18. Replies
    18
    Views
    2,459

    Ok, so I added a default constructor after the...

    Ok, so I added a default constructor after the compiler complains. In the WM_CREATE method, what happens when I create another object dcManager= DCManager? Is the previous dcManager created during my...
  19. Replies
    18
    Views
    2,459

    How C++ Objects are referenced

    Hello,
    I have a class that is instantiated as follows:



    It seems the compiler complaines that there's no default constructor when I use the following code "DCManager dcManager". This tells me...
  20. Replies
    3
    Views
    3,389

    Using HDC to initialize data structure

    Hello,
    I need to create a compatible DC and compute a font height. Both of these initialization steps require a handle to the device context called HDC.



    Should I create them in InitInstance...
  21. Replies
    8
    Views
    1,854

    How do you add code to "do all the drawing"?...

    How do you add code to "do all the drawing"? Perhaps I use a timer or registered mouse move to call the draw routine? Is there a synchronized clause to make sure there's no race condition?
  22. Replies
    8
    Views
    1,854

    Wow! Thanks for the task manaager info. It took...

    Wow! Thanks for the task manaager info. It took me a few seconds to figure out how to add the "GDI Objects" as a column. Once I got it, I think that really helps!
  23. Replies
    8
    Views
    1,854

    What do you mean take it back out. I thought you...

    What do you mean take it back out. I thought you meant put it back in. My code puts in bmTest and hfFontDefault into image_dc. Next I use the select object as follows: SelectObject(image_dc,...
  24. Replies
    8
    Views
    1,854

    Creating and delete DeivceContext and bitmaps

    BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
    {

    hfFontDefault = CreateFont(lfHeight, 0, 0, 0, 0, TRUE, 0, 0, 0, 0, 0, 0, 0, _T("Times New Roman"));
    bmTest=...
  25. Replies
    7
    Views
    1,660

    What is the difference between TokenItem *tok...

    What is the difference between

    TokenItem *tok = new TokenItem(); delete tok;
    and

    TokenItem tok = TokenItem();

    In the later example, I suppose there is some sort of mechanism to track the...
Results 1 to 25 of 27
Page 1 of 2 1 2