|
I did not realy think it would work, but it was worth a try. We must be missing some Information, because this has nothing to do with TAPI and every thing to do with Windows.
I am sorry, but I must go to sleep! It is 8:43 AM here and I have no idea when I got up yesterday, but I do know that I have until tommarrow to finish what I should be working on.
Good night, good mourning, good after-noon, or whatever.
INTP
Every thing is relative...
|
|
|
|
|
Ok I understand, however I explain you that my tsp when go, connect to a pbx, so I want to create a message box that, in case of connection failed because the user have made a mistake when have configed the tsp, pop up and warns which parameter of connection is wrong...if is the ip address or pbx address, or whatever...I hope that this information explain much more better my situation...
However Good night for now...
|
|
|
|
|
Just a guess, but you mention svchost. If your code is being called from a service, then the messagebox will either fail, or appear on a different windows station. A read of the MessageBox[^] API shows a flag of MB_SERVICE_NOTIFICATION. This may do what you want.
If that doesn't help, then you may have to create a named pipe, and write your message to that. Also create a "normal" application, whose only job is to read that pipe, and display any messages in it. Just an example, I'm sure there are lots of ways to solve that problem.
Iain.
|
|
|
|
|
OK!!!Thanks a lot it works!!!
|
|
|
|
|
Hi,
I am playing wav file by using PlaySound() function in ASYNC mode. Here i want to know whether file completed playing or not. I mean to say that i want to findout the stop event of playing file.
can anyone plz help me.
trinadh
|
|
|
|
|
You can't know stop event of PlaySound().
Instead see the msdn help about MM_MCINOTIFY and mciSendCommand.
(below example is from http://kblee.sangji.ac.kr/cpp-text/hdj_07.htm[^])
Enjoy.
MyMenu MENU
BEGIN
POPUP "&CD"
BEGIN
MENUITEM "&Play", 100
MENUITEM "&Next", 200
MENUITEM "&Prev", 300
MENUITEM "P&ause", 400
MENUITEM "&Resume", 500
MENUITEM "&Stop", 600
END
END
#include <windows.h>
#include <string.h>
#include <mmsystem.h>
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
DWORD Open(HWND hWnd);
void Play(HWND hWnd, DWORD dwID);
void Stop(HWND hWnd, DWORD dwID);
void Pause(HWND hWnd, DWORD dwID);
void Close(HWND hWnd, DWORD dwID);
void MoveStartPosition(HWND hWnd, DWORD dwID);
DWORD MoveStartCurrentPosition(HWND hWnd, DWORD dwID);
void SetCurrentPosition(HWND hWnd, DWORD dwID, DWORD dwPos);
void SetFormat(HWND hWnd, DWORD dwID);
DWORD MoveNextTrack(HWND hWnd, DWORD dwID);
DWORD MovePrevTrack(HWND hWnd, DWORD dwID);
int WINAPI WinMain
(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszArg, int nCmdShow)
{
static char szAppName[] = "Multimedia Example";
HWND hWnd;
MSG msg;
WNDCLASS WndClass;
WndClass.style = CS_HREDRAW|CS_VREDRAW;
WndClass.lpfnWndProc = WndProc;
WndClass.cbClsExtra = 0;
WndClass.cbWndExtra = 0;
WndClass.hInstance = hInstance;
WndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
WndClass.hbrBackground = GetStockObject(WHITE_BRUSH);
WndClass.lpszMenuName = "MyMenu";
WndClass.lpszClassName = szAppName;
if(!RegisterClass(&WndClass))
return FALSE;
hWnd = CreateWindow(
szAppName,
szAppName,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL
);
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK
WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static DWORD dwID;
static BOOL bPause, bNext, bPrev;
switch(message)
{
case WM_CREATE :
dwID = Open(hWnd);
SetFormat(hWnd, dwID);
return 0;
case MM_MCINOTIFY :
if(bPause)
{
SetCurrentPosition(hWnd, dwID,
MoveStartCurrentPosition(hWnd, dwID));
bPause = FALSE;
}
else if(bNext)
{
SetCurrentPosition(hWnd, dwID,
MoveNextTrack(hWnd, dwID));
bNext = FALSE;
Play(hWnd, dwID);
}
else if(bPrev)
{
SetCurrentPosition(hWnd, dwID,
MovePrevTrack(hWnd, dwID));
bPrev = FALSE;
Play(hWnd, dwID);
}
else
MoveStartPosition(hWnd, dwID);
return 0;
case WM_COMMAND :
switch(LOWORD(wParam))
{
case 100 :
Play(hWnd, dwID);
break;
case 200 :
Pause(hWnd, dwID);
bNext = TRUE;
break;
case 300 :
Pause(hWnd, dwID);
bPrev = TRUE;
break;
case 400 :
Pause(hWnd, dwID);
bPause = TRUE;
break;
case 500 :
Play(hWnd, dwID);
break;
case 600 :
Stop(hWnd, dwID);
break;
}
return 0;
case WM_DESTROY :
Close(hWnd, dwID);
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
DWORD Open(HWND hWnd)
{
MCI_OPEN_PARMS mciOpenParms;
MCIERROR mciError;
mciOpenParms.lpstrDeviceType = "cdaudio";
mciError = mciSendCommand(NULL, MCI_OPEN, MCI_OPEN_TYPE,
(DWORD)&mciOpenParms);
if(mciError)
MessageBox(hWnd, "Open Error!!", "Error", MB_OK);
return mciOpenParms.wDeviceID;
}
void Play(HWND hWnd, DWORD dwID)
{
MCI_PLAY_PARMS mciPlayParms;
MCIERROR mciError;
mciPlayParms.dwCallback = (DWORD)hWnd;
mciError = mciSendCommand(dwID, MCI_PLAY, MCI_NOTIFY,
(DWORD)&mciPlayParms);
if(mciError)
MessageBox(hWnd, "Play Error!!", "Error", MB_OK);
}
void Stop(HWND hWnd, DWORD dwID)
{
MCI_GENERIC_PARMS mciGenericParms;
MCIERROR mciError;
mciError = mciSendCommand(dwID, MCI_STOP, MCI_WAIT,
(DWORD)&mciGenericParms);
if(mciError)
MessageBox(hWnd, "Stop Error!!", "Error", MB_OK);
}
void Pause(HWND hWnd, DWORD dwID)
{
MCI_GENERIC_PARMS mciGenericParms;
MCIERROR mciError;
mciError = mciSendCommand(dwID, MCI_PAUSE, MCI_WAIT,
(DWORD)&mciGenericParms);
if(mciError)
MessageBox(hWnd, "Pause Error!!", "Error", MB_OK);
}
void Close(HWND hWnd, DWORD dwID)
{
MCI_GENERIC_PARMS mciGenericParms;
MCIERROR mciError;
mciError = mciSendCommand(dwID, MCI_CLOSE, MCI_WAIT,
(DWORD)&mciGenericParms);
if(mciError)
MessageBox(hWnd, "Resume Error!!", "Error", MB_OK);
}
void SetFormat(HWND hWnd, DWORD dwID)
{
MCI_SET_PARMS mciSetParms;
MCIERROR mciError;
mciSetParms.dwTimeFormat = MCI_FORMAT_TMSF;
mciError = mciSendCommand(dwID, MCI_SET, MCI_SET_TIME_FORMAT,
(DWORD)&mciSetParms);
if(mciError)
MessageBox(hWnd, "Resume Error!!", "Error", MB_OK);
}
void MoveStartPosition(HWND hWnd, DWORD dwID)
{
MCI_SEEK_PARMS mciSeekParms;
MCIERROR mciError;
mciError = mciSendCommand(dwID, MCI_SEEK, MCI_SEEK_TO_START,
(DWORD)&mciSeekParms);
if(mciError)
MessageBox(hWnd, "Set Length Format Error!!", "Error", MB_OK);
}
DWORD MoveStartCurrentPosition(HWND hWnd, DWORD dwID)
{
MCI_STATUS_PARMS mciStatusParms;
MCIERROR mciError;
mciStatusParms.dwItem = MCI_STATUS_POSITION;
mciError = mciSendCommand(dwID, MCI_STATUS, MCI_STATUS_ITEM,
(DWORD)&mciStatusParms);
if(mciError)
MessageBox(hWnd, "Status Position Error!!", "Error", MB_OK);
return mciStatusParms.dwReturn;
}
void SetCurrentPosition(HWND hWnd, DWORD dwID, DWORD dwPos)
{
MCI_STATUS_PARMS mciStatusParms;
MCI_SEEK_PARMS mciSeekParms;
MCIERROR mciError;
mciSeekParms.dwTo = dwPos;
mciError = mciSendCommand(dwID, MCI_SEEK, MCI_TO, (DWORD)&mciSeekParms);
if(mciError)
{
mciStatusParms.dwItem = MCI_STATUS_CURRENT_TRACK;
mciError = mciSendCommand(dwID, MCI_STATUS, MCI_STATUS_ITEM,
(DWORD)&mciStatusParms);
if(mciError)
MessageBox(hWnd, "Status Position Error!!", "Error", MB_OK);
}
}
DWORD MoveNextTrack(HWND hWnd, DWORD dwID)
{
MCI_STATUS_PARMS mciStatusParms;
MCIERROR mciError;
mciStatusParms.dwItem = MCI_STATUS_CURRENT_TRACK;
mciError = mciSendCommand(dwID, MCI_STATUS, MCI_STATUS_ITEM,
(DWORD)&mciStatusParms);
if(mciError)
MessageBox(hWnd, "Status Position Error!!", "Error", MB_OK);
return ++mciStatusParms.dwReturn;
}
DWORD MovePrevTrack(HWND hWnd, DWORD dwID)
{
MCI_STATUS_PARMS mciStatusParms;
MCIERROR mciError;
mciStatusParms.dwItem = MCI_STATUS_CURRENT_TRACK;
mciError = mciSendCommand(dwID, MCI_STATUS, MCI_STATUS_ITEM,
(DWORD)&mciStatusParms);
if(mciError)
MessageBox(hWnd, "Status Position Error!!", "Error", MB_OK);
return --mciStatusParms.dwReturn;
}
Anderson Sheen (exteide@gmail.com)
The Extension IDE: http://www.exteide.com
|
|
|
|
|
Hi,
I just bought a third party SDK that came with some DLLs & LIBs.
I wanted to keep those DLLs & LIBs in my product directory.
So, I added my path to Project -> MyProeject Properities ->
Linker -> General -> Additional Library Directories.
But I still got the link error. I probably missed some
steps.
Can someone tell me what else I need to do?
Thanks,
Kevin
|
|
|
|
|
It seems that you did not add the names of the libraries in the Linker.
After including the paths of the directories, you will also need to give the names of the .lib files. Or directly give the fully qualified path to the libs.
In VC6 it is located in the Link tab -> Object/Library modules.
In VC7 I think it is Linker->Input->Additional Dependencies.
this is this.
|
|
|
|
|
I am using VC6.
> you will also need to give the names of the .lib files.
>Or directly give the fully qualified path to the libs
Can you where to do so?
>In VC6 it is located in the Link tab -> Object/Library modules.
I checked the
Project -> MyProeject Properities -> Linker
But I don't see the Ojbect/Library moudles.
Am I look at the wrong place?
Thanks,
Kevin
|
|
|
|
|
In VC6, the additional libraries paths is:
Project->Settings->Link->Category : Input ->Additional Libraries path: ___
On the link tab, select Input from the Category combo box.
Then you can plainly give the names of the lib files in the Object/library modules.
Again, are you sure you are using VC6 and not VS .NET? Because as you said it is Myproject Properties ->Linker etc.
this is this.
|
|
|
|
|
which version of VS are you using...
Owner drawn
Jesus Loves
|
|
|
|
|
|
Hi !!
I am using CPropertySheet in my DLL.And In that, it Contain 5 PropertyPages.
On DLL OnIntiDialog...It gives the CpropertySheet size (top=0,left=0,right=215,bottom=220).
But For on of the propertypages this size is not enough..
Is there any problem if I increase the size of propertypage(i.e,right is 215 to 220)?????
Can any one please give methe solution.....
It's very Important...
Regards,
klvin.
|
|
|
|
|
The size of a propertyy sheet is governed by the size of the largest property page.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hi
do you know a ANALITIC way to know if a point is inside or outside an area delimited by a closed polyline?
The polyline, for me, is a list of points on cartesian plane (type = double)
Thank you
Have a nice code day
|
|
|
|
|
use the points to create a region
CreatePolygonRgn()
then use PtInRegion()
|
|
|
|
|
Sorry
My polyline isn't a graphic instrument, and I can't use CPoint because they are int; I need to use doubles.
And unfortunatly the code of the functions that you posted to me calls 'build-if' functions: so they aren't visualyzable or modifycable
Have a nice code day
|
|
|
|
|
I didn't get you.
What does build-if funtions mean?
The data are in double. But how are you displaying them.
Before drawing the image are you converting them to int? or typecast etc.
|
|
|
|
|
|
Your going to like me....
The very clever stuff was taken almost exactly from http://www.faqs.org/faqs/graphics/algorithms-faq/ which is a superb repository of this sort of stuff.
I'm sure you could make a more compact version of this stuff, but many of these functions are used elsewhere in my code, so it made sense to keep them multi-purpose.
ptPoly is an array of the vertices of the polygon.
BOOL PointInPolygon (const CPoint *ptPoly, const int nPoints, const CPoint ptTest)
{
return (LineCrossesPolygon (ptPoly, nPoints, CPoint (-99999999, ptTest.y), ptTest) % 2) == 1;
}
int LineCrossesPolygon (const CPoint *ptPoly, const int nPoints, const CPoint ptA1, const CPoint ptA2)
{
int nPt, nCross = 0;
for (nPt = 0; nPt < nPoints; nPt++)
{
if (LinesIntersect (ptA1, ptA2, ptPoly [nPt], ((nPt + 1) == nPoints) ? ptPoly [0] : ptPoly [nPt + 1], NULL))
nCross++;
}
return nCross;
}
BOOL LinesIntersect (CPoint a, CPoint b, CPoint c, CPoint d, CPoint *ptIntersect)
{
if (Colinear (a,b,c,d))
return FALSE;
double rTop, rBot, sTop, sBot, r, s;
double Ax = a.x, Ay = a.y, Bx = b.x, By = b.y, Cx = c.x, Cy = c.y, Dx = d.x, Dy = d.y;
rTop = (Ay-Cy)*(Dx-Cx)-(Ax-Cx)*(Dy-Cy);
rBot = (Bx-Ax)*(Dy-Cy)-(By-Ay)*(Dx-Cx);
sTop = (Ay-Cy)*(Bx-Ax)-(Ax-Cx)*(By-Ay);
sBot = rBot;
if (sBot == 0.0)
return FALSE;
r = rTop / rBot;
if (r < 0.0)
return FALSE;
if (r > 1.0)
return FALSE;
s = sTop / sBot;
if (s < 0.0)
return FALSE;
if (s > 1.0)
return FALSE;
if (ptIntersect)
*ptIntersect = InterpolatePoint (a, b, r, 1.0);
return TRUE;
}
BOOL Colinear(CPoint a, CPoint b, CPoint c, CPoint d)
{
int dot = (b.x-a.x)*(d.y-c.y) - (d.x-c.x)*(b.y-a.y);
return !dot;
}
CPoint InterpolatePoint (CPoint Begin, CPoint End, double Which, double OutOf)
{
CPoint pt;
pt.x = (int)InterpolateDouble (Begin.x, End.x, Which, OutOf);
pt.y = (int)InterpolateDouble (Begin.y, End.y, Which, OutOf);
return pt;
}
double InterpolateDouble ( double Begin, double End, double Which, double OutOf)
{
if (OutOf == 0.0)
return Begin;
return ((End - Begin) * Which / OutOf) + Begin;
}
Good luck!
Iain.
|
|
|
|
|
Thank you!!!
Great link
Have a nice code day
|
|
|
|
|
Thank U
able to get good knowledge, great site
|
|
|
|
|
Hey Guys,
I have a a dialog with id IDD_AGREE_FRAME_ABSTRACTION and its associated with a class CSegisAgreementsLeaseAbs. But when i want to see any inforation in the class wizard its not showing there. I have a check box in the dialog and i want to associate this chk box to a variable using class wizard and its giving me meaasge that IDD_AGREE_FRAME_ABSTRACTION is a new resource. You want to associate it to a class..........,etc. Please help me why its not showing and how to fix it.
|
|
|
|
|
delete the .clw file and open the class wizard again.
the .clw file will be created again and this time you will see the class.
-- modified at 4:39 Friday 3rd February, 2006
|
|
|
|
|
Hey Thanks a lot for this. But i am having another problem. I am able to see the class in class whizard but when i try to open this class in class wizard its giving me one error as
Parsing error: Expected ")",
Input Line: "//DDX_Text(pDX, IDC_LE_TENANT_IMPROV_AMT, mcs_le_improv_amt);"
This line is there in the dodata exchange. What i need to do for this. Pleas suggest.
|
|
|
|
|