|
hi,
i have developed a dialog based appliation, it has a button "help" in it, it launches or shows the help when it is pressed, Besides that i would like to add the feature which launches the help when F1 is pressed.
how can i do that? any Sample code?
can anyone help me in this regard,
thanks in advance,
paul
|
|
|
|
|
y r not u using Accelarator?
God is real unless declared int..
|
|
|
|
|
Aryan S wrote: y r not u using Accelarator?
i think you're suggestion is pertinent.
however, why don't you speak an english that every one understand (i mean, well written) ?
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
i think he just came out of writting a long sms.
-Prakash
|
|
|
|
|
My application needs allocate disk space to some of it's directories.
For example: directory "Client1" with 2 mb and directory "Client2" with 3 mb
My application should be able to write data of (2+3) 5 mb to those
directories.
But with or *without* writing any data, The Windows should feel those
directories have taken that much space. Or when other applications check the
free disk space, Windows must show 5 mb less in the actual
space. IS any functions are there to partiton the hard disk and also to lock the folder
Please help me
-- modified at 7:00 Friday 3rd February, 2006
|
|
|
|
|
Well just fill a file with zeros ::- ).
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
I do not know if that is possible, directly.
Here is a way that you may be able to do it:
1) create a file that takes up the required space. This file contains no valid data, it is just a place holder. The idea here is just to insure that you have at least that much disk space to work with.
2) When you need to add another file to the directory, calculate how many bytes of data it will require. Then reduce the size of the place holder by that many bytes, before you save the new file. I recommend that durring testing, that you verify that the number of bytes you calculated matches the actual number of bytes required.
That should do the trick, but there are many other things you should consider provided that the number of bytes required might excceed what you think they will.
INTP
Every thing is relative...
|
|
|
|
|
ok sir
Is there any function specific how to partition the hard disk to allocate some space for my application,also how to lock (or) hide folder in vc
|
|
|
|
|
First, do not throw around the word partition so casualy. A partial answer would be yes, but only why your program is running. I am not talking about partitioning the hard-drive (do not even think of doing that), I am talking about reserving space on the disk. How you would do it I can not say, because I would need to do research just like you. I have a book around here some where that would probably tell me exactly how to do it. But the method I originaly sugested should work on any system, it does not require that your program be running in order for the space to be reserved.
INTP
Every thing is relative...
|
|
|
|
|
ok sir
Tell the some useful books which i could refer for memory management and i have one thing how to restrict the folder so that other user shoud not access my folder
|
|
|
|
|
How to allocate space dynamically to my application.Is there any functions to use and how can it be usefull explain me ok.
|
|
|
|
|
It *almost* sounds like you need to use sparse files.
Another solution would be to use SetFilePointer() /SetEndOfFile() pair.
"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 my name i Alberto , I'm new to this forum...
I'm still developing to a tapi service proveder in visual c++. This tapi service provider is a static library that is executed in svchost.exe and I want to pop up a message box when this tsp is called from a tapi application as outlook. How can I do?
I try to create a my CDialog or to use the afxMessageBox but don't go.
Please help me!!Thanks!!
|
|
|
|
|
what probs u facing with AfxMessageBox()?
God is real unless declared int..
|
|
|
|
|
The message box is built in to windows, it can be poped up at any time. If you do not know the handle of the window, then just pass NULL (0). Outlook is not a TAPI application, but it does call a piece of code that actualy makes a call using TAPI.
I do not know if this will help, but try to call the ::MessageBox() function directly. CDialog and afxMessageBox() are wrappers requiring MFC. Windows was not written in C++, I do not know of any OS that was, so calling the function directly may work.
INTP
Every thing is relative...
|
|
|
|
|
Thanks, I tried this before but didn't work, at the MessageBox instruction the tsp stay there in position of stalemate with no windows error message or whatever..as the afxMessageBox.
|
|
|
|
|
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
|
|
|
|
|