|
Thank you for your advice
|
|
|
|
|
|
The problem is right at the end of the function cmaze() : there you call the same function, recursively. That means for every step, your program will push one more function call on the stack, and it won't resolve it until the very end.
Don't do that kind of thing. Instead use the return code to indicate whetehr or not you need to do another step, and create a loop:
Change the function cmaze to:
bool cmaze(int& i, int& j) {
if (maze[out][N]=='.')
return false;
return true;
}
Change your call to cmaze in makebg() to:
i = in;
j = 1;
while (cmaze(i, j));
|
|
|
|
|
You are right and your suggestions let me learn more,thanks
|
|
|
|
|
i took an MFC application written in VS2010
opened in in win8 with visual studio 2012
got the following errors:
error C1083: Cannot open include file: "tmschema.h": No such file or directory (afxwin.h)
it returns in several cases
anyway can help?
thanks
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
YaronNir wrote: anyway can help?
Does tmschema.h exist?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
actually you are right, it doesn't
will check more
thanks
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
|
The include file "tmschema.h" is part of the Microsoft SDK (in v6.0 and v7.0), and is included by Visual Studio 2010 (in afxwin.h). However, Visual Studio 2012 doesn't appear to have the correct include files and/or libraries.
I'm looking to see if there's a known solution, and I'll post here again when I've worked it out!
|
|
|
|
|
hello guys... I have these two track bars on my form. Now even though I check which tracked bar was clicked; it still executes the code twice which is very awkward. Here is what I am trying
void CMainDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
if((CSliderCtrl*)pScrollBar == &m_trackONE)
{
}
if((CSliderCtrl*)pScrollBar == &m_trackTWO)
{
}
}
It correctly recognizes which track bar I clicked but why does it starts executing all over again? thanks for any pointer.
This world is going to explode due to international politics, SOON.
|
|
|
|
|
does nSBCode change between calls?
|
|
|
|
|
Thanks for ur time. It does change. For both track bars I checked this and both times
- on first call nSBCode had a value of 3
- on second call nSBCode had a value of 8
This world is going to explode due to international politics, SOON.
|
|
|
|
|
3 = SB_PAGERIGHT
8 = SB_ENDSCROLL
so, it's telling you two different things
|
|
|
|
|
Chris Losinger wrote: so, it's telling you two different things
Well I am afraid I don't know its meaning. What should I do? Should I be worried or something?
This world is going to explode due to international politics, SOON.
|
|
|
|
|
SB_ENDSCROLL just means the user has let go of the mouse button and is no longer interacting with the control, so scrolling is done. you can probably ignore it.
|
|
|
|
|
Overloaded_Name wrote: Well I am afraid I don't know its meaning. What should I do? Should I be worried or something?
Probably you should have a look at this[^]!
|
|
|
|
|
Since pScrollBar can't point to two controls at the same time during the same call to OnHScroll() , the second if() statement should have an else in front of it.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
We have a utility that needs to maximize resources. We stop indexing by stopping the wsearch service. But within a matter of minutes it restarts. I thought there might be a connection to Outlook but even with outlook not started this happens.
We would rather not set the service to disabled. If anyone has any information or suggestions it is appreciated.
Thanks, kc
In the event log i see these two messages associated with the indexing restart.
Event 102, ESENT
Windows (6604) Windows: The database engine (6.01.7601.0000) started a new instance (0).
and
Event 1003, Serach
The Windows Search Service started.
--------------------------------------------------------------------------------
|
|
|
|
|
Before I start, I'll admit to feeling dirty for even considering such an approach..
However, it sounds very much like the service has a watch-dog application monitoring it. Once the monitoring app detects that it is no longer running, it simply restarts the service.
If this is the case, you may be able to fool the watch-dog app. Often this type of arrangement has a Mutex at it's heart. The service creates a mutex, the watch-dog then tries periodically to create a mutex with the same name. If the operation fails, the service is still running as per normal. If on the other hand, the mutex creation is successful, one can safely assume that the intended creator of the mutex (the service) has ceased running and taken the mutex with it.
On second thoughts, scratch that idea - it's a service that comes bundled with Windows. It seems likely that Windows itself maintains an in-memory list of services and their current state.
On third thoughts, I can't think of a way of doing this (other than with the standard Services dialogs) that couldn't reasonably be considered a hack. Nonetheless,
I just read a thread in which one writer spoke of having to change the permissions on some registry key(s?) in order to change the service startup type...
Last post here.[^]
I guess that leaves you an avenue of investigation:
- Change the reg-key to indicate Disabled, kill the service. Once proessing done, set Automatic (Delayed Start) then let windows start the service up when 'needed'.
No idea which RegKey though..
|
|
|
|
|
Is this a C/C++/MFC question is disguise?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Wolfkc wrote: We would rather not set the service to disabled.
I don't understand that.
You "disable" the service by stopping it or pausing it (if it allows that.)
You have a process that runs for X amount of time. I presume that you want to insure that the service is not running for that amount of time. And presumably after your process completes then you want to allow the service to continue to run.
So your options are to "disable" the service or reconfigure it to insure that it doesn't run. The first is more certain to succeed and less complex. Reconfiguring it is not certain because at best you can only insure that it will not be running at some future time. And in both cases you must restore it to the correct running state.
|
|
|
|
|
Hello Experts,
My project required a cmd prompt type control which can take command and diskplay result. I used CRichEditText control to accomplish this. But It is slow while drawing beacuse when I need to display text I have to use GetWindowText() + Append Test then SetWindowText().Everytime it displaying the whole content again.
Is there any workwround to solve this problem?
|
|
|
|
|
john5632 wrote: when I need to display text I have to use GetWindowText() + Append Test then SetWindowText().Everytime it displaying the whole content again.
why ?
and wouldn't that create an endless loop?
draw, append, redraw, reappend, reredaw, rereappend....
|
|
|
|
|
Try positioning the cursor at the end of the edit using CRichEditCtrl::SetSel[^] and then use CRichEditCtrl::ReplaceSel[^] to add the new text. This still won't be too fast but probably faster than what you use now.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
Have you looked at other projects here on CP that do the same thing? Here's one[^], but I've seen others (do a search).
|
|
|
|