|
KaKa' wrote: How do I remove the compile warnings during compilation?
The best way I know of, is not to have any warnnings . And yes, I'm serious. Why would you want to remove the warnings, they often contain very valuable information and if you want not to be overwhelmed by warnings, try to modify your code so that it doesn't produce any warning anymore.
|
|
|
|
|
Nothing has been removed. Its still the same.
The Error List window had 3 buttons on the top that says Errors, Warnings and Messages.
By default all 3 are selected.
Here you can control what needs to be shown.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Not to be too sarcastic, but pay attention to the warnings and fix them. If you find some warnings aren't appropriate for your specific situation, disable the warning with a pragma. (I always compile at Warning Level 4 and typically turn off a [very] few irrelevant warnings.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
hi everyone.
in my prog i kinnda need to stop my main thread until other thread is running. can nyone plz help me to tell if this is fine with design point of view or at all possible. If its possible plz tell me how.. using CEvent how can i creat event signalled for main thread
thank
|
|
|
|
|
In my think if you stop the main thread the procedure will terminate.
Maybe you can create a loop in main thread to wait the event that you hope.
|
|
|
|
|
thanx for ur reply thats wt i want.... but how to create an event for main thread and loop it ?
|
|
|
|
|
you can use "WaitForSingleObject" function.
I can read a word.
|
|
|
|
|
ShiXiangYang wrote: Maybe you can create a loop in main thread to wait the event that you hope.
You mean busy waiting (a simple loop that continuously checks the state of a certain variable) ? That's pretty ugly because it will consume CPU cycles for nothing. Better to use synchronization objects (events for instance).
|
|
|
|
|
Which kind of application are you working on ? If it is a win32 or MFC application, I strongly advice not to stop the main thread because no messages will be processed anymore and your UI will hang.
If it is a console application and you want to wait until something happens, then using an event is one of the way to do it: simply call WaitForSingleObject[^] which will wait until the event you passed to handle is signaled. To crate the event, call CreateEvent[^]. In your separate thread, once you need to signal the main thread, call SetEvent[^], which will set the event and end the wait in the main thread.
These are the win32 functions, there are also MFC versions if you need.
|
|
|
|
|
thanx i think this is what i was looking for
i will try this and let u knw
thanx anyways
|
|
|
|
|
hello i tried the method u told me .. but its kindda not working for me.
i created event in Constructor (main thread)
intinally reset manualset true
::SetEvent[^] & ::WaitFOrSingleObject[^] before AfxBeginThread()
in threadProcFunction i called ::ResetEvent[^]
actually mine is GUI application (MFC) m able to stop all mouse and keyboard event by doing modelling of parent.
But in maximize and minimize view is being drawn again and again that i dnt want. thats why i want to wait my mainthread for a while. till worker thread does its work
plz help
thankx
|
|
|
|
|
I told you that it was no a good idea to use this technique in an MFC application.
_T("No name") wrote: But in maximize and minimize view is being drawn again and again that i dnt want. thats why i want to wait my mainthread for a while. till worker thread does its work
What do you mean by again and again ? Normally, in an MFC application, the window is only repainted on request (when a WM_PAINT message is sent). So if it is continuously repainting, you are doing something for that. If you want to stop the repainting, just stop doing that thing you are doing (sorry, can't be more accurate without seing any code).
And please, try to avoid txtspk and use correct phrase structures, your question will be much more understandable.
|
|
|
|
|
Hi,
i have a OK button click event..so when user clicked on OK i want to disable window (ie even user tries to press any other buttons or the same button it should not fire any events..)till the previous event is completed...
i used ..
GetDlgItem(IDOK)->EnableWindow(FALSE); in the brgining of the OK click event and
GetDlgItem(IDOK)->EnableWindow(TRUE); at the end of the event....
still im able to fire other events in between...
|
|
|
|
|
You are disabling only IDOK.
Disable the rest of the event buttons also.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hello Pradeep,
Instead of disabling window controls, call LockWindowUpdate()[^] to freeze your window and once your operation is finished, call UnlockWindowUpdate()[^] to make it active again.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
ya even i have tried giving GetDlgItem(IDD_SELECTOR_DIALOG)->EnableWindow(FALSE); then im able to see error .....in BOOL CWnd::EnableWindow(Bool bEnable)
function in winocc.cpp..
error is Access violation reading location 0x00000020..
|
|
|
|
|
Hi,
I have created one application that will used play calls, i have developed this application using MCI (Media Control Interface). I am running my application on the machine which don't have sound cards, that time i am getting one error related MCI.
but that error message is not irrelevant, now i want to change that error message.
Or before starting my application i want to check whether that machine has sound cards installed or not.
Can any one help me out how to check about the sound cards.. It is very urgent requirement for me...
Thanks in advance...
|
|
|
|
|
|
Hi aks,
Thanks for your reply.. I have checked this function on my machine, which is having sound cards, i am able to get the return value is 6.
I have checked the same scenario on the machine which doesn't have sound cards, there i am getting the return value as 1.
I have tried to play mp3 song on that machine, but not able to play that.
I don;t know based on msdn help if no sound cards are enable,
this function should return 0 instead of non zero number...
Can you please explain me this scenario...?
Thanks in advance...
|
|
|
|
|
|
Hi to all,
1. I am developing a directshow filter in VC++ 2008 which will check loss of video/audio from input (which will be the output from MPEG-2 Demultiplexer filter). How can I check the loss or freeze of video/audio from input pid?
2. When there is no input to above filter, function "HRESULT Transform(IMediaSample *pMediaSample)" doesn't get called. In that case, how to transmit self-generated output from the filter? ex. If input video to filter is not present, I want to show error message on Video Renderer.
3. How to create a directshow filter in VC++ 2008 which will have (filter) custom events, such that filter user can use them?
4. DirectShow filter issues I am facing : a) I am not getting property page of "MPEG-2 Multicast Receiver" & "MPEG-2 Multicast Sender" filters in graphedit of my system. b) I am not getting video preview of first added "Video Renderer" filter in my system. Any solution to these issues?
I appreciate any and all comments and suggestions.
Thanks & Regards,
Aniket A. Salunkhe
|
|
|
|
|
Is there any compiler that gives more warnings then visual studio does
and i also want a software for Vc++ code indentation the Project is already built but want to indent its Source code properly so plz help.......
|
|
|
|
|
shaina2231 wrote: Is there any compiler that gives more warnings then visual studio does
Strange..
In visual studio itself if you change the warning level( in the project settings ), you can get more warning . Also there is Code Wizard[^] which can check your code aganist a set of rules such as rules in effective cpp and more effective cpp etc. Try it...
|
|
|
|
|
Plz tell me how to set highest warning level in project settings
|
|
|
|
|
ok i hv set warning level 4
|
|
|
|