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
B

big_denny_200

@big_denny_200
About
Posts
75
Topics
49
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • string tables
    B big_denny_200

    hello again :) I have added new item in string table of my project :

    IDS_SOMETHING "SomeText"

    How to retrieve the string value of the IDS_SOMETHING in my project ? thank you

    C / C++ / MFC tutorial question

  • what is a source control? [modified]
    B big_denny_200

    Hello :) Can anybody explain what is a source control ? why is it useful ? and where can I download one. thank you. -- modified at 11:34 Tuesday 27th June, 2006

    C / C++ / MFC question

  • strange Cbutton problem [modified]
    B big_denny_200

    hi all :) I have MFC application and a public method

    void CProject::Something(CButtonDerivedClass bButton)
    {
    // No matter what is here
    }

    When in OnInitDialog I call this method, I get error :

    ...
    Something(m_bDerivedButton);
    // bDerivedButton is an object of some CButton derived class
    // and is public member variable of current class
    ...

    error : Error 1 error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject' c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxwin.h 1814 Please help if you can. thanks -- modified at 6:47 Wednesday 14th June, 2006

    C / C++ / MFC help csharp c++ visual-studio question

  • HANDLE - what exactly is it ?
    B big_denny_200

    Hello again :) I have a question : What is a handle ? Is it something like pointer ? What is difference for example between HWND and a Cwnd ? Please give me some explicit explanations. Thank you.

    C / C++ / MFC question tutorial

  • wcscpy_s issues [modified]
    B big_denny_200

    thanks, I did not pay attention to the WORD

    C / C++ / MFC data-structures help

  • string issues again [modified]
    B big_denny_200

    Hello again :) Please someone explain me next situation I have next code :

    ...
    const UINT SIZE = 5;

    TCHAR strDest\[SIZE\];
    
    LPCTSTR strSource = \_T("cool");
    
    \_tcscpy\_s(strDest,sizeof(strDest)/sizeof(TCHAR), strSource);
    
    CString s(strDest);
    
    MessageBox(s);
    

    ...

    Everything works fine, but I get some differences in Debug and Release builds. Specifficaly, in Release build, in debugger when I look at contents of strDest after _tcscpy_sfunction, I see that, first 4 bytes of it are occupied by come strange characters and 5th byte is 'c', but anyway the resule is displayed correctly in Message box. In Debug build everything happens as expected : first 4 bytes are occupied by 'c' 'o' 'o' 'l' and 5th byte is '\0' Why is this difference ? thank you. I have VS2005 -- modified at 14:21 Friday 2nd June, 2006

    C / C++ / MFC debugging question announcement

  • wcscpy_s issues [modified]
    B big_denny_200

    What is happening ? I am replying to Viorel Bejan and this post gooes in reply to Zac Howland's post :confused:

    Viorel Bejan wrote:

    Since _tcscpy_s is expanded to wcscpy_s call in Unicode version, you must specify the size of destination buffer in 2-byte unicode characters, not in bytes. Universal solution can look like this: _tcscpy_s(array, sizeof(array) / sizeof(TCHAR), strText); You got halts even if the source string was short enought, because -- in Debug version -- this function fills the buffer with 0xFD value.

    Could you be more explicit ? MSDN says, that second parameter of wcscpy_s must specify size of destination buffer in bytes, therefore in Unicode build destination size will be 100 * sizeof(TCHAR) (which is equal to sizeof(array)), but in you case it will be 100(which is not the size of destination buffer) I am little confused. thanks -- modified at 12:02 Friday 2nd June, 2006 -- modified at 12:04 Friday 2nd June, 2006

    C / C++ / MFC data-structures help

  • wcscpy_s issues [modified]
    B big_denny_200

    Could you be more explicit ? MSDN says, that second parameter of wcscpy_s must specify size of destination buffer in bytes, therefore in Unicode build destination size will be 100 * sizeof(TCHAR) (which is equal to sizeof(array)), but in you case it will be 100(which is not the size of destination buffer) I am little confused. thanks -- modified at 12:02 Friday 2nd June, 2006

    C / C++ / MFC data-structures help

  • wcscpy_s issues [modified]
    B big_denny_200

    Hi all :) Please help, I have next code : I am building in Unicode

    TCHAR array[100];

    CString strText = _T("Cool");

    _tcscpy_s(array,//Location of destination string buffer
    sizeof(array),// Size of the destination string buffer.
    strText//Null-terminated source string buffer.
    )

    But the program halts and hangs, when performs _tcscpy_s method. thank you -- modified at 11:16 Friday 2nd June, 2006

    C / C++ / MFC data-structures help

  • wchar_t to char
    B big_denny_200

    Hello again :) In Unicode build,how to convert a TCHAR array to array of char -s ? thanks

    C / C++ / MFC data-structures tutorial question

  • ASSER - VERIFY [modified]
    B big_denny_200

    Hello :) I have a question ? What is the advantage of writing ASSERT instead of VERIFYS ? As far as I understood, there is no need of using ASSERT, as you can use VERIFY, because it works both in Debug and Release builds and ASSERT does not work in debug builds Correct me if I am wrong. Thank you PS. I have written VERIFY(0) in my program(OnInitDialog) and built in Release mode, but it did not halt my program ?? why :confused: -- modified at 5:59 Friday 2nd June, 2006

    C / C++ / MFC question debugging announcement

  • set caret position to the end in Edit Box
    B big_denny_200

    Hi all again :) I have edit box, where I display long texts(file paths). Problem is that I want the user to be able to see the last part of the text displayed in the Edit Box(it is a file name). How can I do this ? thank you.

    C / C++ / MFC question help

  • Get file size in mega bytes
    B big_denny_200

    Hi all :) How can I get file size in mega bytes ? Is there any good API, for this ? I have a MFC prpject. thank you.

    C / C++ / MFC question c++ json

  • Disable warning [modified]
    B big_denny_200

    Hi all :) I have a VS2005 MSC project, consisting of many classes, but when I compile I get many warnings(in different .cpp files) of type : warning C4996: wcscpy was declared depreciated c:\....cpp How to disable this warning, for whole project ? thank you. -- modified at 7:52 Wednesday 31st May, 2006

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

  • source control system [modified]
    B big_denny_200

    I read in some article : Quote : "The most obvious thing to do is to comment each and every check-in to your source control system (I am not even going to consider the possibility you don’t use a source control system) ". what is it ? thanks -- modified at 9:41 Tuesday 30th May, 2006

    IT & Infrastructure question

  • Inheritance issue [modified]
    B big_denny_200

    no :( why not use semicolons ? thanks -- modified at 9:34 Monday 29th May, 2006

    C / C++ / MFC help oop question

  • Inheritance issue [modified]
    B big_denny_200

    hello :) I've found my silly mistake please help me find error in my code :

    // *************
    class Base
    {
    public :

    	virtual ~Base() {};
    
    	// Retrieve value of X
    	virtual void getX() const
    	{
    		cout<// should be &pError here
    {
    	pError->getX(); **// and .getX() here** 
    }
    
    return 0;
    

    }

    sorry for stupid question I am pretty tired, need a good sleep :) -- modified at 9:42 Monday 29th May, 2006

    C / C++ / MFC help oop question

  • assert VS exceptions [modified]
    B big_denny_200

    _AnShUmAn_ wrote:

    Once you have found and fixed all of the bugs

    How can you know that you have eliminated all bugs ?

    _AnShUmAn_ wrote:

    Assertions show that you are still testing and debugging your code

    I see asserts in already posted codes...

    _AnShUmAn_ wrote:

    An exception is an unpredictable but expected event

    :confused:, why unpredictable. Can not understang it fully :( anyway thanks for reply

    C / C++ / MFC visual-studio debugging help question announcement

  • exceptions [modified]
    B big_denny_200

    hi again :) I saw in some code such thing : (it was a mathematical formula parser)

    try
    {
    ...
    }
    catch(CException1 pError)
    {
    ...
    }
    catch(CException2 pError)
    {
    ...
    }
    catch(CException3 pError)
    {
    ...
    }catch(CException4 pError)
    {
    ...
    }
    catch(CException5 pError)
    {
    ...
    }
    catch(CException6 pError)
    {
    ...
    }

    I have question : Is not it uncomfortable to write so many catches ? when all theses exceptions are some what related, could not we unite them under some CMainException class and catch only one exception ? this code is from this article : http://www.codeproject.com/cpp/VisualCalc.asp From the Using the Code section But the article is verry coool :rose: -- modified at 4:15 Monday 29th May, 2006

    C / C++ / MFC question c++ com

  • assert VS exceptions [modified]
    B big_denny_200

    hi all :) I saw this code :

    inline int foo (char* pBuffer, const char* formatString) throw() {

    assert (pBuffer);
    assert (formatString);

    return "something";
    }

    If i use this code and in Release build and pass pBuffer, whose value will be NULL, than I get a bug yes ? these asserts are useful only in debug mode, not ? Is not it better to above this function like this :

    inline int foo (char* buffer, const char* formatString) {

    if(NULL == buffer)
    throw someException();

    if(NULL == formatString);
    throw someOtherException();

    return "something";
    }

    In this case if we catch the thrown exception than, we are secure in both Release ana Debug builds, not ? so why use asserts and not throws? thank you -- modified at 4:01 Monday 29th May, 2006

    C / C++ / MFC visual-studio debugging help question announcement
  • Login

  • Don't have an account? Register

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