03-18-2008 07:45 AM
{
m_ObjSeq = m_ObjSeqFile->GetSequence(nSeqIndex);
int nNumSteps = m_ObjSeq ->GetNumSteps(StepGroups::StepGroup_Main); for(int nStepIndex = 0; nStepIndex < nNumSteps; nStepIndex++){
m_ObjStep = m_ObjSeq ->GetStep(nStepIndex, StepGroups::StepGroup_Main);
if (m_ObjStep ->IsSequenceCall){
SequenceCallModule ^objm = (SequenceCallModule^)m_ObjStep ->Module;
stepSeqFile1 = m_ObjEngine ->GetSequenceFile(objm ->SequenceFilePath,
GetSeqFileOptions::GetSeqFile_FindFile);
bool bTempReleasedFlag = false; while(bTempReleasedFlag == false){
try{
bTempReleasedFlag = m_ObjEngine->ReleaseSequenceFileEx
(stepSeqFile1, ReleaseSeqFileOptions::ReleaseSeqFile_UnloadFile);
// | //ReleaseSeqFileOptions::ReleaseSeqFile_DoNotRunUnloadCallback); if(bTempReleasedFlag)stepSeqFile1 =
nullptr;}
catch (Exception ^ex){
MessageBox::Show(ex->Message,ex->Source);
}
}
}
//End of IF}
//Step For loop}
//Sequence For loopm_ObjEngine->UnloadAllModules();
bool bReleasedFlag1 = false; while(bReleasedFlag1 == false){
try{
bReleasedFlag1 = m_ObjEngine->ReleaseSequenceFileEx
(m_ObjSeqFile, ReleaseSeqFileOptions::ReleaseSeqFile_UnloadFile);
// Here I am Always get false result //ReleaseSeqFileOptions::ReleaseSeqFile_DoNotRunUnloadCallback);}
catch (Exception ^ex){
bool valu2 = m_ObjSeqFile->UnloadModules();MessageBox::Show(valu2.ToString());
MessageBox::Show(ex->Message,ex->Source);
}
}
03-18-2008 07:55 AM
Hi rkk,
I would think you have to release your object such as the Step object (m_ObjStep), the Adapter object (objm) and the Sequence object (m_ObjSeq) by setting to nothing before you can release the sequence file.
Regards
Ray Farmer
03-18-2008 08:59 AM
Hi,
From where did you get "m_ObjSeqFile" do you obtain it from GetSequenceFileEx?
What is the result of m_ObjSeqFile.IsExecuting(), if you call this before your failure occurs?
Is it possible to post the complete source code that allows opening the hole stuff in an IDE?
Greetings
Juergen
03-18-2008 11:52 PM
Thank you for u r reply.
m_objSeqFile object initialized by using
"GetSequenceFileEx" method. Yes, I am checking for whether file is executing using method "IsExecuting()" and it returns "False".
I modified the code as given bellow
f
(m_ObjSeqFile->HasModel){
m_ObjSeqFile->ModelOption = ModelOptions::ModelOption_NoModel;
m_ObjSeqFile->ModelPath =
nullptr;}
m_ObjSeqFile->UnloadCallbackEnabled =
false;m_ObjSeqFile->UnloadModules();
m_ObjEngine->UnloadAllModules();m_objPropertyObj =
nullptr;m_ObjSeq =
nullptr; bool bReleasedFlag1 = false; while(bReleasedFlag1 == false){
try{
bReleasedFlag1 = m_ObjEngine->ReleaseSequenceFileEx(m_ObjSeqFile, ReleaseSeqFileOptions::ReleaseSeqFile_DoNotRunUnloadCallback);
// | here it returns "true". If I provide ReleaseSeqFile_UnloadFile option then it returns always "FALSE". //ReleaseSeqFileOptions::ReleaseSeqFile_DoNotRunUnloadCallback);}
catch (Exception ^ex){
/*bool valu2 = m_ObjSeqFile->UnloadModules();MessageBox::Show(valu2.ToString());
MessageBox::Show(ex->Message,ex->Source);*/
}
}
m_objPropertyObj =
nullptr;m_ObjSeq =
nullptr;m_ObjSeqFile =
nullptr;m_ObjExe =
nullptr; //m_ObjEngine = nullptr;GC::Collect();
GC::WaitForPendingFinalizers();
Thank you
Regards
RKK
03-19-2008 03:58 AM
Hi rkk
I have written a small C# exe that uses GetSequenceFileEx and ReleaseSequnceFileEx with RleaseSeqFile_UnloadFile
it works with my Testseq.seq. you can also load other Seqfiles.
Also check the state CanUnload.
Why do you use option ReleaseSeqFile_UnloadFile ? and Why not ReleaseSeqFile_NoOptions
Greetings
Juergen
03-19-2008 06:25 AM
03-19-2008 07:22 AM
03-19-2008 10:29 AM - edited 03-19-2008 10:32 AM
03-19-2008 11:37 PM
value = TSth1->WaitForEnd(-1,
true, nullptr, nullptr);After completion of this I tried to unload Other sequence file. But unfortunately it's not happening.
Yes, i.e. in a step's code module.
Regards
RKK
03-20-2008 10:15 AM