|
your info is very interesting, but there is just one little problem... WHAT ABOUT DETAILED INFORMATION!?!?
Don't try it, just do it!
|
|
|
|
|
the structure representing different feature points on a face, which is extracted from a video frame.
struct Face
{
int Mouth;
int Eye;
int nose
int FrameNo;
};
When I press the Apply button on my FormView, it save my Structure to my vector called 'Feat'.
This is save function the save 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:
void saveFeatures (std::vector < Face > & Feat)
{
Feat.push_back(FaceFeat);
return;
}
I manage to save the first frame, but when I try to save another frame I get the following error.
" This instruction at "0x102125fe" referenced memory at "0x00000092". The memory could not be written.
Click on OK to terminate the program".
lvidot
|
|
|
|
|
Seems like you are accessing memory addresses that are not allocated.
Try hitting the debug button when this happens, or run it under the debugger, and you get the call stack.
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
In Win32, you cannot address the lowest 64k of memory. (0x00000000-0x0000ffff.) (Kernel objects, like drivers, cannot address the highest 64k of memory: 0xffff0000-0xffffffff.) This causes an exception when dereferencing a NULL pointer and when using an indexed NULL pointer.
In other words if char* pBuffer were NULL, *pBuffer and pBuffer[0x65] would throw memory exceptions. I suspect the errors you are seeing are the latter.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
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;
}
|
|
|
|
|
All I can suggest is for you to step through your code AND STL (no matter how nightmarish it is) line by line. You are dereferencing a bad pointer; maybe you didn't allocate something, maybe a destructor is being called; maybe a copy constructor isn't doing what you think it's doing. It could be a myriad of things. (STL itself is likely not at fault, just how it's being used. It may not even be STL.)
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 to everyone reading this!
I have noticed a "strange" behavior with the Edit control.
|
|
|
|
|
Anonymous wrote:
I have noticed a "strange" behavior with the Edit control.
And that "strange behavior" would be what?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
lolol....
I find it strange to even have an answer to what i wrote because i accidentally pressed a button and what i was trying to write got add to the message board before even start writting anything....
But anyway today i wrote again the hall matter so u can find info about the strange behavior....
|
|
|
|
|
I've an application that use RichEdit. Right now, I want to add a functions that can let users choose different zooming factors like 50%, 100%, 200%, etc. like those work in winword. However, I've no idea how to start. Could any experts help me? Thanks!
BlueSimon
|
|
|
|
|
change the font and the window size according to the zoom settings
i can't even remember what my point is now, but anyway, i'm correct
Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.
|
|
|
|
|
Convert long to SYSTEMTIME
long day =24,mm =4,year =1976;
I need to convert day ,month,year to SYSTEMTIME.
How?
|
|
|
|
|
long day =24,mm =4,year =1976;<br />
SYSTEMTIME st;<br />
<br />
ZeroMemory(&st, sizeof(SYSTEMTIME));<br />
st.wYear = (WORD)year;<br />
st.wMonth = (WORD)mm;<br />
st.wDay = (WORD)day;
Best regards,
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
you mean, day,mm,year are stored in one long ?
asume year is stored in high word and day+month in low word:
systime.wDay= (BYTE)lDate; // low byte low word
systime.wMonth= (WORD)(lDate>>8)&0xFF; // hi byte
systime.wYear= (WORD)(lDate>>16)&0xFFFF; //hi word
you may change it depending on
sequence in which values are stored in long
|
|
|
|
|
Guys,
i want my program to read the username and password from an edit box (this is the easy part) in order to login to the msn (any version, say 6)..
is this possible?
|
|
|
|
|
there are some articles about reading passwort edit boxes on CP!
Don't try it, just do it!
|
|
|
|
|
this isnt not my issue
i want to login to msn from the code!
|
|
|
|
|
send a click message to the connect button
Don't try it, just do it!
|
|
|
|
|
?!
more clarification please
|
|
|
|
|
|
I need to modify a library that is used by a C-Scripting application to allow a MFC application to stop and start the processing.
The DLL builds OK, but both the application which loads the dll and the script that checks the flag always see the flag a false (0).
However I get the abortFlag is always 0 (false); see code snips below:-
First the Modifed section of th DLL project:-
#define DLLDIR __declspec(dllexport) // export DLL information
// The extern "C" declaration allows mixed languages compactability, it prevents
// the C++ compiler from using decorated (modified) names for the functions
extern "C" { <-------- Error here !!!!!!!!!!!
void DLLDIR APPSetAbortFlag(int);
int DLLDIR APPGetAbortFlag(void);
};
static int abortFlag; /* The flag to abort the test */
static int contiuneFlag; /* The flag to schedule the test to continue */
static int enterFlag; /* The flag to schedule data entry the test */
int APPGetAbortFlag()
{
return abortFlag;
}
void APPSetAbortFlag(int a)
{
if(a == 1)
abortFlag = 1;
else
abortFlag = 0;
}
Next the section of code for the application that uses the DLL:-
typedef void (*APPSETABORTFLAG)(int); // Pointer to APPSetAbortFlag(int)
typedef int (*APPGETABORTFLAG)(void); // Pointer to function int APPGetAbortFlag()
hMod = LoadLibrary("WHLLib.dll");
pGetAbortFlag = (APPGETABORTFLAG) GetProcAddress(hMod, "APPGetAbortFlag");
pSetAbortFlag = (APPSETABORTFLAG) GetProcAddress(hMod, "APPSetAbortFlag");
I set the flag like:-
UINT value = 1;
(pSetAbortFlag)(value);
and read the flag like:-
int result = (pGetAbortFlag) ();
Are they a problem with the use of the item of data in the DLL?
grahamfff
|
|
|
|
|
|
I am trying to have an MFC application that shares data with a DLL.
The DLL is loaded via a batch file in a C-Scripting environment.
I have included the following lines of code in both the EXE and DLL
#pragma data_seg(".CSL_DATA")
int volatile abortFlag = 0; /* The flag to abort the test */
int volatile contiuneFlag = 1; /* The flag to schedule the test to continue */
int volatile enterFlag = 0; /* The flag to schedule data entry the test */
#pragma data_seg()
#pragma comment(linker, "/SECTION:.CSL_DATA,RWS")
On the C-Scripting side of things the batch file loads the DLL as follows:-
#loadlibrary 'WHLLIB'
However any changes in the data (abortFlag say) is not reflected in the other side.
Basically all I want is the 3 variables to be visible by the libray and the application.
Am I doing it wrong?!?
|
|
|
|
|
I need to display XML in IE Com control. This XML is translated by xslt (some external file, presented by end-user), and after i change source xml i want IE somehow to synchronize it's representation...
|
|
|
|