Click here to Skip to main content
15,943,121 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem occur to access dll dialog box Pin
Mark Salsbery12-Nov-08 20:47
Mark Salsbery12-Nov-08 20:47 
QuestionHow to return multiple values in MFC ActiveX? Pin
followait10-Nov-08 22:51
followait10-Nov-08 22:51 
AnswerRe: How to return multiple values in MFC ActiveX? Pin
Roger Stoltz10-Nov-08 23:05
Roger Stoltz10-Nov-08 23:05 
GeneralRe: How to return multiple values in MFC ActiveX? Pin
followait10-Nov-08 23:24
followait10-Nov-08 23:24 
AnswerRe: How to return multiple values in MFC ActiveX? Pin
Roger Stoltz11-Nov-08 0:15
Roger Stoltz11-Nov-08 0:15 
GeneralRe: How to return multiple values in MFC ActiveX? Pin
followait11-Nov-08 15:56
followait11-Nov-08 15:56 
QuestionRe: How to return multiple values in MFC ActiveX? Pin
Roger Stoltz11-Nov-08 22:15
Roger Stoltz11-Nov-08 22:15 
AnswerRe: How to return multiple values in MFC ActiveX? Pin
followait12-Nov-08 3:04
followait12-Nov-08 3:04 
VARIANT CTheaterCtrlCtrl::GetSubareaInfo(VARIANT &id, VARIANT* name, VARIANT* description, VARIANT* row_count, VARIANT* column_count, VARIANT* outline, VARIANT* show_text, VARIANT* pic_url)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	VariantInit(name);
	VariantInit(description);
	VariantInit(row_count);
	VariantInit(column_count);
	VariantInit(outline);
	VariantInit(show_text);
	VariantInit(pic_url);

	MessageBox(L"0");

	VARIANT vaResult;
	VariantInit(&vaResult);
	vaResult.vt=VT_BOOL;
	vaResult.boolVal=VARIANT_FALSE;

	std::list<subarea> & subareas=m_client_wnd.get_theater().get_subareas();
	std::list<subarea>::iterator it=m_client_wnd.get_theater().get_subarea_by_id(id.bstrVal);
	MessageBox(L"1");
	if (it==subareas.end()) {
		return vaResult;
	}
	MessageBox(L"2");

	name->vt=VT_BSTR;
	name->bstrVal=SysAllocString(it->get_name().c_str());
	description->vt=VT_BSTR;
	description->bstrVal=SysAllocString(it->get_description().c_str());
	Seats & seats=it->get_seats();
	row_count->vt=VT_I4;
	row_count->intVal=seats.get_row_count();
	column_count->vt=VT_I4;
	column_count->intVal=seats.get_column_count();

	MessageBox(L"3");

	const std::vector<cpoint> & subarea_outline=it->get_outline();
	SAFEARRAYBOUND rgsabound[1];
	rgsabound[0].lLbound=0;
	rgsabound[0].cElements=subarea_outline.size();
	SAFEARRAY * psa=SafeArrayCreate(VT_UI4,1,rgsabound);
	outline->vt=VT_ARRAY;
	outline->parray=psa;

	UINT HUGEP * pPoint=NULL;
	SafeArrayAccessData(psa,(void HUGEP **)&pPoint);

	MessageBox(L"a");

	std::vector<cpoint>::const_iterator it1=subarea_outline.begin();
	int i=0;
	for (;it1!=subarea_outline.end();++it1) {
		*(pPoint+i)=UINT(MAKELONG(it1->x,it1->y));
		++i;
	}

	MessageBox(L"b");

	SafeArrayUnaccessData(psa);

	MessageBox(L"4");

	show_text->vt=VT_BOOL;
	if (it->get_show_text())
		show_text->boolVal=VARIANT_TRUE;
	else
		show_text->boolVal=VARIANT_FALSE;

	MessageBox(L"5");

	pic_url->vt=VT_BSTR;
	pic_url->bstrVal=SysAllocString(it->get_bk_url().c_str());

	MessageBox(L"6");

	vaResult.boolVal=VARIANT_TRUE;

	return vaResult;
}</cpoint></cpoint></subarea></subarea>


BTW, all MessageBoxes can be displayed.
AnswerRe: How to return multiple values in MFC ActiveX? Pin
Roger Stoltz12-Nov-08 3:20
Roger Stoltz12-Nov-08 3:20 
GeneralRe: How to return multiple values in MFC ActiveX? Pin
followait13-Nov-08 3:21
followait13-Nov-08 3:21 
QuestionAVI Player Pin
tanmay.kol10-Nov-08 22:49
tanmay.kol10-Nov-08 22:49 
AnswerRe: AVI Player Pin
Hamid_RT11-Nov-08 3:33
Hamid_RT11-Nov-08 3:33 
GeneralRe: AVI Player Pin
tanmay.kol11-Nov-08 23:42
tanmay.kol11-Nov-08 23:42 
GeneralRe: AVI Player Pin
Hamid_RT12-Nov-08 5:49
Hamid_RT12-Nov-08 5:49 
QuestionCRichEditCtrl Problem of displaying text as hyperlink Pin
Dhiraj kumar Saini10-Nov-08 22:40
Dhiraj kumar Saini10-Nov-08 22:40 
QuestionRe: CRichEditCtrl Problem of displaying text as hyperlink Pin
David Crow11-Nov-08 3:17
David Crow11-Nov-08 3:17 
QuestionExecuting Sort.exe using ShellExecute()... etc Pin
Mick Leong10-Nov-08 21:22
Mick Leong10-Nov-08 21:22 
QuestionRe: Executing Sort.exe using ShellExecute()... etc Pin
CPallini10-Nov-08 22:33
mveCPallini10-Nov-08 22:33 
AnswerRe: Executing Sort.exe using ShellExecute()... etc Pin
David Crow11-Nov-08 3:20
David Crow11-Nov-08 3:20 
Questionproblem creating a colored icon Pin
tudorbalan10-Nov-08 21:19
tudorbalan10-Nov-08 21:19 
AnswerRe: problem creating a colored icon [modified] Pin
Mark Salsbery11-Nov-08 6:56
Mark Salsbery11-Nov-08 6:56 
GeneralRe: problem creating a colored icon Pin
tudorbalan11-Nov-08 10:34
tudorbalan11-Nov-08 10:34 
GeneralRe: problem creating a colored icon Pin
Mark Salsbery11-Nov-08 11:28
Mark Salsbery11-Nov-08 11:28 
GeneralRe: problem creating a colored icon Pin
tudorbalan12-Nov-08 0:16
tudorbalan12-Nov-08 0:16 
GeneralRe: problem creating a colored icon Pin
Mark Salsbery12-Nov-08 6:58
Mark Salsbery12-Nov-08 6:58 

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.