|
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
|
|
|
|
|
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()
|
|
|
|
|