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
W

Walter Gildersleeve

@Walter Gildersleeve
About
Posts
8
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Templates and forward declarations
    W Walter Gildersleeve

    I don't get template-related syntax errors when compiling the code in VC6 after simply changing the parentheses to brackets...there is a missing semi-colon after B* b in struct A, but other than that, no problems. (I'm able to create instances of the structs, too; link and running is no problem.) Walter Gildersleeve Freiburg, Germany walter.gildersleeve@pe-gmbh.de

    C / C++ / MFC help question c++ wpf

  • Window Messages
    W Walter Gildersleeve

    I'm not entirely sure what you mean...you have a message id returned from RegisterWindowMessage, and you want to determine at run-time which method you want to call? The easiest way would be to trap the message in PreTranslateMessage(), and send it on from there. Or you could simple send the message on from the function you originally designated to trap your message. Or have I misunderstood your question? Walter Gildersleeve Freiburg, Germany walter.gildersleeve@pe-gmbh.de

    C / C++ / MFC question

  • How to store a put a template class into a CList object?
    W Walter Gildersleeve

    I'm not having problems inserting template classes in a CList: template class Cell { public : T SetData(const T& t) { T old = data; data = t; return old; } T GetData() const { return data; } private : T data; }; CList, Cell > lst;//NOTE--there *must* be a space between the right-most braces : > > lst. Walter Gildersleeve Freiburg, Germany walter.gildersleeve@pe-gmbh.de

    C / C++ / MFC help tutorial question

  • questio about pointer
    W Walter Gildersleeve

    You could do something similar: [ccode] #include using std::ostringstream; void Func() { int a; int* p = &a; ostringstream stream; stream << p; SetDlgItemText(IDC_EDIT1, stream.str().c_str()); } [/ccode] Walter Gildersleeve Freiburg, Germany walter.gildersleeve@pe-gmbh.de

    C / C++ / MFC

  • constant String Memory Usage
    W Walter Gildersleeve

    I tend to agree with Jim on this, if only from a OOP purist standpoint. True, calling ReleaseBuffer() is no big deal, mayber comparable to calling delete[] for every new[]. But an advantage of OOP is that ownership and maintenance issues are more transparent...don't screw with my private members (no pun intended), and I won't screw with yours. Forgetting to call ReleaseBuffer(), or placing it in the wrong place, can be problematic, even disasterous for a program. (Not very likely? For any moderately complex function, it is just as likely to bomb on ReleaseBuffer() logic as it is to bomb on delete[] logic.) So if casting to an LPCSTR doesn't work because of the need for a non-const char buffer, than I would suggest creating a local static buffer. (I tend to alleviate my anger at the need to do this by cursing the crappy programmer who wrote the function const-unaware;) .) Walter Gildersleeve Freiburg, Germany walter.gildersleeve@pe-gmbh.de

    C / C++ / MFC database c++ hardware debugging performance

  • constant String Memory Usage
    W Walter Gildersleeve

    Simon, Are you sure that a) the memory is truly leaking, and b) it is coming from the static CString? (I have trouble believing that CString, one of the most popular members of the MFC library, would leak memory. Also consider that CString uses reference counting; seperate CString objects set to the same static data always point to the same m_pchData, until one or the other is changed). I suspect that what you're witnessing is a false memory leak; either that, or code in other parts of fred() is leaking memory. Using CMemoryStatus::DumpAllObjectsSince() shows no leaks when a static CString is alloted in fred(); perhaps using that function might better point out the exact location of any leaks which might exist. Walter Gildersleeve Freiburg, Germany walter.gildersleeve@pe-gmbh.de

    C / C++ / MFC database c++ hardware debugging performance

  • overriding new/delete
    W Walter Gildersleeve

    I've posted this question on other sites/BBSs w/o success... So I'm trying to write custom new and delete functions, in order to find a bunch of memory leaks in a program I'm working on. (This is in MSVC 6.) My new function I've defined as follows: void *__cdecl operator new(size_t, debug_class); I invoke it with char* ptr = new (debug_class()) char[10]; my custom routine then storing appropriate info. This works fine. But for this to work correctly, I need to have a matching delete routine. I've tried something similar, defining it as so: void __cdecl operator delete(void*, debug_class); But how do I invoke it? I've tried several possibilities, to whit delete (debug_class()) ptr[]; delete (debug_class(), ptr); delete (ptr, debug_class()); etc., but mainly end up with compiler errors. The last example compiles fine, but calls the default delete operator nonetheless. Any ideas how I'd invoke it? TIA Walter Gildersleeve IVU-Umwelt GmbH Freiburg, Germany

    C / C++ / MFC question debugging performance tutorial

  • implementing splitter windows
    W Walter Gildersleeve

    I would so appreciate someone telling me what I'm failing to do in implementing splitter windows in an SDI app. A boiled down version of my program--default MFC SDI app created with MSVS 6 app wizard, accepting all the defaults. Using ClassWizard, I add a new view class derived from CEditView. I then add a public CSplitterWnd object to CMainFrame, and override the OnCreateClient() function with the following code (this code is taken more or less verbatim from the MFC sample DaoView): BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { if (!m_Splitter.CreateStatic(this, 1, 2)) {/*error handling*/} if (!m_Splitter.CreateView(0, 0, pContext->m_pNewViewClass, CSize(100, 50), pContext)) {/*error handling*/} if (!m_Splitter.CreateView(0, 1, RUNTIME_CLASS(CSplitEditView), CSize(0,0), pContext)) {/*error handling*/} SetActiveView((CView*)m_Splitter.GetPane(0, 1)); return CFrameWnd::OnCreateClient(lpcs, pContext); } Program compiles fine, runs fine, but with no splitters. What am I leaving out? TIA

    C / C++ / MFC c++ css 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