首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

发的贴子都没有啥回恢复,大牛们还是来看一下

2013-09-09 
发的贴子都没有啥回回复,大牛们还是来看一下ReqSessionMsgst_reqsessionmsgst_reqsessionmsg.reqSessionH

发的贴子都没有啥回回复,大牛们还是来看一下

ReqSessionMsg  st_reqsessionmsg;
st_reqsessionmsg.reqSessionHeader.type = CN_SPDU_SI;
st_reqsessionmsg.reqSessionHeader.length= 256;
for (int i =0;i<sizeof(uc_sessiondata);i++)
{
st_reqsessionmsg.reqSessionData[i]= uc_sessiondata[i];
}
for (int i =0;i<sizeof(uc_Presentation);i++)
{
st_reqsessionmsg.preHeader[i]= uc_Presentation[i];
}
st_reqsessionmsg.userData.length= 72;
st_reqsessionmsg.userData.UserData.protocol_version = MDDL_VERSION1;
//AssocReqPresentationTrailer 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
//0x00 0x00 0x00 0x00 0x00 我定义成数组了不知道对不对
unsigned char s_ReqPresentationTrailer[]={0x00,0x00,0x00,0x00,0x00,0x00, 0x00, 0x00,0x00 ,0x00 ,0x00 ,0x00 ,0x00, 0x00, 0x00, 0x00};
for (int i =0;i<sizeof(s_ReqPresentationTrailer);i++)
{
st_reqsessionmsg.ReqPresentationTrailer[i]= s_ReqPresentationTrailer[i];
}
char sendmsg[sizeof (st_reqsessionmsg)];
memset(sendmsg,0,sizeof (sendmsg));
memcpy(sendmsg,&st_reqsessionmsg,sizeof (st_reqsessionmsg));
MessageBox(NULL,sendmsg,TEXT("提示"),MB_OK);

sendmsg这个为啥没有数据呢,为空弹了信息
[解决办法]
Methods for Debugging DLLs
If you have the source for both the DLL and the calling program, open the project for the calling executable file and debug the DLL from there. If you load a DLL dynamically, you must specify it in the Additional DLLs category of the Debug tab in the Project Settings dialog box. 

If you have the source for the DLL only, open the project that builds the DLL. Use the Debug tab in the Project Settings dialog box to specify the executable file that calls the DLL.

You can also debug a DLL without a project. For example, maybe you just picked up a DLL and source code but you don’t have an associated project or workspace. You can use the Open command on the File menu to select the .DLL file you want to debug. The debug information should be in either the .DLL or the related .PDB file. After Visual C++ opens the file, on the Build menu click Start Debug and Go to begin debugging.



To debug a DLL using the project for the executable file 

From the Project menu, click Settings. 
The Project Settings dialog box appears.

Choose the Debug tab.


In the Category drop-down list box, select General. 


In the Program Arguments text box, type any command-line arguments required by the executable file.


In the Category drop-down list box, select Additional DLLs.


In the Local Name column, type the names of DLLs to debug. 
If you are debugging remotely, the Remote Name column appears. In this column, type the complete path for the remote module to map to the local module name.

In the Preload column, select the check box if you want to load the module before debugging begins.


Click OK to store the information in your project.


From the Build menu, click Start Debug and Go to start the debugger. 
You can set breakpoints in the DLL or the calling program. You can open a source file for the DLL and set breakpoints in that file, even though it is not a part of the executable file’s project.

To debug a DLL using the project for the DLL 

From the Project menu, click Settings. 
The Project Settings dialog box appears.

Choose the Debug tab.


In the Category drop-down list box, select General. 


In the Executable For Debug Session text box, type the name of the executable file that calls the DLL.


In the Category list box, select Additional DLLs.


In the Local Module Name column, type the name of the DLLs you want to debug.


Click OK to store the information in your project.



Set breakpoints as required in your DLL source files or on function symbols in the DLL.


From the Build menu, click Start Debug and Go to start the debugger. 
To debug a DLL created with an external project 

From the Project menu, click Settings. 
The Project Settings dialog box appears.

Choose the Debug tab.


In the Category drop-down list box, select General.


In the Executable For Debug Session text box, type the name of the DLL that your external makefile builds. 


Click OK to store the information in your project.


Build a debug version of the DLL with symbolic debugging information, if you don’t already have one.


Follow one of the two procedures immediately preceding this one to debug the DLL. 

[解决办法]
单步调试!!
也有可能是sendmsg中真没值!

热点排行