61BB16EC处的严重错误c0000005 [英] critical error c0000005 at 61BB16EC

查看:98
本文介绍了61BB16EC处的严重错误c0000005的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我制作了一个dll,尝试从metatrader平台调用某些功能.:

Hi,
I made one dll that try call some function from metatrader platform.:

#define WIN32_LEAN_AND_MEAN  // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <vector>
#include <iostream>
#include <cstring>

using namespace std;
//---
#define MT4_EXPFUNC __declspec(dllexport)

struct MqlStr
  {
   int               len;
   char             *string;
  };

  vector<char*> hsymbol;
  vector<char*> hcomment;
  vector<double>hsl;
  vector<double>htp;
  vector<double>hopenprice;
  vector<double>hcloseprice;
  vector<int>hticket;
  vector<int>hopentime;
  vector<int>hclosetime;
  vector<int>hordertype;
  vector<int>hmagic;
  vector<double>horderprofit;

  int htotal=0;

  


MT4_EXPFUNC void __stdcall history(double *h_tp,double *h_sl,int *h_ticket,double *h_openprice,
	double *h_closeprice,int *h_opentime,int *h_closetime,int *h_ordertype, MqlStr *h_symbol,
	MqlStr *h_comment,int *h_magic,double *h_orderprofit, int hordertotal)
  {
	  htotal=hordertotal;
	  
	
	   hsymbol.clear();
  hcomment.clear();
  hsl.clear();
  htp.clear();
  hopenprice.clear();
  hcloseprice.clear();
  hticket.clear();
  hopentime.clear();
  hclosetime.clear();
  hordertype.clear();
  hmagic.clear();
  horderprofit.clear();
	
  hsymbol.resize(htotal);
  hcomment.resize(htotal);;
  hsl.resize(htotal);
  htp.resize(htotal);
  hopenprice.resize(htotal);
  hcloseprice.resize(htotal);
  hticket.resize(htotal);
  hopentime.resize(htotal);
  hclosetime.resize(htotal);
  hordertype.resize(htotal);
  hmagic.resize(htotal);
  horderprofit.resize(htotal);
	  
 
  
  for(int i=0;i<htotal;i++){
  htp[i]=h_tp[i];
  hopenprice[i]=h_openprice[i];
  hcloseprice[i]=h_closeprice[i];
  hticket[i]=h_ticket[i];
  hopentime[i]=h_opentime[i];
  hclosetime[i]=h_closetime[i];
  hordertype[i]=h_ordertype[i];
  hmagic[i]=h_magic[i];
  horderprofit[i]=h_orderprofit[i];
 
  }

  
  return;
  }



当制作dll时,我没有任何错误.

调用函数历史记录后出现此错误:
从61BB16EC的DLL``Test.dll''严重错误c0000005调用函数``历史记录''.

此错误与我的代码有关,还是与我的OS(win7)中的任何问题有关?

我尝试使用固定数组变量而不是向量,但存在相同的错误.

我该如何解决?
Regardsm



When make dll I have not any errors.

After call function history get this error:
function ''history'' call from dll ''Test.dll'' critical error c0000005 at 61BB16EC.

This error is related to my code or any problem in my OS(win7)?

I tried using Fixed array variables instead vector but same error.

How I can fix this?
Regardsm

推荐答案

请看以下链接:
http://fox.wikis.com/wc.dll?Wiki~C0000005ExError
http://www.whollygenes.com/forums201/index.php?showtopic=14839
Let''s see following links:
http://fox.wikis.com/wc.dll?Wiki~C0000005ExError
http://www.whollygenes.com/forums201/index.php?showtopic=14839


这篇关于61BB16EC处的严重错误c0000005的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