exe文件输出的问题 [英] The problems with the output of exe file

查看:70
本文介绍了exe文件输出的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我完成了编程,当我构建一个exe文件时,我的VS10没有通知任何错误和警告,但是当我尝试处理exe文件(从COM端口读取信息)时,出现了很多通知消息. VS10的输出窗口.

I completed do programming and when I built to have an exe file, my VS10 didnt inform any errors and warnings but when I tried to get my exe file processed (Reading the information from COM port), a lot of informed message in the output windows of VS10.

'TestXbee.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
'TestXbee.exe': Loaded 'C:\Windows\System32\user32.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\gdi32.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\lpk.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\usp10.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\shlwapi.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7600.16661_none_ebfb56996c72aefc\comctl32.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\advapi32.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\sechost.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\msimg32.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\oleaut32.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\ole32.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\imm32.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\msctf.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\uxtheme.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\dwmapi.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\mfc100enu.dll', Binary was not built with debug information.
'TestXbee.exe': Loaded 'C:\Windows\System32\cryptbase.dll', Cannot find or open the PDB file
'TestXbee.exe': Loaded 'C:\Windows\System32\clbcatq.dll', Cannot find or open the PDB file
Dumping objects ->
c:\users\long\desktop\testxbee\testxbee\testxbeedlg.cpp(77) : {250} normal block at 0x002376D8, 28 bytes long.
 Data: <t)              > 74 29 BF 00 CD CD CD CD 00 00 00 00 00 00 00 00
Object dump complete.
The program '[636] TestXbee.exe: Native' has exited with code 0 (0x0).



在我程序的已接收"框中,没有显示任何信息.你们可以帮我克服我的处境吗?非常感谢.

我的程序:
#include"stdafx.h"
#include"TestXbee.h"
#include"TestXbeeDlg.h"
#include"iostream"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
静态字符THIS_FILE [] = __FILE__;
#endif
int n;


/////////////////////////////////////////////////////////////////////////////
//用于App About的CAboutDlg对话框About

CAboutDlg类:公共CDialog
{
公众:
CAboutDlg();

//对话数据
//{{AFX_DATA(CAboutDlg)
枚举{IDD = IDD_ABOUTBOX};
//}} AFX_DATA

//ClassWizard生成的虚函数覆盖
//{{AFX_VIRTUAL(CAboutDlg)
受保护的:
虚拟void DoDataExchange(CDataExchange * pDX); //DDX/DDV支持
//}} AFX_VIRTUAL

//实现
受保护的:
//{{AFX_MSG(CAboutDlg)
//}} AFX_MSG
DECLARE_MESSAGE_MAP()
};

CAboutDlg :: CAboutDlg():CDialog(CAboutDlg :: IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}} AFX_DATA_INIT
}

无效CAboutDlg :: DoDataExchange(CDataExchange * pDX)
{
CDialog :: DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}} AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAboutDlg,CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
//没有消息处理程序
//}} AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
//CTestXbeeDlg对话框

