|
Maybe you have some strings (or arrays) around the Temp variable, and you assigned too long values to that strings?
|
|
|
|
|
m_monhi wrote:
Does anyone know what the source of this run time error is ?
Could you provide some code snippet..??
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
m_monhi wrote:
Run-Time Check Failure #2 - Stack around the variable 'Temp' was corrupted.
Initialize Temp variable with NULL.. are you using Temp variable without being intialise.. this is common error arises in Visual Studio .net 2003 and above
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Can you show your code that has error
whitesky
|
|
|
|
|
how can we apply socket program to send data from parent dialog to child dialog;
sree.
|
|
|
|
|
And why would one do this?
It's easy to pass data from parent dialog to child dialog using GetParent()......
etc.
However you will have to create a socket in your parent dialog, send data on it and then keep on listening to the port that you are binding the socket to, in your child dialog(in your case).
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
can be more detail on both types please it is very important to me and also urgent.
sree
|
|
|
|
|
wrote:
can be more detail on both types please it is very important to me and also urgent.
Just create the pointer of the Parent dialog into child dialog and before modeling the child dialog just assign the parent dialog pointer and now you can get the access to parent dialog;'s data from its child dialog.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
You can use GetParent() to get the pointer to the parent class in the child dialog and then do whatever you want with those variables.
ex:
CTestDlg* wnd=(CTestDlg*)GetParent ();
wnd->m_edit .SetWindowText ("Anshuman");
where CTestDlg is the parent class and in OnInitDialog of the class associated with the child dialog I have written the above two lines of code. From the second dialog I am setting the text to the edit(m_edit is the control variable) window on the first ie parent dialog
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
here we r sending the data from child to parent.but what our intension from parent to child .because we must send points from parent.
sree.
|
|
|
|
|
I showed you how you can access variables, controls etc from the child dialog that are in the parent dialog. In the same manner you can access functions from the parent dialog in the child dialog. It was not about how you return values from child to parent but it showed how you can do it other way round.
Suppost you are having a function in your parent dialog
CPoint ReturnPoints()
{
return xpoint; //xpoint is a variable in your code of CPoint type
}
You can use this function as
CPoint valueOfPoint=wnd->ReturnPoints();
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
sree_as wrote: here we r sending the data from child to parent.but what our intension from parent to child .because we must send points from parent.
Here m_pParentDlg is declared as Pointer of the Parent dialog into child dialog.
CChildDlg dlg;<br />
dlg.m_pParentDlg=this;<br />
dlg.DoModel();
use the variables of the Parent dialog into Child Dialog as m_pParentDlg->points
Set the points variable before modeling the Child Dialog
Hope now you understand what i want to suggest..
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
I think it is more easy...
wat type of points u need to send???
call the function of child created by u.
here am sending name to child from parent.
I have a function SetName( CString strName ) in child for it.
objChild.SetName( "Sree" );
Keep the name in a varible in Child class and use it.
yours faithfully
ajeeshcv
|
|
|
|
|
sorry to say that the properties of the second dialog is not child it is pop up .is ur code is applicable to this one also,
sree
|
|
|
|
|
I thing this will work in ur case also.
ajeesh
|
|
|
|
|
i keep it mouse move under some condition like for some point call fuction.with i call Domodal iam not getting any errors but at the runtime i got abort,ignore window,afte execution again i geeting abort,ignore dialog.after clicking 5 times ignore my progarm is exiting.this due to that fuction.
please help me,
|
|
|
|
|
HI,
I have build a Client/Server application that transfer a file using Sockets (CSocket class).
Some times with the disconnection of network connection, ful file transfer is not being done.
I want to transfer the file next time form the same position where it was stoped.
any idea / link thant how it can be done.
thanks
Regards.
|
|
|
|
|
May be this is what you need :
See here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
thanks
But its using FTP command, I have build my own server and client that is not using FTP protocol.
Could you please help me in that direction (not FTP involvment) - thanks
Regards.
|
|
|
|
|
zahid_ash wrote: But its using FTP command, I have build my own server and client that is not using FTP protocol.
Could you please help me in that direction (not FTP involvment) - thanks
You have to send back acknowledge from client....make a log of acknowledgement's sent by the client ...and vice versa...and when crash occurs just read the log and do appropriate.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
I want to paly avi file in real time.Meanwhile, I want to get each frame from the avi file then process it. If I don't use DirectShow, would you like give me some methods to realize it? I consulted msdn about AVIStream, but I didn't find any help from it.
Thanks in advance.
dinyxu
|
|
|
|
|
If you just need to display an AVI file without processing, you can use an animation control and macros such as Animate_Open and Anumate_Play . In MFC, you can use CAnimateCtrl control.
If you need to extract frames, you probably have to use AVIStreamGetFrame function.
There is an article which can guide you: http://www.codeproject.com/audio/ExtractAVIFrames.asp[^].
|
|
|
|
|
Purpose of my program is to get notification (a messagebox) whenever a new window is created on the operating system.
In my win32 dll
I put following code.
<br />
#include "stdafx.h"<br />
#include "hookdll.h"<br />
<br />
HHOOK WndHook; <br />
HINSTANCE hInst;<br />
<br />
__declspec(dllexport) bool InstallHook(void); <br />
__declspec(dllexport) bool UninstallHook(void); <br />
__declspec(dllexport) LRESULT CALLBACK WndHookProc(int, WPARAM, LPARAM); <br />
<br />
<br />
<br />
<br />
BOOL APIENTRY DllMain( HANDLE hModule, <br />
DWORD ul_reason_for_call, <br />
LPVOID lpReserved<br />
)<br />
{<br />
switch (ul_reason_for_call)<br />
{<br />
case DLL_PROCESS_ATTACH:<br />
case DLL_THREAD_ATTACH:<br />
case DLL_THREAD_DETACH:<br />
case DLL_PROCESS_DETACH:<br />
break;<br />
}<br />
<br />
hInst = (HINSTANCE)hModule; <br />
<br />
return TRUE;<br />
}<br />
<br />
<br />
HOOKDLL_API int nHookdll=0;<br />
<br />
HOOKDLL_API int fnHookdll(void)<br />
{<br />
return 42;<br />
}<br />
<br />
CHookdll::CHookdll()<br />
{ <br />
return; <br />
}<br />
<br />
<br />
__declspec(dllexport) bool InstallHook(void) <br />
{ <br />
if(WndHook == NULL) <br />
WndHook = SetWindowsHookEx(WH_SHELL, (HOOKPROC)WndHookProc, <br />
hInst, 0); <br />
<br />
return (WndHook != NULL); <br />
} <br />
<br />
__declspec(dllexport) bool UninstallHook(void) <br />
{ <br />
if(WndHook != NULL) <br />
{ <br />
if(UnhookWindowsHookEx(WndHook)) <br />
WndHook = NULL; <br />
} <br />
return (WndHook == NULL); <br />
<br />
<br />
} <br />
<br />
<br />
__declspec(dllexport) LRESULT CALLBACK WndHookProc(int nCode, WPARAM wParam, LPARAM lParam) <br />
{ <br />
if (nCode<0) <br />
return CallNextHookEx(WndHook, nCode, wParam, lParam); <br />
<br />
<br />
::MessageBox(NULL,"Window created","here",MB_OK);<br />
<br />
return CallNextHookEx(WndHook, nCode, wParam, lParam); <br />
}
Now watch my client program.. MFC exe, dialog based. On its OkButton handler
I put following code. I am not using load library and getProce address , because I am linking the library in the project settings and copying the hookdll in the debug directory of my application .
<br />
void CHookclientDlg::OnOK() <br />
{<br />
InstallHook();<br />
}
But my client application can not call InstallHook.
Is this coding right or will it inform all the windows creation. (other applications , threads).
Please tell me
Marcoslav
|
|
|
|
|
Uninitialized WndHook value can cause problems in your InstallHook function.
You should initialize it like this:
HHOOK WndHook = NULL;
What do you mean by "my client application can not call InstallHook"?
|
|
|
|
|
HHOOK WndHook is a global variable and by default its zero.
Regards,
FarPointer
Blog:http://farpointer.blogspot.com/
|
|
|
|