Click here to Skip to main content
15,898,826 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to convert string to array of bytes? Pin
SandipG 24-Aug-08 21:58
SandipG 24-Aug-08 21:58 
GeneralRe: How to convert string to array of bytes? Pin
CPallini24-Aug-08 21:41
mveCPallini24-Aug-08 21:41 
QuestionSnapShot Of a Volume Pin
john563224-Aug-08 20:11
john563224-Aug-08 20:11 
AnswerRe: SnapShot Of a Volume Pin
john563224-Aug-08 21:28
john563224-Aug-08 21:28 
GeneralRe: SnapShot Of a Volume Pin
Perspx24-Aug-08 22:59
Perspx24-Aug-08 22:59 
GeneralRe: SnapShot Of a Volume Pin
toxcct24-Aug-08 23:21
toxcct24-Aug-08 23:21 
GeneralRe: SnapShot Of a Volume Pin
Perspx24-Aug-08 23:24
Perspx24-Aug-08 23:24 
QuestionWorking fine in the first run, but crashes in the second run [modified] Pin
ptr_Electron24-Aug-08 20:08
ptr_Electron24-Aug-08 20:08 
The below mentioned code Working fine in the first run, but crashes in the second run
---------------------------
nav.exe - Application Error
---------------------------
The instruction at "0x000003f8" referenced memory at "0x000003f8". The memory could not be "read".

Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------
OK Cancel
---------------------------


.h


typedef struct THREADSTRUCT_SCOPE			
		{
		 long maxRowCount;              
		AttMap selection;        
		MsgList *results;           
		AOL *assets; 
		

		THREADSTRUCT_SCOPE( const Scope* ptr )  
		: _this( ptr )
		{}   const Scope *_this;

		} THREADSTRUCT_SCOPE;
		THREADSTRUCT_SCOPE *_param;



.cpp

<pre>
SysScope::SysScope
(
)
{
		_param= new THREADSTRUCT_SCOPE( this );
}



SysScope::~SysScope()
{
	delete _param;
}




bool Scope::genericSearchByAtt
(

const long maxRowCount, // I: Maximum number of rows to return
const AttMap& selection, // I: Selection attributes
MessageList& results, // U: Result
AOL& assets, // O:
int ObjectType //
)
const
{

invalidArgAssert(maxRowCount > 0 &&
selection.contains(Id::Attr_ClassType));
.....
...
....
assets.push_back(asset);// CRASHES HERE only druring Second run


}



bool Scope::searchByAttributes
(
const long maxRowCount, // I: Maximum number of rows to return
const AttMap& selection, // I: Selection attributes
MsgList& results, // U: Result messages are appended
AOList& assets // O: Asset objects
)
const
{

HANDLE hThread;
_param->assets = &assets;
_param->maxRowCount = maxRowCount;
_param->results = &results;
_param->selection = &selection;

hThread=(HANDLE)_beginthreadex(0,0,WorkerThread,(void*) _param,0,0);

while (1) //iThDone!=1
{
if (iThDone==1)
break;
DoEvents9();
}
return true;
}


unsigned __stdcall Scope::WorkerThread(void* param)
{

THREADSTRUCT_SCOPE* ts = (THREADSTRUCT_SCOPE*)param;

BASE_ASSERT(ts->_this->genericSearchByAtt(ts->maxRowCount,
*ts->selection, *ts->results, *ts->assets, Asset::Type) );

iThDone=1;

return 1;

}

modified on Monday, August 25, 2008 3:07 AM

AnswerRe: Working fine in the first run, but crashes in the second run Pin
_AnsHUMAN_ 24-Aug-08 20:23
_AnsHUMAN_ 24-Aug-08 20:23 
GeneralRe: Working fine in the first run, but crashes in the second run Pin
ptr_Electron24-Aug-08 21:10
ptr_Electron24-Aug-08 21:10 
GeneralRe: Working fine in the first run, but crashes in the second run Pin
ptr_Electron24-Aug-08 22:43
ptr_Electron24-Aug-08 22:43 
AnswerRe: Working fine in the first run, but crashes in the second run Pin
Jijo.Raj25-Aug-08 2:38
Jijo.Raj25-Aug-08 2:38 
GeneralRe: Working fine in the first run, but crashes in the second run Pin
ptr_Electron25-Aug-08 3:14
ptr_Electron25-Aug-08 3:14 
GeneralRe: Working fine in the first run, but crashes in the second run Pin
ptr_Electron25-Aug-08 3:44
ptr_Electron25-Aug-08 3:44 
GeneralRe: Working fine in the first run, but crashes in the second run Pin
Jijo.Raj25-Aug-08 7:11
Jijo.Raj25-Aug-08 7:11 
QuestionCalling functions from dll.. Pin
VCProgrammer24-Aug-08 20:06
VCProgrammer24-Aug-08 20:06 
AnswerRe: Calling functions from dll.. Pin
_AnsHUMAN_ 24-Aug-08 20:20
_AnsHUMAN_ 24-Aug-08 20:20 
GeneralRe: Calling functions from dll.. Pin
ThatsAlok24-Aug-08 21:51
ThatsAlok24-Aug-08 21:51 
GeneralRe: Calling functions from dll.. Pin
_AnsHUMAN_ 25-Aug-08 1:25
_AnsHUMAN_ 25-Aug-08 1:25 
GeneralRe: Calling functions from dll.. Pin
ThatsAlok25-Aug-08 1:30
ThatsAlok25-Aug-08 1:30 
AnswerRe: Calling functions from dll.. Pin
ThatsAlok24-Aug-08 21:52
ThatsAlok24-Aug-08 21:52 
QuestionHelp MS FlexGrid SetColWidth problem! [modified] Pin
fantasy121524-Aug-08 20:02
fantasy121524-Aug-08 20:02 
AnswerRe: Help MS FlexGrid SetColWidth problem! Pin
fantasy121524-Aug-08 22:23
fantasy121524-Aug-08 22:23 
QuestionHow to include transparent dialogs in MFC vc6.0 Pin
M usman Saleem24-Aug-08 19:55
M usman Saleem24-Aug-08 19:55 
AnswerRe: How to include transparent dialogs in MFC vc6.0 Pin
Jijo.Raj24-Aug-08 20:33
Jijo.Raj24-Aug-08 20:33 

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.