if(rtVal){ MessageBox(NULL,_T("it is ok!"),_T("Information"), 0); } else{ MessageBox(NULL,_T("it is failure!"),_T("Information"), 0); }
}
the result come with an error,and no ui was showed:
2015.03.27 11:28:37.960Access violation read to 0xDDDDDF6D in 'C:\Users\Administrator\AppData\Roaming\MetaQuotes\Terminal\FF6486332E05B65B7E995E1DD5B90FBE\MQL4\Libraries\MyChartDLL.dll'
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
i need to custom a ui for special chart,the program i wrote as following:
1.mql script
#import "MyChartDLL.dll"
void CreateUI(int hwin);
#import
int winHandle=WindowHandle("USDCADf",PERIOD_H1);
int winHandle=WindowHandle("Lljr",PERIOD_H1);
if(winHandle==0){
Alert("(Lljr Script Error:#8001) An error occurred while initializing script.");
return;
}
//hTerminal = GetAncestor(WindowHandle(Symbol(), Period()), 2);
Print("winHandle=",winHandle);
CreateUI(winHandle);
2.vc++ code
void CreateUI(int hwin){
HWND handle=(HWND) hwin;
hWinChart=handle;
CWnd* win=CWnd::FromHandle(handle);
CView *pNewView=NULL;
pNewView=new CFView();
CCreateContext context;
BOOL rtVal= pNewView->Create(_T("CFView"),_T("CFView"),WS_CHILD | WS_VISIBLE | WS_MAXIMIZE,CFrameWnd::rectDefault,
win, IDD_FORMCHARTUI);
pNewView->OnInitialUpdate();
pNewView->ShowWindow(SW_SHOW); //显示新的视图
pNewView->SetDlgCtrlID(AFX_IDW_PANE_FIRST);
if(rtVal){ MessageBox(NULL,_T("it is ok!"),_T("Information"), 0); } else{ MessageBox(NULL,_T("it is failure!"),_T("Information"), 0); }
}
the result come with an error,and no ui was showed:
2015.03.27 11:28:37.960 Access violation read to 0xDDDDDF6D in 'C:\Users\Administrator\AppData\Roaming\MetaQuotes\Terminal\FF6486332E05B65B7E995E1DD5B90FBE\MQL4\Libraries\MyChartDLL.dll'