Timer in CWinThread question Programming Software Development by ktsangop …way i can implement a timer based function inside a CWinThread, being also able of course to accept messages coming… while loop (with or without a Sleep() call) inside CWinThread::Run function but it appears that this technique is preventing…i don't actually create any graphical content inside my CWinThread), but i would like to send messages to the… Re: Timer in CWinThread question Programming Software Development by Ancient Dragon … a global win32 api function, so just call that in CWinThread. >Is there any way i can implement a timer… based function inside a CWinThread, being also able of course to accept messages coming from….aspx) > would like to send messages to the thread CWinThread is not going to help you with that. Just create… Re: Timer in CWinThread question Programming Software Development by ktsangop …a global win32 api function, so just call that in CWinThread. Did try it but no WM_TIMER messages ever arived in…want to get another thread's message. I want my CWinThread to be able to accept messages through PostThreadMessage. >…; CWinThread is not going to help you with that. Just … Re: Timer in CWinThread question Programming Software Development by Ancient Dragon >I don't want to get another thread's message. My misunderstanding. In that case yes, CWinThread will probably work. As for worker threads, you can put a message pump into them so that they can receive messages. Not usually done though. Re: Timer in CWinThread question Programming Software Development by ktsangop … and it seems to work. SetTimer actually works on a CWinThread, i just had to override it and declare a message… MFC -- or "cWinThreads hate me" Programming Software Development by ninjaneer … told by my boss man that I need to use cWinThread (worker threads) in order to do this. I was wondering…(&mxMin,1); //this guy needs to go into a cWinThread worker thread... procsink(1, output, input); output.GetData(&flips… Visual Studio Memory Dump Programming Software Development by GadiK …} client block at 0x0036AFC0, subtype c0, 68 bytes long. a CWinThread object at $0036AFC0, 68 bytes long {153} normal block at…} client block at 0x0036AFC0, subtype c0, 68 bytes long. a CWinThread object at $0036AFC0, 68 bytes long f:\rtm\vctools\vc7libs… Thread synchronization using MFC synchronziation objects Programming Software Development by rajayuvaraja …[]) { T_ThSafeArray a1, a2; HANDLE hThread[2]; try { CWinThread* pThread1 = AfxBeginThread (consumer, LPVOID(&a1)); CWinThread* pThread2 = AfxBeginThread (producer, LPVOID(&a1)); if… Re: MFC -- or "cWinThreads hate me" Programming Software Development by Ancient Dragon … program you can test for yourself whether it will support CWinThread or not. Thread Priority, Priority Classes, and OS Priority Programming Software Development by ninjaneer … _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { HANDLE threadHand = GetCurrentThread(); CWinThread *startThread; int nRetCode = 0, priority; SetPriorityClass(threadHand, HIGH_PRIORITY_CLASS); SetThreadPriority(threadHand… C# cWinThreads? and MFCs Programming Software Development by ninjaneer … question is: Should I wrap? Or is there an equivalent cWinThread, thread priority setting, and process priority setting alternative in C… importing C++ code into C# via wrapper? Programming Software Development by ninjaneer … created (also the C++ backend uses Microsoft Foundation Classes like cWinThread). I've read a lot about 'creating a managed DLL… Re: Simulate Mouse Move Programming Software Development by meabed … the message pump is buried in the framework, in CWinThread::PumpMessage. So how can you get the rest of the… information in the MSG? Fortunately, CWinThread retrieves the MSG into a CWinThread data member, m_curMsg. You can get …the currently queued message was, you have to look in CWinThread::m_curMsg. In either case, the time and pt fields… Re: include problem with md5sum.h, pls help Programming Software Development by maudits … __beginthreadex referenced in function "public: int __thiscall CWinThread::CreateThread(unsigned long,unsigned int,struct _SECURITY_ATTRIBUTES *)" (?CreateThread…@CWinThread@@QAEHKIPAU_SECURITY_ATTRIBUTES@@@Z) md5sum error LNK2019: unresolved external symbol … Re: exit button Programming Software Development by lahom i used PostMessage(WM_QUIT); and got Error: CWinThread::PumpMessage called when not permitted. could someone explain pleeease Re: How to do multithread programming in C++.. Programming Software Development by Rajesh R Subram ….microsoft.com/en-us/library/48xz4yz9(VS.80).aspx"]CWinThread[/URL]. MFC maintains per thread handle maps, and it relies… Re: Timer in CWinThread question Programming Software Development by nullptr Perhaps CreateTimerQueue, CreateTimerQueueTimer, DeleteTimerQueueTimer would do what you want. Plus it's easy to wrap them into a class. http://msdn.microsoft.com/en-us/library/windows/desktop/ms682483%28v=vs.85%29.aspx http://msdn.microsoft.com/en-us/library/windows/desktop/ms687003%28v=vs.85%29.aspx Re: MFC -- or "cWinThreads hate me" Programming Software Development by Ancient Dragon >>when I try to #include afx.h so that I can build threads via AfxBeginThread I get the following error: why are you including afx.h ? If you are using a Microsoft compiler and using precompiled headers then that is already included in stdafx.h >>I was wondering if anyone could tell me how to interface with the MFC libraries in … Re: MFC -- or "cWinThreads hate me" Programming Software Development by ninjaneer Problem is the boss wants cWinThreads.... cos of their built-in thread safeties. do I need to [icode]#include stdafx.h[/icode]? VS 2k5 professional edition keeps telling me I don't have that library... Re: MFC -- or "cWinThreads hate me" Programming Software Development by ninjaneer Neat. I couldn't find an option to create an MFC console application when I was looking. Do you just create a win32 app and there's some setting I'm missing somewhere? *runs off to try that* Re: MFC -- or "cWinThreads hate me" Programming Software Development by ninjaneer [QUOTE=ninjaneer;631470]Do you just create a win32 app and there's some setting I'm missing somewhere? *runs off to try that*[/QUOTE] yeah... it's a check box, you dope. Hey! Don't insult me! o.O Re: MFC -- or "cWinThreads hate me" Programming Software Development by Ancient Dragon [QUOTE=ninjaneer;631470]Neat. I couldn't find an option to create an MFC console application when I was looking. Do you just create a win32 app and there's some setting I'm missing somewhere? *runs off to try that*[/QUOTE] That option exists in VC++ 6.0, I don't know if they removed in in 2005 or not. All it is is a standard console … Re: Visual Studio Memory Dump Programming Software Development by Ancient Dragon 1) try commenting out large sections of code until no more leaks detected. 2) Sometimes it reports leaks that are not really leaks. such as memory allocated by MFC classes or your own code and not yet released when CrtDumpMemoryLeaks() is called. Re: Visual Studio Memory Dump Programming Software Development by Salem [url]http://msdn.microsoft.com/en-us/library/faz3a37z.aspx[/url] Read this, and find out how to build your program with debug malloc enabled. At the start of main, put a breakpoint on your first call to malloc. It's only necessary because I can't remember the name of something :( When you hit the breakpoint, do step-into malloc, and follow … Re: Thread synchronization using MFC synchronziation objects Programming Software Development by Ancient Dragon IMHO ditch that crappy CSingleLock class and use CriticalSection since it works for you the way you want it to. Re: Thread Priority, Priority Classes, and OS Priority Programming Software Development by mitrmkar [ICODE]SetPriorityClass[/ICODE] takes the handle of the process, not the thread's handle. So you need to have [code]HANDLE hProcess = GetCurrentProcess(); [/code] [QUOTE]Is there a utility to view threads and how they tick on and off of the processor?[/QUOTE] You might use [URL="http://technet.microsoft.com/en-us/sysinternals/bb896653.… Re: Thread Priority, Priority Classes, and OS Priority Programming Software Development by ninjaneer ah! I didn't even notice that! That certainly would make a difference I imagine... Re: C# cWinThreads? and MFCs Programming Software Development by Ramy Mahrous Look there is System.Threading namespace which contains a lof of classes concern threads. But if you in situation which can't use managed code and enforced to work with unmanaged code you need import those dll (assemblies) to your project (which developed in .net environment). Re: C# cWinThreads? and MFCs Programming Software Development by ninjaneer yeah... I'd gotten that far. The search continues. :)