|
when you press OK button,you get every propertys pages to check it.
|
|
|
|
|
I'll try this but its not works,or i made some mistake .
if possible please explain me with example.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi,
I am using visual studio 2006.I have written one function called GetID in
my code.I have enabled Breakpoint in this function.But it is Disabling while debugging.
char* EnhancedReport::GetId(char *fileName,int flag)
{
char l_ID1[4];
int k = 0, cnt = 0;
size_t fileNamelen = strlen(fileName);
for(int i=0; i< (int)fileNamelen-1; i++)
{
if('_' == fileName[i])
{
cnt++;
}
if(flag == cnt)
{
l_ID1[k] = fileName[i+1];
k++;
}
}
l_ID1[k-1] ='\0';
return l_ID1;
}
can any one help me.
|
|
|
|
|
hemlat wrote: visual studio 2006
2003, 2005 or 2008. I never heard about a Visual Studio 2006 (or are you talking about VC6 ?)
hemlat wrote: I have enabled Breakpoint in this function.But it is Disabling while debugging.
Are you sure that you are debugging the debug configuration and not the release configuration ? Make sure debugging information is enabled in your build.
|
|
|
|
|
Sorry my mistake.
It is visual studio 2005.
|
|
|
|
|
And ? Did you read the end of my message ?
|
|
|
|
|
yes. I am debugging release configuration.I am new to MFC.
I have changed configuration to debug.Then it is showing Link errors.
|
|
|
|
|
hemlat wrote: yes. I am debugging release configuration
Well, that explains why you don't have brekpoints. No debug information is generated for release configuration.
hemlat wrote: I have changed configuration to debug.Then it is showing Link errors.
Each configuration (release and debug) have their own project properties. Thus, you probably added a link setting in your release configuration and forgot to add it also in your debug configuration. MAke sure that everything you added in the release configuration is also added in the debug configuration.
|
|
|
|
|
My project is having Breakpoints and I am able to see all breakpoints while debugging except the function which I mentioned.I think If we did any mistakes in code It happens. If I use l_ID1[i] instead of l_ID1[k] (in second If condition of for loop in my function) break points are coming.But I need to put l_ID1[k] in function.
l_ID1[i] = fileName[i+1];
K++;
|
|
|
|
|
One problem you've definitely got is that you're returning a pointer to a local array (l_ID1 ) - that array will not exist after the function returns - I'm surprised the compiler doesn't warn you about it.. I'd suggest you use a managed string (like CString or std::string) instead.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I have changed My function return type.It is working fine
|
|
|
|
|
I am using visual studio 2008 professional and during compilation, the errors and warnings are all displayed together, making it hard to identify the error messages.
How do I remove the compile warnings during compilation?
And in Visual studio 2005, the warnings and errors have their separate tabs and are nicely separated. Why did microsoft remove this user friendly display and mix both errors and warnings in VS2008.........
|
|
|
|
|
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...
|
|
|
|