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

Search:

Type: Posts; User: ekhule

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Problem with PostMessage() in CView derived class

    Hello,

    Nevermind I figured this out, and it is not worth answering on here.
  2. Replies
    2
    Views
    225

    Boost shared_ptr question

    Hello all,

    I have a class called Wheel, and I created a boost shared_ptr to this class in the following way:



    typedef boost::shared_ptr<Wheel> WheelPtr;


    I also have a vector of these...
  3. error: invalid initialization of non-const reference of type ...

    Hello,

    I am tryign to use the Singleton design patterno on Linux, but it is not working:

    in the .h I have:



    public:
    static ErrorH& Instance();
  4. Re: warning C4715: 'CM::Instance' : not all control paths return a value

    How would you fix this code? I am stumped!
  5. warning C4715: 'CM::Instance' : not all control paths return a value

    Hello, I have the following code where I use the singleton design pattern, but I get the warning:

    warning C4715: 'CM::Instance' : not all control paths return a value



    CM& CM::Instance()
    { ...
  6. Replies
    7
    Views
    546

    Windows strcpy overflow question

    Hello,

    I have the following code:

    char buf[5];
    strcpy(buf, "12345678");


    When I run this from the IDE in Release mode, it works fine, no crashes. However, when I change "12345678" to...
  7. Replies
    5
    Views
    811

    Re: just get filename from wstring?

    Hello Paul,

    Do you have any sample code with that function? I can't much about it online.

    Regards,
    Ellay K.
  8. Replies
    5
    Views
    811

    just get filename from wstring?

    Hello,

    I have a file path in a wstring like this:

    wstring pathName = L"c:\windows\system\test.exe";

    I want to be able to geta new wstring that just contains "test" from this wstring.
    ...
  9. Replies
    1
    Views
    252

    help looping through a vector of vectors

    Figured it out, nevermind!

    Ellay K.
  10. Replies
    1
    Views
    455

    looping through a vector of vectors

    Figured it out, nevermind!\

    Thanks!
    Ellay K.
  11. Replies
    1
    Views
    598

    Re: unexplained linking errors

    nevermind.. I missed a sneaky /MD :)
  12. Replies
    1
    Views
    598

    unexplained linking errors

    Hello all,

    I get the following linking errors when trying to compile my exe:

    1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _tolower already defined in libcmt.lib(tolower.obj)...
  13. Re: how can I convert a vector of vectors to a 1d std::vector?

    figured it out.. typo in my code:

    ::SetDIBits(dc.m_hDC, bitmap, 0, dyextent, &bits_[0], &bmi_,0);

    should be:

    ::SetDIBits(dc.m_hDC, bitmap, 0, dyextent, &bits1d[0], &bmi_,0);


    Thanks...
  14. Re: how can I convert a vector of vectors to a 1d std::vector?

    hmm ok, so my code looks like this now:



    in .h file:
    vector<vector<int> > bits_;

    vector<int> bits1d;
    bits1d.reserve(RADARWIDTH*RADARHEIGHT);
    for(unsigned int i=0; i<bits_.size(); ++i)
  15. Re: how can I convert a vector of vectors to a 1d std::vector?

    Hey Paul,

    I get this compilation error:

    error C2440: 'initializing' : cannot convert from 'std::vector<_Ty>' to 'const std::vector<_Ty> &'

    on this line:

    const vector<int> & v = bits[i];
  16. Re: how can I convert a vector of vectors to a 1d std::vector?

    Thanks for the replies gentlemen :)
  17. how can I convert a vector of vectors to a 1d std::vector?

    Hello all,

    I have a 2d vector like this:

    vector<vector<DWORD> > bits = vector<vector<DWORD> >(100, vector<DWORD>(100));

    I would like to, in code, convert this vector to 1d like this:
    ...
  18. Replies
    8
    Views
    869

    Re: SetDIBits function

    Would it be sufficient to write code to convert the two vectors to one single vector to be passed in? Anyone have any example code to do that?
  19. Replies
    8
    Views
    869

    SetDIBits function

    Hello all,

    I have some code using the SetDIBits function:

    http://msdn.microsoft.com/en-us/library/dd162973(v=vs.85).aspx

    and I was wondering if I could pass an stl::vector of vectors to the...
  20. Replies
    5
    Views
    745

    Re: need a simple integer pattern algorithm

    Thanks Lindley :)
  21. Replies
    5
    Views
    745

    need a simple integer pattern algorithm

    Hello all,

    In code, I need to transform these values:

    256 becomes 0
    128 becomes 1
    64 becomes 2
    32 becomes 3
    16 becomes 4
    8 becomes 5
  22. Replies
    8
    Views
    592

    Re: how can I use a pointer to a std::vector?

    Thanks everyone! Except S M A :P
  23. Replies
    8
    Views
    592

    Re: how can I use a pointer to a std::vector?

    I need to use dynamic memory because I am sending the vector to another thread.

    How does the allocation work? I tried this code below and it crashes on the reserve() call.



    vector<Test*>*...
  24. Re: how best to combine multiple vector to std::string?

    Thanks so much, I appreciate your time today in helping me! :)
  25. Replies
    8
    Views
    592

    how can I use a pointer to a std::vector?

    I have a pointer to a vector that contains instances of class Test:



    vector<Test*>* testVec;


    If I do this:
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