|
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
|
|
|
|
|
Try this Ravi:
CString str = "-123";
int i = atoi((LPCSTR)str);
If it didn't work, simply remove '(LPCSTR)'
|
|
|
|
|
LPCSTR is not necessary. CString has a built-in operator that returns a LPCTSTR.
|
|
|
|
|
Hi Ravi,
We have ready made function for data conversion. You can use the following function to convert CString to int.
CString str = "-123";
int i = atoi(str);
This may be helpful you.
Regards,
Venkat
|
|
|
|
|
we can use that CString class method
such as string Format
CString str = " ";
int i;
i = str.Format("%d",str);
|
|
|
|
|
maheswara wrote:
i = str.Format("%d",str);
CString::Format() dosen't return any value.
suhredayan There is no spoon.
|
|
|
|
|
yeh
it does not any return any value
|
|
|
|
|
maheswara wrote:
yeh
it does not any return any value
So your following suggestion :
i = str.Format("%d",str);
is not correct and CString::Format function is not for converting a string to integer, though you can use it for the reverse purpose.
|
|
|
|
|
no,
CString::Format() only formats a string with some parameters to put into the CString object...
there's no function into the CString class to make the opposite operation.
moreover, here is what MSDN tells us :
void __cdecl Format(
UINT nFormatID,
[, argument]...
);
void __cdecl Format(
PCXSTR pszFormat,
[, argument]...
);
CString::Format() don't return anything !!
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Venkat Bodapati wrote:
We have ready made function for data conversion. [...]
int i = atoi(str);
you wrote atoi() ??? wow, great... i'd be very curious to see the source (YOUR source) ... !
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hello Programmers,
I am having a program that aquires live video signals and displays them on a picture holder. I am trying to identify the pixel color as the user clicks on the video screen. The program gave me an RGB number but obviously not correct. The following is the program on an MFC dialog based application.
void CIdsSimpleLiveDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CString hi;
int ali;
CWnd *pDesktop = GetDlgItem(IDC_DISPLAY);
CDC *pDC = pDesktop->GetWindowDC();
COLORREF clr = pDC->GetPixel(point.x,point.y);
ali = (GetRValue(clr)+GetGValue(clr)+GetBValue(clr))/3;
hi.Format("%d",ali);
AfxMessageBox(hi);
pDesktop->ReleaseDC(pDC);
CDialog::OnLButtonDown(nFlags, point);
}
Note that the notation 'IDC_DISPLAY' represents the ID of the picture holder.
Thanks in advance
|
|
|
|
|
|
yes I am displaying the video and at the same time trying to process the pixels. The problem is that the program doesn't seem to be responding as it does with still images.
|
|
|
|
|
hiho@ll
i just need to sniffer what the user enters and the exact mouse events the user makes (mouse click (which button), mouse moves)
and i need to send such events to the OS (windows)
the problem: 1. i really have no idea how this could work
2. how can i send such events to the OS on an independent way
this means, i just don't know which window is focused (which application gets the events) and that's also what i want! i want to send these events to the OS which processes it for the right application! i don't want to know which app is focused because it's not necessary for what i need to do! (well, later maybe it will be necessary but that's another topic/post)
thx@ll
|
|
|
|
|
Hi,
to log the users keyboard and mouse activity you'll have to take a look
at the 'SetWindowsHookEx' function. This allows you to set system-wide keyboard and mouse
hooks which will receive all keyboard and mouse activity.
Once you have captured the events you can make use of the 'SendInput' function
to send the events to the OS which will handle them as if you were really
typing or moving the mouse...
Don't think you are, know you are...
|
|
|
|
|
Global hook is the solution to your problem, but hooks are not stable and are specifically used for debugging purposes.
While implementing the global hooks be curious O.W it would screw entire system.
Have a look at the API's
SetWindowsHookEx, UnhookWindowsHookEx etc...
You can get tons of information about hooks on codeproject and online MSDN.
All the best !
Cheers,
Vishal
|
|
|
|
|
|
Hi,
I want to disable some functions in the release build.
This is the fucntion:
void func1(...)
{
#ifdef _DEBUG
func2();
#endif //_DEBUG
}
I still see the outputs of func2() in the release build.
My preprocessor definitions for the
release build: WIN32;_CONSOLE;NDEBUG
debug build: WIN32;_CONSOLE;_DEBUG
I don't understand what is wrong. How can i solve the problem? Any help appreciated.
Thanks in advance
|
|
|
|