|
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...
|
|
|
|
|
Hi,
By default, when using Ctrl+Tab or the Window menu to switch between windows in a standard MDI app, it leaves the window list in its current order. The behaviour in Visual Studio (ignoring the popup which lists the windows) always puts the current window at the top of the list of windows. This then allows easy toggling between two top windows using Ctrl+Tab, as the previous window is then made the second in the list, so you don't have to cycle through all the open windows to get back to the one you started from.
I am trying to replicate the VS behaviour in an MFC MDI app, but can't find a way of re-ordering the window list. Has anyone else managed to do this?
Paul.
"The way of a fool seems right to him, but a wise man listens to advice" - Proverbs 12:15 (NIV)
|
|
|
|
|
Paul S. Vickery wrote: but can't find a way of re-ordering the window list
I am not sure if you can change menu item positions, I have never tried to do it. If it is not supported perhaps you could manage the lists order in a more appropriate memory structure and just change the menu item text and which item it references in the structure.
|
|
|
|
|
Context is C++, Visual C6
My application has to interface with two types of peripherals, with the same services :
For exemple, the service is :
void SetOutput( index, level) and
So my application do :
void MyApplicationFunc()
{
classPeripheral *p = new classPeripheral();
p->SetOutput( 0, 1);
}
I want to code TWO DLL in C++, with the same class interface, but driving two diffrents kind of peripherals.
For exemple
class cPeripheral
{
public :
cPeripheral();
void SetOutput( int Index, bool Level);
};
But each implementation have differents internal functions and variables in order to drive the specific peripheral.
So I want to have a good quality of code (no cast or void pointer), a good dependency resolution between the differents .dsp, and the possibility to change one DLL (DLL peripheral 1) by the other (DLL peripheral 2) with a perfect consistancy of dynamic link between application and class services.
Can you give me a simple workspace sample, with the differents projects (.dsp) (Application, peripheral 1, peripheral 2), showing the architecture , definition and inter-dependencies between the differents classes.
Best regards.
|
|
|
|
|
You might find one of these design patterns [^] useful.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|