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

wilche

@wilche
About
Posts
24
Topics
12
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to say a pointer has pointed to NULL in an application rather than just crashing?
    W wilche

    Hello everybody! I have been encountering some difficulties with my applications and it constantly crashes. Lacking VC++ at the place of installment, it basically gives a dialog from the system stating a page fault has occurred. The error could be a pointer pointing to NULL, moving ptrs to garbage areas, or anything..but the only information I get is a page faullt has occurred, which really isn't helpful. Is there another way that will give more details about the error? Cheers, wilche

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

  • Lost in the Sea of .Net Mania
    W wilche

    Thanks it's a lot clearer to me now :)

    .NET (Core and Framework) csharp dotnet help question

  • Lost in the Sea of .Net Mania
    W wilche

    Hi all, Can someone simply explain the relationship between these terms? MFC7 and VC.Net C# and .Net Framework C# and VC.Net MFC7 and C# It seems very confusing because they are inter-related and very different from each other... Any help to clarify these terms will be greatly appreiciated Cheers, wilche

    .NET (Core and Framework) csharp dotnet help question

  • Memory Leak!
    W wilche

    hello everybody! I have some trouble in freeing up the memory allocated for dialog items. I have created the Gui screens using new and I use DestroyScreen to free my memory like this: virtual void DestroyScreen(void) { if (m_pDlg->GetSafeHwnd()) { delete m_pDlg; m_pDlg = NULL; } } } I go through each dlg using this DestroyScreen function. The returned warning is: Warning: calling DestroyWindow in CDialog::~CDialog -- OnDestroy or PostNcDestroy in derived class will not be called. Detected memory leaks! Dumping objects -> {3539} client block at 0x0081A330, subtype 0, 332 bytes long. a CDialog object at $0081A330, 332 bytes long Could anyone please help me with this one? Thanks everyone! Cheers, wilche

    C / C++ / MFC performance help question

  • STL
    W wilche

    Hi everybody! Just wanted to know whether there are any good places/articles that will give instructions on how to define and create STLs and general information about what are they used for. Thanks! Kind regards, wilche

    C / C++ / MFC c++ tutorial lounge

  • PostThreadMessage
    W wilche

    Sorry my fault, I have made sure that the message queue has been created properly. This is because the messages inside the queue were correctly being processed. Thanks for picking this up! wilche

    C / C++ / MFC help performance data-structures question

  • Threads
    W wilche

    Is there a simple way of deciding when threads are better than not having them at all if optimisation is the goal? Thanks all! Kindest regards, wilche

    C / C++ / MFC question

  • PostThreadMessage
    W wilche

    Recently, I wrote on message board, that I had problem PostThreadMessage. It did not post to the thread as expected, but GetLastError did not indicate that an error has occurred. The bug disappear when I used: Sleep(20); to force it sleep for 20 ms. But when I tested it using larger test data, the same problem occurred, even more serious then before. Furthermore the performance eroded to point that it was better off not using threads. In both cases, resources was critically reduced. The "apparent" culprit was that the low resources. As the rate messages entering the message queue was higher than it's removal through processing, net increase in queue. Each message can contain significant amounts of data (up to 20k) and hence low resources. I have checked carefully there is no memory leakage so this was the only conclusion I could draw. Closer study also showed that SendMessage also failed under these circumstances. What I want to ask, 1, Has anyone else had this sort of problem? 2, Is my conclusion correct? 3, Is there a fix for this? Thank you! Any reply is greatly appreciated Kind regards, wilche :) The more simple things are, the more complex is the way it works. The more complex things are, there is probably a simpler solution.

    C / C++ / MFC help performance data-structures question

  • Interrupts?
    W wilche

    Thanks for your reply. Not disputing what you said but I have some questions.... If I used worker thread, for example the following code: //ThreadProc is the procedure used by worker thread int ThreadProc() { // event declarations and def event[0] = ::CreateEvent(NULL, TRUE, FALSE, NULL) // Stop/abort event[1] = ::CreateEvent(NULL, TRUE, FALSE, NULL) // Run DWORD status; while(TRUE) { status = WaitForMultipleObjects(2, event, FALSE, infinite); switch(status) { case WAIT_OBJECT_0: // Abort CloseHandle(ThreadId); return result; case WAIT_OBJECT_0+1: result = RunFunction(); break; } } return result; } In this case, wouldn't it still wait for RunFunction to finish before processing the Abort Event? If I create an UI thread using message queue, I do something similar using GetMessage say. int ThreadProc() { DWORD status; while(TRUE) { status = GetMessage(&msg, NULL, 0, 0); // Check that the message is valid...code ignored here. Assume it's ok switch(msg.message) { case abort: // Abort CloseHandle(ThreadId); return result; case run: result = RunFunction(); break; } } return result; } Would I still have the same problem? In this case, RunFunction will have to be completed before the next message will be processed. Kind regards, wilche

    C / C++ / MFC help tutorial question

  • It's a beautiful day
    W wilche

    Glad it's a good day in South Africa. It's pouring rain down here. Then the sun start shining for a while, and then back to rain, then the sun, then the rain etc....all day! Have a guess where I am. wilche :)

    The Lounge com question

  • I finished.
    W wilche

    Well done David! All the best! Kindest Regards wilche

    The Lounge learning

  • Interrupts?
    W wilche

    Hi everybody, I'm using a function taken from a DLL. It can be a lengthy wait for it to finish so I want to create a stop button to stop the function if the function begins to take too long. As the function is in the dll, I don't know how to stop the function. Could anyone help me in teaching me how to do this? Thanks! wilche :)

    C / C++ / MFC help tutorial question

  • Create a thread & use mutex for synchronization
    W wilche

    Just out of interest, why is critical section better in this case? Wouldn't mutex serve the same purpose? Regards, wilche

    C / C++ / MFC help

  • What the!
    W wilche

    Actually thanks for the reply but I think I may have found the problem. I added a Sleep function to force the thread to give up some CPU resources, then it works fine. I do this whenever the PostThreadMessage fails. So I wait and then resend. However, this seems to defeat the purpose of threads. I have two versions of the same application running, the difference is that one version pass its work using UI thread, while the other uses the main thread to do all its work. Currently it seems that the version using the UI thread is taking slightly longer than the other version because of this sleep function. It seems that the application is being seriously overloaded by the amount of messages it receives, causing it to resend lots of messages, making it sleep for long times! Furthermore it has taken me a lot more effort in getting this threaded version to work than the other version. So maybe threading is not always the best solution to improve performance? Kind regards, wilche

    C / C++ / MFC help data-structures

  • What the!
    W wilche

    Help! PostThreadMessage function fails without any apparent reason. The Message Queue is present. The Thread is present. GetLastError returns that "the operation is successful" BUT the message HAS NOT BEEN POSTED in the queue!!! Much appreciated if someone could help me with this problem Cheers, wilche :)

    C / C++ / MFC help data-structures

  • Scroll bars!
    W wilche

    Thank you Ernest! It works great, thanks! Life is like fishing. We are all waiting for a bite

    C / C++ / MFC help question

  • Scroll bars!
    W wilche

    G'day all! I have been using CRichEditCtrl class and every 20ms or so, I add things on to the display using this class. So you can imagine there's a whole heap of lines in the display. I have been trying very hard to make sure that the Vertical Scroll Bar is placed at the latest updated position. Could anyone help me with this one? Any help will be appreciated! This above all, to thine own self be TRUE. William Shakespeare

    C / C++ / MFC help question

  • C#, VC and .NET
    W wilche

    Is VC++ 7 much different from VC 6? Don't act, BE!

    .NET (Core and Framework) csharp learning visual-studio tools question

  • C#, VC and .NET
    W wilche

    Hi everyone, I'm new in learning VS 6.0, particularly VC 6.0. In recent developments, .NET development tools are becoming increasingly popular. I am a bit confused. Will VC 6.0 become obsolete in future? Should a beginner start on languages like C# or .NET, rather than persisting on VC 6.0 Any discussions with the above questions are very welcome Thank you Don't act, BE!

    .NET (Core and Framework) csharp learning visual-studio tools question

  • GetMessage
    W wilche

    Thanks! that works! uh could you explain why it works? greatly appreciated! wilche

    C / C++ / MFC help data-structures performance question
  • Login

  • Don't have an account? Register

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