|
hello,
I am reading a file in chunks of 512 bytes(i am reading 2 such
blocks).I am calling SetTimer function.And in corresponding OnTimer function
I am writing code for displaying the file data on a NTGraph control placed in
my dialog box.I am calling the KillTimer function after the 2 chunks of data
are displayed as graphs.
But when i close the dialog or press OK/Cancel button the dialog MFC
application error box appears which asks "whether to send the error report to
microsoft".Why is this coming?First i thought maybe the KillTimer function
isnt properly called but that is not the case since when i debugged the
program i got the result that Killtimer is properly called.
Its after i close the .EXE or press OK to close the dialog then the MFC
error box appears.
please please help fast..
p.s.-as i degugged the program an unexpected exception occurs after i press
OK or Close button
thanks
|
|
|
|
|
you should debug step by step until you find the exact line where it crashes. Have you allocated memory? It could be a memory block not released... With the information you have provided I can't tell you more ... If you find the piece of code that is crashing but you don't know why it crashes you could post it.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
So what are you doing in the OnOK() and OnCancel() methods? Is there anything in the dialog's destructor?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
This is my OnTimer() code
CDialogDlg::OnTimer()
{
UpdateData(TRUE);
var_x=0;
static int i=0;
static int j=512;
m_ctrl.ClearGraph();//each time before plotting graph earlier graph on screen erased//
for(;i<j;i++)
{
=""
="" m_ctrl.setelementlinecolor(2000);="" m_ctrl.plotxy(var_x,(double)buff[i],0);="" plotting="" 512="" bytes="" of="" data
="" var_x="var_x+(46.875/1000);
" }
="" j="j+512;//increment" so="" that="" in="" next="" settimer="" loopnext="" chunk="" plotted;i.e.from="" 512-1023bytes=""
="" if(j="">1024)
{
r=KillTimer(s);//If 1024 chunks are plotted i Wish to end call to SetTimer;hence calling KillTimer()//
}
UpdateData(FALSE);
}
I degugged the program by palcing breakpoint on KillTimer function.Both the graphs are plotted successfully an dthen plotting stops(that means KillTimer is called).Now as i press OK/CANCEL/Close button to close the dialog it gives message that unhandled exception occcured in dialog.exe
I am not writing any code in ONOK() orONCANCEL().
When i close the cross mark to close the dialog then also sam eerror occurs
please help
thanks
|
|
|
|
|
I would start by removing both calls to UpdateData() . Use control variables (e.g., CEdit , CButton ) instead.
At the point of the exception, what does the call stack look like?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
what do you mean by removing UpdateData() and using CEdit control.Pease can you guide me in detail in this area. i dont hav e any idea.At the time of exception stack window shows call to CWnd::OnDestroy() function.In that it is getting stuck in some line as i explained in my earlier message
help
thanks
|
|
|
|
|
sayup wrote:
what do you mean by removing UpdateData() and using CEdit control.Pease can you guide me in detail in this area.
See here.
sayup wrote:
At the time of exception stack window shows call to CWnd::OnDestroy() function.
Go down the list until you see a function that belongs to you. It's at that point that you need to focus your attention. By the time you see the exception in CWnd::OnDestroy() , the problem has already happened.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
what is the Difference Between CDC and CClientDC.Please explain a bit.
Be FaithFull To Your Work.
|
|
|
|
|
Hello
As MSDN said:
"The CDC class defines a class of device-context objects. The CDC object provides member functions for working with a device context, such as a display or printer, as well as members for working with a display context associated with the client area of a window."
and
"The CClientDC class is derived from CDC and takes care of calling the Windows functions GetDC at construction time and ReleaseDC at destruction time. This means that the device context associated with a CClientDC object is the client area of a window."
So, CDC is for working with any devices, while CClientDC is for windows client area only.
Andrew
|
|
|
|
|
First i am sorry if its not a proper place for my questions.
1)What is the procedure to make an activex control signed.
2)Is there any description or article available that how cab files are executed by the OS.I am just interested in knowing how does OS execute them.I have tried searching them on Net but can't find any relevant description.
Be FaithFull To Your Work.
|
|
|
|
|
OK. now here's what I want.
1. I have remote ftp server(with ip, user, pwd).
I want to make virtual ftp folder using shell extension which directs me to ftp server after asking about the user, pwd.
Can anyone tell me about the detailed descriptive article on this issue.
Any hint will also be welcome.
|
|
|
|
|
Hi,
is it always possible to upgrade
a VS 6.0 c++ project to vc++ .net ?
Thanks
|
|
|
|
|
Porting and Upgrading (Visual C++)
Explains how to upgrade a project built in a previous version of Visual C++ to Visual C++ .NET, how to port your applications to Visual C++ from a different language, and how to port your Visual C++ application to a different developer tool or operating system.
|
|
|
|
|
I am using MDI Doc- View architecture.
I want to display a new window( Not an MDI Child Window) in full screen format so that i can display GDI information on this window.This new window should close/destroy on mouse click or keyboard hit.
Can anyone give me some
laiju
|
|
|
|
|
laiju wrote:
I want to display a new window( Not an MDI Child Window) in full screen...
Look near the bottom of the app's InitInstance() method. There is a call to ShowWindow() there that you can change.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
thanx..how do i restore this window into its previous state on mouse click or keyboard hit.
laiju
|
|
|
|
|
You'll need to save the frame's initial size with GetWindowRect() .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
You have to use ShowWindow(SW_SHOWMAXIMIZED);
|
|
|
|
|
thanx..how do i restore this window into its previous state on mouse click or keyboard hit.
laiju
|
|
|
|
|
<br />
lRet = lineMakeCall(m_hLine, &m_hCall, szAddress, 0, lpCallParams);<br />
LINECALLSTATUS stLineStatus;<br />
memset(&stLineStatus, 0, sizeof(LINECALLSTATUS));<br />
stLineStatus.dwTotalSize=sizeof(LINECALLSTATUS);<br />
lRet = lineGetCallStatus(m_hCall, &stLineStatus); <br />
I wanted to get the current status of the call.
stLineStatus.dwCallState returned 512.
What does this state imply?
|
|
|
|
|
lphCall
Pointer to an HCALL handle. The handle is only valid after the LINE_REPLY message is received by the application indicating that the lineMakeCall function successfully completed. Use this handle to identify the call when invoking other telephony operations on the call. The application is initially the sole owner of this call. This handle is void if the function returns an error (synchronously or asynchronously by the reply message).
From tapi.h - learn to look up status values...
512 is 0x2000 in hexadecimal
#define LINECALLSTATE_PROCEEDING 0x00000200
Probably because you don't have received the LINE_REPLY message yet, your call is still in progress of dialing, establishing connection, etc.
|
|
|
|
|
Thanks for the information you provided.
I have a few more doubts regarding the line device messages.
As you mentioned in your reply the HCALL handle is valid only after the LINE_REPLY message is received.
Does a SUCCESSS(dwParam2 = 0) in LINE_REPLY indicate that the modem could detect dialtone?
If a call has been successfully made what is the order in which the messages appear?
Is this the order??
LINE_REPLY///success
LINECALLSTATE_DIALING
LINECALLSTATE_RINGBACK
LINECALLSTATE_ACCEPTED
LINECALLSTATE_CONNECTED
I found a sample program here http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dntapi/html/msdn_tapi_30.asp[^]
In my case(that is using the info in above link) the order of messages that i receive is:
LINE_REPLY (always successfull whether dialtone present or not)
LINECALLSTATE_DIALING
LINECALLSTATE_CONNECTED
One final question..
What is the equivalent function to the physical action of picking the receiver from the hook to dial a number???
|
|
|
|
|
1. I am pretty sure the initial LINE_REPLY means that the line is in the ready state to make a call. Not necessarily that a dialtone or any other 'hardware or network signal' has been received or detected.
2. I am not sure of order of messages. It has been several years since I programmed any TAPI and I don't have samples handy to help you troubleshoot. Sorry about that.
3. I think you can pick up receiver by following these not so obvious steps (from MSDN):
The lineDial function can also be used in partial dialing. To initiate a call using partial dialing, the application calls lineMakeCall and specifies a partial dialing string. A partial dial string is any dial string terminated by a semicolon. The call will typically transition to LINECALLSTATE_DIALING after which lineDial can be called to specify more dialing strings, each terminated by a semicolon. Dialing is completed by calling lineDial with a dial string that is not terminated with a semicolon (such as an empty string). This technique allows applications to perform interactive partial dialing with the user or enable more sophisticated dialing than a TSP may be capable of.
Basically, you are initiating a call, but 'failing' to provide a number to initially dial. This would take 'line' off hook and allow you to enter digits at your leisure.
|
|
|
|
|
Hi,
After printing a file, from MFC, i need to get the confirmation from the winspool or the printer about the status of the print [whether printed or failed]. Are there any api's to achieve the same.
Thanks for any help
Vikram Attiganal
|
|
|
|
|
Hello All,
I have to get integer value which is stored in a CString object.
My code
CString str = "-123";<br />
int i;<br />
sscanf (str, "%d", &i);<br />
This is what i followed. Is there any better approach than this?
Thanks for your time
Ravi
|
|
|
|