|
马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
VC++中MFC建立的应用程序关闭对话框时出现“0x21016d9f指令引用的0xccccccc8内存,该内存不能为read”!
请问高手这是怎么回事?是不是内存释放有问题,或者没有调用析构函数?
部分代码如下:
// bianxiaodlg.cpp : implementation file
//
#include "stdafx.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include "featuremodeling.h"
#include "bianxiaodlg.h"
#include <stdio.h>
#include <math.h>
#include <uf.h>
#include <uf_defs.h>
#include <uf_exit.h>
#include <uf_ui.h>
#include <uf_styler.h>
#include <uf_mb.h>
#include <uf_part_types.h>
#include <uf_part.h>
#include <uf_modl.h>
#include <uf_obj.h>
#include <uf_obj_types.h>
#include <windows.h>
#include <Winuser.h>
/////////////////////////////////////////////////////////////////////////////
// Cbianxiaodlg dialog
Cbianxiaodlg::Cbianxiaodlg(CWnd* pParent /*=NULL*/)
: CDialog(Cbianxiaodlg::IDD, pParent)
{
//{{AFX_DATA_INIT(Cbianxiaodlg)
//}}AFX_DATA_INIT
}
void Cbianxiaodlg:: DoDataExchange(CDataExchange* pDX)
{
CDialog:: DoDataExchange(pDX);
//{{AFX_DATA_MAP(Cbianxiaodlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(Cbianxiaodlg, CDialog)
//{{AFX_MSG_MAP(Cbianxiaodlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Cbianxiaodlg message handlers
BOOL Cbianxiaodlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
UpdateData(TRUE);
PLD=(CEdit *)GetDlgItem(IDC_EDIT1);
PLR=(CEdit *)GetDlgItem(IDC_EDIT3);
PLn=(CEdit *)GetDlgItem(IDC_EDIT4);
LR=(CEdit *)GetDlgItem(IDC_EDIT5);
L2RT=(CEdit *)GetDlgItem(IDC_EDIT6);
L2A=(CEdit *)GetDlgItem(IDC_EDIT7);
L2B=(CEdit *)GetDlgItem(IDC_EDIT8);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void Cbianxiaodlg::OnOK()
{
// TODO: Add extra validation here
CString D,R,n,RL,RT,A,B;
tag_t part,new_part2;
tag_t m_part2=NULL_TAG;
UF_PART_load_status_t error_status;
int num_of_exp=0,i,ok;
char partname[]="E:\\ug1\\WP7_1.prt";
unsigned int aa=1;
tag_t *exps=&aa,exp_tag;
char *string,*lhs_str,*rhs_str;
int type=1,unit=4;
// char* title=null;
int m_type2;
double exp_value=50;
char cc='q';
char *s=&cc;
char *p1="PL_D",*p2="PL_R",*p3="PL_n",*p4="L_R",*p5="L2_RT",*p6="L2_A",*p7="L2_B";
UF_UI_selection_options_t opts;
UF_UI_mask_t mask = {UF_solid_type, 0, UF_UI_SEL_FEATURE_BODY};
/* Make sure User Function is available. */
UF_initialize();
if ( UF_initialize()!= 0)
// return ( UF_UI_CB_CONTINUE_DIALOG );
MessageBox("初始化失败");
/* ---- Enter your callback code here ----- */
opts.num_mask_triples = 5;
opts.mask_triples = &mask;
opts.scope = UF_UI_SEL_SCOPE_WORK_PART;
PLD->GetWindowText(D);
PLR->GetWindowText(R);
PLn->GetWindowText(n);
LR->GetWindowText(RL);
L2RT->GetWindowText(RT);
L2A->GetWindowText(A);
L2B->GetWindowText(B);
UF_PART_open(partname,&part,&error_status);
part=UF_PART_ask_display_part();
/* fail=UF_MODL_ask_mass_props_3d(&part,
num_part,
type,
unit,
density,
accuracy,
acc_val,
massprop,
massprop_stat);
*/
UF_MODL_ask_exps_of_part(part,&num_of_exp,&exps);
for(i=0;i <num_of_exp;i++)
{
UF_MODL_ask_exp_tag_string(exps |
|