|
Sorry, Here is some more explanation !!!
I have a problem while recursively calls a function.
There is a class named "CCompletePath".
void CucDiagramManager::fun()
{
CCompletepath *pComPath=new CCompletePath();
int PathNum=1;
CreateFullPaths(pComPath,PathNum,false); // First call
delete pComPath;
}
bool CucDiagramManager::CreateFullPaths(CCompletePath* pComPath, int &num, bool bCheck)
{
bool rtn=false;
if(num>500000)
{
if(num==500001)
AfxMessageBox("Cannot create more than 500000 paths !");
num++;
return true;
}
PathIndex = pComPath->GetLastItemInPathArray();
if(PathIndex > -1)
{
CPartialPath *pPartialPath = (CPartialPath*) m_UCDPartialPathArray.GetAt(PathIndex);
// iterate through all the partial paths
for(int i=0;i<m_UCDPartialPathArray.GetSize();i++)
{
// get the 'i'th path as a temppath
CPartialPath *pTempPartialPath = (CPartialPath*) m_UCDPartialPathArray[i];
if((pPartialPath->GetNextElementID()) == pTempPartialPath->GetFirstElementID())
{
//Make a new copy
CCompletePath *pNewPath = new CCompletePath(*pComPath);
pNewPath->AddNextElementToArray(i);
//Setting the Complete Path String
if(pComPath->m_sPathString!="")
pNewPath->SetPathString(pComPath->m_sPathString);
if(pPartialPath->m_sPathString!="")
pNewPath->SetPathString(pPartialPath->m_sPathString);
//pNewPath->SetPathString(" " + pPartialPath->m_sPathString);
//Setting The Complete Path Priority
pNewPath->SetPathPriority(pPartialPath->m_dPathPriority);
if((pNewPath->m_dPathPriority < m_dPathLimitMinVal) || (pNewPath->m_dPathPriority << .000001) )
{
delete pNewPath;
return rtn;
}
if((pTempPartialPath->GetNextElementID() == -1))
{
m_CompletePathArray.Add(pNewPath); // add this path to array
i=m_UCDPartialPathArray.GetSize();
num++;
}
else
{
rtn = CreateFullPaths(pNewPath, num, bCheck); // recursive call
delete pNewPath;
}
}
}
}
Because the "pCompPath" object is very large ,I can't use normal object rather than pointer object.
The "CreateFullPaths" function is used to generate some paths.It may be 100,1000.....up to 5,00,000
The above for loop will run up to 1000 or 2000 times...
Because I want to generate more than 1,00,000 paths....
I cannot complete that loop....because "Stack Overflow !"
Help me to solve this ...
Thanks in advance ....
vinsankar
vinsankar
|
|
|
|
|
I sorry, but without formatting (tabs) this code is simply too hard to read. I don't mind helping if I can but you have to meet me half way and make the code readable.
Steve
|
|
|
|
|
Hi guys
In one project I need to capture the frames of webcam
independent of webcam company.
May you please give me information about it .
Regards
Mahdi
|
|
|
|
|
|
Hi
How to switch focus on controls using Tab key in a FrameWnd. The controls are created using CreateWindow function.
Thanx in advance
KK
KK
|
|
|
|
|
while creating the controls specify the style WS_TABSTOP
nave
|
|
|
|
|
Hi
How to specify order of controls
thanks
KK
|
|
|
|
|
the order in which the tab will move will be in the order in which u create the controls...
nave
|
|
|
|
|
|
1)Choose layout/tabOrder from the menu.you see numbers beside each contol.
2)by using mouse u can change the order
sree.
|
|
|
|
|
You can use WS_TABSTOP in Create or use in ModifyStyle
whitesky
|
|
|
|
|
Dear all,
I have created a list control with color changes taking place using "OnCustomdrawMyList".
Later, I wanted to edit the subitems in the listcontrol.I proceeded referring an excellent article titled "Editing Sub-Items in List Control"
by S.PrabhakarReddy.Till then everything was fine.
When I tried to edit the values, I could not see the change taking place in the ListControl while entering values.But change is made & could be seen on pressing Enter.As you guessed right, the user feels discomfortable if he cannot see the values while editing them.
It works fine, but while entering the values I cannot see them since the editbox is lying beneath the listcontrol.I am an amateur in this field.Please explain the steps, I may follow.
Could anyone help me and convert my to
Thank You.
|
|
|
|
|
Create the edit control as the child of the List control...
nave
|
|
|
|
|
I want to use NDoc with Visual C++.NET.I have written the XML tags, but I don't know how can I make the XML file?
Thanks in advance.
|
|
|
|
|
|
I know how to write XML tags in my source code.I have to go to the "configuration properties" of my project property and then go to "C/C++" node, I have to select "Output File" and then change the "Generate XML File " to yes. But this option doesn't exist in the "Output File"? Does Visual C++.NET 2003 support it or not?
Thanks.
|
|
|
|
|
I think NDoc supports only C# and VB .NET. Unfortunately, C++ is not well served by .NET tools.
Kevin
|
|
|
|
|
Visual Studio.NET 2005 supports this ability, but I couldn't find it in Visual Studio.NET 2003. I want to know whether it is possible to make an XML file out of the XML tags in the code or not. It is very important to me to use Visual Studio.NET 2005.Please help me. Thanks.
|
|
|
|
|
I've no idea. I've not used C++ in any of the .NET IDEs. Any C++ I do commercially is always in VC++ 6, and I haven't done any commercial C++ for over a year now.
Kevin
|
|
|
|
|
What is the principle motivation for having .h and .ccp files in visual C++?
Thanks, Moujan
|
|
|
|
|
Seperate the interface from the implementation.
John
|
|
|
|
|
|
Just an aside note: that's not a Visual C++ issue, but a C++ one in general.
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
i find it hard to inherit the class CRecordset with the class wizard. Every time i do two set of files with the same name are created. one outside the folder of my project and one inside.
can you show me another way of adding, updating, and deleting values in a database without creating a new class that inherits the CRecord class.
Thanks...
----------------------------Life is simple, you just complicate things--------------------
|
|
|
|
|
It is not necessary to add with ClassWizard a new CRecordset-derived for each query as long as CRecordset has an Open and a Close method.
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|