Click here to Skip to main content
15,916,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to Use CRITICAL_SECTION and InitializeCriticalSection(&CriticalSection); Pin
jerry1211a3-May-04 2:02
jerry1211a3-May-04 2:02 
AnswerRe: How to Use CRITICAL_SECTION and InitializeCriticalSection(&CriticalSection); Pin
Alexander M.,3-May-04 2:07
Alexander M.,3-May-04 2:07 
GeneralApplication Error Pin
lvidot3-May-04 1:55
lvidot3-May-04 1:55 
GeneralRe: Application Error Pin
Alexander M.,3-May-04 2:02
Alexander M.,3-May-04 2:02 
GeneralRe: Application Error Pin
lvidot3-May-04 7:32
lvidot3-May-04 7:32 
GeneralRe: Application Error Pin
jmkhael3-May-04 3:02
jmkhael3-May-04 3:02 
GeneralRe: Application Error Pin
Joe Woodbury3-May-04 4:53
professionalJoe Woodbury3-May-04 4:53 
GeneralRe: Application Error Pin
lvidot3-May-04 21:33
lvidot3-May-04 21:33 
This is save function that save the structure to the vector:
Please note that I need to save(push) several Face structure in the vector.
that is each time I press the Apply button, I need to push a different set of Face to the vector:


code:--------------------------------------------------------------------------------
void CFeature::saveFeatures (std::vector < Face > & Feat)
{

Feat.push_back(FaceFeat);
return;
}
--------------------------------------------------------------------------------


Then I have a button (Saveft) on my FormView to save the Vector to a file:


code:--------------------------------------------------------------------------------
void CFeature::OnSaveft()
{
CMFFADoc* pDoc = GetDocument();


// Synchronize all other views
pDoc->UpdateAllViews( this );
WriteFaceVector(ftname , Feat);
}
--------------------------------------------------------------------------------


This function write the vector to the file.
I'm taking info (Structure) from a video file(.vid) and save them in a new file with the same name as the video file but with (.fea) ext:


code:--------------------------------------------------------------------------------
bool CFeature::WriteFaceVector( char * ftname , const vector<face> & v)
{
m_FtFileName = VC.m_VidFileName;

//Need to convert file name from CString to Char*
ftname = m_FtFileName.GetBuffer(m_FtFileName.GetLength());

char* pos;

pos = strrchr(ftname,'.');//Find the ext
*(pos+1) = 0;
strcat(ftname,"fea"); //Create new ext
ofstream m_FeatureFile(ftname,ios::binary);
if (!m_FeatureFile) return false;

std::vector<face>::size_type size(v.size());
m_FeatureFile.write(reinterpret_cast<const char*="">(&size), sizeof (std::vector<face>::size_type));

for(std::vector<face>::size_type i =0; i < size; ++i)
{
if(0 != size)
m_FeatureFile.write(reinterpret_cast<const char*="">(&v[i]), size * sizeof (Face));
}
return true;
}
GeneralRe: Application Error Pin
Joe Woodbury4-May-04 4:16
professionalJoe Woodbury4-May-04 4:16 
GeneralEditBox event notification behavior with single line &amp; multiline option. Pin
Anonymous3-May-04 1:45
Anonymous3-May-04 1:45 
GeneralRe: EditBox event notification behavior with single line &amp; multiline option. Pin
David Crow3-May-04 2:17
David Crow3-May-04 2:17 
GeneralRe: EditBox event notification behavior with single line &amp; multiline option. Pin
gUrM33T3-May-04 5:07
gUrM33T3-May-04 5:07 
GeneralRe: EditBox event notification behavior with single line &amp; multiline option. Pin
kenjox3-May-04 21:29
kenjox3-May-04 21:29 
GeneralWinword style zooming Pin
BlueSimon3-May-04 1:31
BlueSimon3-May-04 1:31 
GeneralRe: Winword style zooming Pin
Monty23-May-04 3:28
Monty23-May-04 3:28 
GeneralConvert long to SYSTEMTIME Pin
ykutanoor3-May-04 1:24
ykutanoor3-May-04 1:24 
GeneralRe: Convert long to SYSTEMTIME Pin
Dominik Reichl3-May-04 1:45
Dominik Reichl3-May-04 1:45 
GeneralRe: Convert long to SYSTEMTIME Pin
_moved3-May-04 2:39
_moved3-May-04 2:39 
GeneralLogin into msn Pin
?!?3-May-04 1:20
?!?3-May-04 1:20 
GeneralRe: Login into msn Pin
Alexander M.,3-May-04 1:52
Alexander M.,3-May-04 1:52 
GeneralRe: Login into msn Pin
?!?3-May-04 2:27
?!?3-May-04 2:27 
GeneralRe: Login into msn Pin
Alexander M.,3-May-04 2:44
Alexander M.,3-May-04 2:44 
GeneralRe: Login into msn Pin
?!?3-May-04 2:49
?!?3-May-04 2:49 
GeneralRe: Login into msn Pin
jmkhael3-May-04 2:58
jmkhael3-May-04 2:58 
GeneralSetting Data in a DLL Pin
Grahamfff3-May-04 0:52
Grahamfff3-May-04 0:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.