|
I think your problem of first parameter of SendTo(const void*,how did you se msg?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
i even tried type casting as msg is char datatype but its not working.
Thanks
|
|
|
|
|
What is msg ? Are you only sending 1 byte of data (sizeof(char) will have 1 as a result) ?
|
|
|
|
|
yes i am sending one byte of data as char msg='v',but its not working.
Thanks
|
|
|
|
|
Hi,Even i faced the same problem,you must have created some array with new and either forgot to delete it or deleting it after the value is changed.
Thanks A Ton
Ash_VCPP
|
|
|
|
|
i hav nt created any array as such only one character i am sending with msg='v'.can u please tell me how you solved your problem,i will try to do that
Thanks
|
|
|
|
|
I dont see any issue with the code, but if you can then please go for win32 socket apis you will feel better....like
1.s = socket(AF_INET, SOCK_STREAM, 0);
2.connect(.....);
3.and finally send() and recv()
Thanks A Ton
Ash_VCPP
|
|
|
|
|
i am working with connectionless protocol....there is no need of connect there.is there ne diff between win32 socket api or MFC socket API.As i have gone through later one....please do tell me tat.
Thanks alot.
|
|
|
|
|
well i am not quite sure coz every time i used win32 apis not mfc.......so in that respect i can assist you.......please review ur code to check new-delete funda......i feel somewhere you are deleting a variable from heap whose value is changed.....
Thanks A Ton
Ash_VCPP
|
|
|
|
|
if u don't mind can i send u code because i am not finding any way to search for the deleted variable
thanks for your reply
|
|
|
|
|
Hi Priyanka,
You can send me the code in which the problem is with the error message which u are getting.....
Thanks A Ton
Ash_VCPP
|
|
|
|
|
Most likely an uninitialized local variable (the compiler sets these to 0xCCCCCCCC in debug builds).
Steve
|
|
|
|
|
there is no uninitialized local variable.....can u please tell me how to check tat is there uninitialized local variable is there or not in solution file or not
|
|
|
|
|
I meet a problem when I call the another MFC DLL's function.
I create two projects.
First project is called maxProjectMFCDLL, which is a MFC DLL project.
maxProjectMFCDLL.def's content as below:
LIBRARY "maxProjectMFCDLL"
EXPORTS
fDoExport @1
maxProjectMFCDLL.cpp's additional content as below:
int fDoExport(int a)
{
MessageBox(NULL,"name","Warn",MB_OK);
return TRUE;
}
Second project is called TestDialog, which is a MFC Dialog project.
I add a button to the dialog and add the function OnBnClickedButton1 for clicking the button.
void CTestDialogDlg::OnBnClickedButton1()
{
typedef int (CALLBACK* D_MYEXPORT)(int);
HMODULE l_mod;
D_MYEXPORT l_export=NULL;
int l_ret=0;
l_mod=LoadLibrary(L"..\\maxProjectMFCDLL.dll");
if (l_mod!=NULL)
{
int a=1;
l_export=(D_MYEXPORT)GetProcAddress(l_mod,"fDoExport");
l_ret=l_export(a);
FreeLibrary(l_mod);
}
}
After I build the Frist and Second projects, run the Second project. VC++ appear a error message(http://cid-fbeb6373d9321a7f.skydrive.live.com/self.aspx/Questions/MFC%20DLL.JPG).
The message is "Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one callinc convention with a function pointer declared with a different calling convention."
Could somebody tell me how to solve this problem?
I put my complete source code at http://cid-fbeb6373d9321a7f.skydrive.live.com/self.aspx/Questions/3ds%20max%20Plugin%20Two%20Project%20Q2.rar
|
|
|
|
|
In maxProjectMFCDLL.cpp declare the function as
int __stdcall fDoExport(int a)
{
MessageBox(NULL,"name","Warn",MB_OK);
return TRUE;
}
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thank you, «_Superman_». I finally solve this problem. May I ask where do you get the answer? (read which book or see which web)
|
|
|
|
|
This was from personal experience
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Super man, which function you tried?
|
|
|
|
|
Q1.I'm trying to write an MFC program in EVC++ 4.0 on window CE 5.0 that lists the disk drives on the system (C:, D:, and so on). I also need to know if the drive is a hard disk or a USB. Is there a class to get this information?
Q2. What are Windows Volume Management Functions in EVC++ 4.0 on window CE 5.0?
priyank
|
|
|
|
|
Hi,
I am using SHGetDataFromIDList to get CLSID of Recycler folder of D drive. But the below code is not giving CLSID except dwDescriptionID.
CLSID is coming garbage value like CCCCC.CCCC
where
lptvid->lpsfParent=Shell folder for D drive
lptvid->lpi=PIDL of Recycler folder
SHDESCRIPTIONID lpsf1;
if(SUCCEEDED(SHGetDataFromIDList(lptvid->lpsfParent,lptvid->lpi,SHGDFIL_DESCRIPTIONID,(LPVOID *)&lpsf1,sizeof(LPSHDESCRIPTIONID))))
{
cb=GetLastError();
if(lpsf1.clsid==CLSID_RecycleBin)
AfxMessageBox(_T("Matched"));
}
Where I am wrong?
|
|
|
|
|
Hello
I have a CRichEditCtrl class which displays contents on a CMDIChildWnd nad now I want to print on paper. Can I print without carrying my contents to CDC and only through CRichEditCtrl?
Prithaa
|
|
|
|
|
Don't think so - have a look at this article[^] - it's got all hte rich-edit printing code you could want
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I would like to add a graph (x vs y plot ) to my application. I would like this graph to be displayed in a new window. Therefore, I wrote the following code:
<br />
void<br />
CMyView::drawGraph()<br />
{<br />
<br />
CRect rect1( 100, 200, 300, 400 );<br />
CreateEx( 0, NULL, TEXT("Graph"), WS_OVERLAPPEDWINDOW|WS_CHILD,<br />
rect1, this, 0 );<br />
}<br />
<br />
Unfortunately, the call to CWnd::CreateEx dies with an assertion error. The routine CWnd::CreateEx<br />
calls the routine AfxHookWindowCreate. This routine has the following assert statement in it:<br />
<code><br />
ASSERT(pWnd->m_hWnd == NULL);
In my case, m_hWnd is non-NULL. Therefore, the program aborts. I am sure that I am doing something
wrong in the call to CreateEx but I do not know what it is. Also, I find the documentation for
this call to be lacking. For one thing, I could not find any examples where it was used to create
a sub-window.
Thanks
Bob
|
|
|
|
|
BobInNJ wrote: CRect rect1( 100, 200, 300, 400 );
CreateEx( 0, NULL, TEXT("Graph"), WS_OVERLAPPEDWINDOW|WS_CHILD,
rect1, this, 0 );
Effectively, here you are trying to create CMyView again, where it already exists.
You may want to do something like this
CRect rect1( 100, 200, 300, 400 );
m_wndYouwantotCreate.CreateEx( 0, NULL, TEXT("Graph"), WS_OVERLAPPEDWINDOW|WS_CHILD,
rect1, this, 0 );
|
|
|
|
|
You can create another window from your view, but it will be a bit complex.
I can think of a couple of choices for you...
The simplest one is to create a new CDialog based class, that only has one control in it. You can find plenty of graph controls here on codeproject that you can pop in this dialog. Then just call DoModal on it, let it stay up until the user presses OK, and all is nice.
The other is a bit more complex. You could make a window like a popup control with your little graph on it, that goes away when the user moves the mouse again. This depends on how you want your software to be. Have a look at:
http://www.dilascia.com/PixieDoc.htm#CPopupText[^]
for a tooltip alike window - just change the drawing code / size to your desires.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|