CTestXbeeDlg :: CTestXbeeDlg(CWnd * pParent/* = NULL */)
:CDialog(CTestXbeeDlg :: IDD,pParent)
{
//{{AFX_DATA_INIT(CTestXbeeDlg)
m_strReceive = _T(");
m_strResource = _T(");
m_strRSSI = _T(");
//}} AFX_DATA_INIT
//注意,在Win32中,LoadIcon不需要后续的DestroyIcon
m_hIcon = AfxGetApp()-> LoadIcon(IDR_MAINFRAME);
serial = new CSerial();
}

无效的CTestXbeeDlg :: DoDataExchange(CDataExchange * pDX)
{
CDialog :: DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTestXbeeDlg)
DDX_Text(pDX,IDC_EDIT_Receive,m_strReceive);
DDX_Text(pDX,IDC_EDIT_Resource,m_strResource);
DDX_Text(pDX,IDC_EDIT_RSSI,m_strRSSI);
//}} AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CTestXbeeDlg,CDialog)
//{{AFX_MSG_MAP(CTestXbeeDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BUTTON_Clear,OnBUTTONClear)
ON_BN_CLICKED(IDC_BUTTON_Exit,OnBUTTONExit)
ON_BN_CLICKED(IDC_BUTTON_Start,OnBUTTONStart)
//}} AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
//CTestXbeeDlg消息处理程序

BOOL CTestXbeeDlg :: OnInitDialog()
{
CDialog :: OnInitDialog();

//在系统菜单中添加关于..."菜单项.

//IDM_ABOUTBOX必须在系统命令范围内.
ASSERT((IDM_ABOUTBOX& 0xFFF0)== IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX< 0xF000);

CMenu * pSysMenu = GetSystemMenu(FALSE);
如果(pSysMenu!= NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
如果(!strAboutMenu.IsEmpty())
{
pSysMenu-> AppendMenu(MF_SEPARATOR);
pSysMenu-> AppendMenu(MF_STRING,IDM_ABOUTBOX,strAboutMenu);
}
}

//设置此对话框的图标.框架会自动执行此操作
//当应用程序的主窗口不是对话框时
SetIcon(m_hIcon,TRUE); //设置大图标
SetIcon(m_hIcon,FALSE); //设置小图标


返回TRUE; //返回TRUE,除非将焦点设置为控件
}

void CTestXbeeDlg :: OnSysCommand(UINT nID,LPARAM lParam)
{
如果((nID& 0xFFF0)== IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
其他
{
CDialog :: OnSysCommand(nID,lParam);
}
}

//如果在对话框中添加一个最小化按钮,则需要下面的代码
//绘制图标.对于使用文档/视图模型的MFC应用程序,
//框架会自动为您完成此操作.

void CTestXbeeDlg :: OnPaint()
{
如果(IsIconic())
{
CPaintDC dc(this); //绘画的设备上下文

SendMessage(WM_ICONERASEBKGND,(WPARAM)dc.GetSafeHdc(),0);

//客户端矩形中的中心图标
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(& rect);
int x =(rect.Width()-cxIcon + 1)/2;
int y =(rect.Height()-cyIcon + 1)/2;

//绘制图标
dc.DrawIcon(x,y,m_hIcon);
}
其他
{
CDialog :: OnPaint();
}
}

//系统调用此函数以获取要在用户拖动时显示的光标
//最小化的窗口.
HCURSOR CTestXbeeDlg :: OnQueryDragIcon()
{
return(HCURSOR)m_hIcon;
}

CSerial序列号;
void CTestXbeeDlg :: OnBUTTONClear()
{
//TODO:在此处添加您的控件通知处理程序代码
UpdateData();
m_strReceive =";
m_strResource =";
m_strRSSI =";
UpdateData(false);
}

void CTestXbeeDlg :: OnBUTTONExit()
{
//TODO:在此处添加您的控件通知处理程序代码
serial-> Close();
OnOK();
}

void CTestXbeeDlg :: OnBUTTONStart()
{
//TODO:在此处添加您的控件通知处理程序代码
serial-> Open("COM3",0,0,false);
serial-> Setup(CSerial :: EBaud9600,CSerial :: EData8,CSerial :: EParNone,CSerial :: EStop1);
serial-> SetupReadTimeouts(CSerial :: EReadTimeoutNonblocking);
DWORD dwBytesread;
未签名的字符m [16];
无符号字符缓冲区[16];

{
串行-> Read(m,sizeof(m),& dwBytesread);
如果(dwBytesread> 0)
{
for(无符号i = 0; i< dwBytesread; i ++)
{buffer [i] = m [i];
}
}
}
而(dwBytesread == sizeof(m));
n = sizeof(m);
m_strReceive =缓冲区;
CString m_strbuffer;
m_strbuffer = m_strReceive;
a = m_strReceive;
m_strRSSI + =(m_strbuffer.Left(14)).Right(2);
b = m_strRSSI;
m_strResource + =(m_strbuffer.Left(12)).Right(4);
c = m_strResource;


}

上面是我的源代码,但是当我尝试将数据发送到连接到COM3的Xbee时,接收","RSSI"和资源"框中未显示任何信息.
我是VC ++的初学者,因此非常感谢您的所有帮助.



And in the Received box of my program, no information was shown. Could u guys help me to overcome my situation ? Thank you very much.

My program:
#include "stdafx.h"
#include "TestXbee.h"
#include "TestXbeeDlg.h"
#include "iostream"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
int n;


/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About

class CAboutDlg : public CDialog
{
public:
CAboutDlg();

// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA

// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL

// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTestXbeeDlg dialog

CTestXbeeDlg::CTestXbeeDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTestXbeeDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CTestXbeeDlg)
m_strReceive = _T("");
m_strResource = _T("");
m_strRSSI = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
serial = new CSerial();
}

void CTestXbeeDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTestXbeeDlg)
DDX_Text(pDX, IDC_EDIT_Receive, m_strReceive);
DDX_Text(pDX, IDC_EDIT_Resource, m_strResource);
DDX_Text(pDX, IDC_EDIT_RSSI, m_strRSSI);
//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CTestXbeeDlg, CDialog)
//{{AFX_MSG_MAP(CTestXbeeDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BUTTON_Clear, OnBUTTONClear)
ON_BN_CLICKED(IDC_BUTTON_Exit, OnBUTTONExit)
ON_BN_CLICKED(IDC_BUTTON_Start, OnBUTTONStart)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTestXbeeDlg message handlers

BOOL CTestXbeeDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}

// Set the icon for this dialog. The framework does this automatically
// when the application''s main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon


return TRUE; // return TRUE unless you set the focus to a control
}

void CTestXbeeDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}

// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.

void CTestXbeeDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting

SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;

// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}

// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CTestXbeeDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}

CSerial serial;
void CTestXbeeDlg::OnBUTTONClear()
{
// TODO: Add your control notification handler code here
UpdateData();
m_strReceive = "";
m_strResource ="";
m_strRSSI = "";
UpdateData(false);
}

void CTestXbeeDlg::OnBUTTONExit()
{
// TODO: Add your control notification handler code here
serial->Close();
OnOK();
}

void CTestXbeeDlg::OnBUTTONStart()
{
// TODO: Add your control notification handler code here
serial->Open("COM3",0,0,false);
serial->Setup(CSerial::EBaud9600,CSerial::EData8,CSerial::EParNone,CSerial::EStop1);
serial->SetupReadTimeouts(CSerial::EReadTimeoutNonblocking);
DWORD dwBytesread;
unsigned char m[16];
unsigned char buffer[16];
do
{
serial->Read(m,sizeof(m),&dwBytesread);
if (dwBytesread > 0)
{
for (unsigned i = 0; i < dwBytesread ; i++)
{ buffer[i] = m[i];
}
}
}
while (dwBytesread == sizeof(m));
n = sizeof(m);
m_strReceive = buffer;
CString m_strbuffer;
m_strbuffer = m_strReceive;
a = m_strReceive;
m_strRSSI += (m_strbuffer.Left(14)).Right(2);
b = m_strRSSI;
m_strResource += (m_strbuffer.Left(12)).Right(4);
c = m_strResource;


}

The above is my source code but when I tried to send data to a Xbee which is connected to COM3, no information was shown in Receive, RSSI and Resource box.
I''m a beginner with VC++ so all your helps are highly appreciated.

推荐答案

我想,运行具有管理权限的Visual Studio可能会解决您的问题.只需右键单击快捷方式,然后选择以管理员身份运行".
I guess, running visual studio with administrative rights might solve your issue. Just right click the shortcut and select ''Run as Administrator''.


我有一个错误的迭代循环来显示收到的信息.
但是摆脱无法或打开PDB文件"的解决方案像以管理员身份运行一样无济于事.
I had a wrong iteration loops to show the received information.
But the solution to get rid of "cant or open the PDB file" like run as Admintrator cant help.


这篇关于exe文件输出的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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