|
|
use /VERBOSE:LIB in the project settings.
You are using some single thread libs with multi thread libs.
Last rescue is /FORCE
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi still I am not able to resolve this.
|
|
|
|
|
I am sorry for you.
Take out all user libraries dependencies of your project. Or start a new one. You need one that can be build. And than step for step include the libs until it doesnt work.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hello,
I have a main dialog in which I have embedded an activex control.
This dialog also has a child dialog.
When the main dialog comes up the child dialog is always partially hidden behind the activex control.
Only on mouse click it comes to the fore front.
CLIP CHILDREN didn't work.
Any help on this problem?
THX
modified on Friday, December 11, 2009 5:40 AM
|
|
|
|
|
You should not use Dialogs within Dialogs, it is bad design. Your main window should be a normal window that shows the child dialog as and when it is needed.
|
|
|
|
|
well, that may be the case, but i am stuck with this approach for now.
any way to resolve the issue i reported?
|
|
|
|
|
Well I had the same situation few years back, If I remember correctly I handled the OnInitialUpdate() and OnSize() call of Parent class,
The first problem as I see is an repainting problem,
Hope this help.
Abhi
|
|
|
|
|
indra271 wrote: any way to resolve the issue i reported?
Sounds like some sort of focus issue, but it's difficut to guess from your description.
|
|
|
|
|
Hi to All,
I have got a message Queue.
A thread function which should be able to process the queue, (that is if any data is available, then do some processing)....otherwise do nothing..
Now, my problem is...I cannot keep a while loop (inside the thread) and keep checking for the queue if there is any element in the queue...because it will consume lots of CPU processing power....Instead, I found the best method is to ......have a method, say getq()...which can be a blocking call...ie, inside my thread while loop , I should be able to do something like
threadFunction()
{
while(1)
{
if(getq() != 0)
{
}
}
}
so the functionality will be...it will go inside(if block)only when there is an element in the queue...otherwise wait there...
Now, I need help/hints to make the getq function...(which will return any value only if there is any elemt in the queue...otherwise it will not return the control...It should keep waiting till any element is there in queue )
thanks in advance
-----------------------------
I am a beginner
|
|
|
|
|
This way you're simply 'passing the problem' to getq method.
BTW when the queue is empty your thread may go to sleep (i.e. call Sleep [^]) to release the CPU .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You have to use events for that: you can wait (without consuming any CPU time) on an event to be notified. Typically what happens is that you have a thread pushing elements into your queue and a thread popping element from the queue. The thread popping elements wait on an event to be signaled by the other thread after he pushed something into the queue. You will also need to add proper synchronization on your queue to avoid accessing it from both threads at the same time.
I suggest you start by reading this article[^] which will give you an overview of threads and synchronization techniques.
|
|
|
|
|
If you're using MFC, you could simply derive a class from CWinThread . It's really simple and you don't need to maintain a queue or anything. MFC does everything for you. You could use PostThreadMessage[^] to post a message to the message queue of the thread.
I have a feeling that the family of WaitFor... functions may be of help to you if you aren't using MFC!
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hi,
You might consider using a semaphore to control queuing/de-queuing so that the de-queuing thread does not consume any CPU while it is waiting for more items to process. There is an exellent Queue class on this site:
Using Semaphores: Multithreaded Producer/Consumer
By Joseph M. Newcomer
Its slick and very compact - you wont get much better that this.
Have fun.
Tony
|
|
|
|
|
Hello, In my App I need to do some processing prior to the system going into a sleep mode, and once again when waking up.
I have tried a number of different ways of implementing this, but haven't succeeded in sucessfully intercepting the message. The code for the current implementation is included below. My app is SDI, OS is Win2000.
LRESULT CADSL_LoggerView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
if(message == WM_POWERBROADCAST)
{
CString szMsg;
BOOL bRC;
switch (wParam)
{
case PBT_APMSUSPEND:
szMsg.Format("Received PBT_APMSUSPEND");
g_pLogFile->Add(szMsg);
bRC = KillTimer(ID_TIMER);
szMsg.Format("KillTimer() returned %i",bRC);
g_pLogFile->Add(szMsg);
break;
case PBT_APMRESUMESUSPEND:
szMsg.Format("Received PBT_APMRESUMESUSPEND");
g_pLogFile->Add(szMsg);
bRC = SetTimer(ID_TIMER,300000,TimerProcs); // 5 mins (300 secs)
szMsg.Format("SetTimer(300000) returned %i",bRC);
g_pLogFile->Add(szMsg);
break;
}
}
return CChartView::WindowProc(message, wParam, lParam);
}
I have seen other messages go through the function, but a breakpoint after if(message == WM_POWERBROADCAST) never seems to fire on hibernation. Can anyone give me some idea of what's going wrong, and how to track it down ? Many thanks !
Doug
|
|
|
|
|
check the power configuration settings of the operating system
If it doesnt work check it on another PC, maybe on your old PC isnt all modern enough
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
It is definitely not an OS problem - the system does hibernate. Also, I know the WM_POWERBROADCAST message does get issued, as I can see it being "caught" by another project ("PowerLog" downloaded from website). So, it's definitely something to do with my implementation. For instance, does my code snippet have to be included in any particular class of the project ?
Doug
|
|
|
|
|
are you shure that your winproc is the active one of the main window?
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
There is only one view - normally hidden, I admit. Surely such a messsage (WM_POWERBROADCAST) still gets to a window even if it is hidden ? (or is this my problem ?)
Doug
|
|
|
|
|
For anybody that hits this problem, I thought that I would update this thread. By a process of trial and error, I found that the only class of my project that would recognise the WM_POWERBROADCAST message was CMainFrame (by overriding WindowProc() )
Doug
|
|
|
|
|
Hai friends
what is multithreading, and how to use in vc++, and how to tested it...
help me plz...
Best Regard's
Mathy's
|
|
|
|
|
This subject is way too broad be explained in message on a forum. I suggest you read through the articles available here on codeproject that talk about multithreading or to google for it. Or even better, to buy a good book on the subject. You can also have a look at this excellent article[^]
|
|
|
|
|
mathy wrote: what is multithreading
It is a really big topic, you're strongly encouraged to read a book about. For an introduction see [^], [^].
Multithreading is what you typically need, when, for instance, your program is performing I/O operations for a long time and you don't want the user interface hanging in the meanwhile.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yesterday you asked us to "explain" COM, ATL and MFC. Now you're ready for multithreading.
Will you PLEASE do everyone here a favour by buying a book? This forum is ONLY for asking specific queries.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hello Friends
What is Difference between
ShowWindow(hwndDlg,SW_HIDE) and EndDialog(hwndDlg,0)?
Which One we need to use?
Thanks & Regards
Yogesh
|
|
|
|