|
If you have a Windows NT service, and its configuration is to run 'Automatic' it will start when Windows starts and will be running already for each user.
If you don't want a particular user to be able to stop a service, make sure he is not an administrator on the local machine, or else deny them the start/stop service security privilege.
|
|
|
|
|
Sorry but i dont understand the configuration in Automatic, can u explain me?
Thanks
|
|
|
|
|
Hi
I am used to check the internet connection through vc++(mfc)
and i have checked it through InternetGetConnectedState which shows only the network connection (LAN).I want to check the actual internet connection trough the mfc. If lan is not there and internet connection is there it shold check and show right result.
Waiting for the +ve reply as soon as possible
Best Regards
ganesh
|
|
|
|
|
Anonymous wrote:
InternetGetConnectedState which shows only the network connection (LAN).
Actually the first argument to InternetGetConnectedState() is a mask that can be used to check any of the following situations:- Local system has a valid connection to the Internet, but it might or might not be currently connected.
- Local system uses a local area network to connect to the Internet.
- Local system uses a modem to connect to the Internet.
- Local system is in offline mode.
- Local system uses a proxy server to connect to the Internet.
- Local system has RAS installed.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
See here.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
How to get the click time of one picture in the IE control?(tool: VC)
To collect the click time of one picture in the IE contral, but this picture hasn't new URL to connecte.
How to get it?
thanks!
no
|
|
|
|
|
Hi,
i'm reading an AVI using Video for Windows VfW. Using AVIFILEINFO structure, i'm able to obtain the height, width etc. But how do i obtain the frame bitdepth(8-bit, 14,32 bit?)?
|
|
|
|
|
I am having trouble with this code. This is giving output as mesgbox with 0, ie successful, but is not filling the image. Please look in to it. I want to replace all connected pixels of a particular color with another color. Normal function outruns stack memory.
Any suggestions will be appreciated.
void dlg::OnButton1()
{
CClientDC* hdc= new CClientDC(this);
CFileDialog fd(1,0,0,0,"Bit Map(*.bmp)|*.bmp||");
fd.m_ofn.lpstrTitle="Browse";
if(fd.DoModal()==IDOK)
{
str=fd.GetPathName();
HBITMAP hBmp = (HBITMAP)::LoadImage(NULL,str,
IMAGE_BITMAP,0,0, LR_LOADFROMFILE|LR_CREATEDIBSECTION);
bmp.Attach(hBmp); //bmp is member of the class dlg
CClientDC dc(this);
bmDC.CreateCompatibleDC(&dc);
pOldbmp = bmDC.SelectObject(&bmp);
BITMAP bi;
bmp.GetBitmap(&bi);
dc.BitBlt(0,0,bi.bmWidth,bi.bmHeight,&bmDC,0,0,SRCCOPY);
bmDC.SelectObject(pOldbmp);
}
}
void dlg::OnLButtonDown(UINT nFlags, CPoint point)
{
COLORREF rgb;
CClientDC dc(this);
CQuickFill qf;
int i;
rgb=RGB(255,10,10);
i=qf.QuickFill(&bmp,point.x,point.y,rgb,CLR_INVALID);
if(i==0)
MessageBox("0","0");
if(i==-1)
MessageBox("1","1");
if(i==-2)
MessageBox("2","2");
if(i==-3)
MessageBox("3","3");
CDialog::OnLButtonDown(nFlags, point);
}
Awasthy
Any work worth doing is worth doing well.
|
|
|
|
|
Hi
I have developed a windows based service in C++ which runs on Windows 2000 Professional OS.
It is a multithreading service in which first it creates one master thread then it creates number of child thread in suspended mode. Now this child thread when resumed...gets the details needed....
For this I use Semaphore to synchronize the threads and WaiForSingleObject() functions to make it work properly.
It is like ....
---------------
if ( WaitForSingleObject(threadHandle,INFINITE) == WAIT_OBJECT_0 )
{
Do some work here.....
}
---------------
But some time it stucks waiting more time to finish so that new thread can start and continue working. So is there any other idea how can I make it run fast ?
Thankx in advance.
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
Depending upon what task your 'worker' threads are performing, you can always consider LOWERING their thread priority so that your 'controller' thread has a higher priority and the controller thread will get serviced more frequently when there is a task for it to perform, such as starting more worker threads.
You also might consider creating less worker threads and using a round-robin subdivision of the tasks to be performed, assuming your implementation can afford such a redesign. If each of these threads does not necessarily have to block on something, like a file handle or other event, then perhaps all the servicing can be done from a single thread that processes data for each item in turn, each time the thread executes. If you are making too many threads, your process will spend a significant per-unit amount of time switching threads constantly instead of getting 'real' work done.
|
|
|
|
|
I want to make a tooltip which could show each item(picture)'s thumbnail on the tooltip, but just use LVN_GETINFOTIP message is not enough, as the LPNMLVGETINFOTIP only let me pass in limit string, So is there any way to draw on the List Ctrl's tooltip?
Thanks a lot! any comment is welcom
|
|
|
|
|
Hi,
Instead of creating a new MFC Active-X project, i reused an existing project. But, when both the controls are being used simultaneously, i have the issue of same class-id for both the controls. How do i change the class-id of the control?
The active-x is being rendered on a web-page. Two different controls are needed and because of the same class-id i'm not able to use them.
Please help.
Thanks and Regards
Vikram Attiganal
|
|
|
|
|
Go through all your source files and change the GUID. I haven't done AX controls in MFC in ages, so I don't know off-hand which files to look at, but at the miniumum it will be the IDL or ODL file, and the code used for registration/unregistration of the server.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
hi..
how do we save user entered text in a file.. i am using common dialog box and allowing the user to specify the file name and the location.. I used CArchive.. The first character in the saved file is always a garbage value.. Why?
regards
mpallavi
|
|
|
|
|
If you use CArchive, maybe that's normal... In fact, I never used CArchive for saving data but maybe it adds its own data before your data.
Try to use CFile instead:
char* szText = "Your string To Save";<br />
CFile* pFile = fopen("YourFile.txt","w");<br />
fwrite(szText,strlen(szText),1,pFile);<br />
fclose(pFile);
|
|
|
|
|
Hi cedric
i am giving here my code:
..........................
CFile flCPhone;
CStdioFile fl;
char strFilter[] = { "Text Files (*.txt)|*.txt|" };
CFileDialog FileDlg(FALSE, ".txt", NULL, 0, strFilter);
if( FileDlg.DoModal() == IDOK )
{
if( flCPhone.Open(FileDlg.GetFileName(), CFile::modeCreate | CFile::modeWrite) == FALSE )
{ return;}
CArchive ar(&flCPhone, CArchive::store);
ar<
|
|
|
|
|
Ouch... Sorry, I have mixed CFile with FILE*
But I think your question has already been answered
|
|
|
|
|
Hi cedric
its ok..
I wasn't using the member functions of CFile..
There is no function for appending text to a file..in CFile (..I suppose)..
How do i go about it?
|
|
|
|
|
Then you can use FILE* and open it in appending mode ("-a"). Take a look at fopen in the doc:
FILE* pFile = fopen("YourFile.txt","a");<br />
fwrite(.....);
|
|
|
|
|
mpallavi wrote:
There is no function for appending text to a file..in CFile (..I suppose)..
Sure there is. Just go to the end of the file before writing to it. Remember to use CFile::modeNoTruncate when opening the file.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hi david..
thanx
I could append text to a already existing file.. I want the newly entered text to appear on a new line.. I used CFile::seektoend().. how to take the pointer to new line? ..
regards
pal
|
|
|
|
|
Insert a CR and/or LF character first.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
try this :
FILE *file;
char *FileName = "C:\\TestFile.txt";
char *string_to_save = "this is a test";
file = fopen(FileName,"w");
if(!file)
{
AfxMessageBox("Unable to open the specified file");
return;
}
fputs(string_to_save,file);
fputs("\n",file);
fclose(file)
return;
regards,
Eli
|
|
|
|
|
hey friends ..
i did it.. it was simple
.................
CFile flCPhone;
flCPhone.Open(FileDlg.GetFileName(), CFile::modeCreate | CFile::modeWrite);
int len;
len=strlen(m_strInput);
flCPhone.Write(m_strInput,len);
.....................
thanx for showing me the write track.. i was simply running behind CArchive..
(A beginner in vc++.. getting into it..)
thanx
pal
|
|
|
|
|
if you allow the user to choose the file name and position with File dialog,
in your flCPhone.open() use FileDlg.GetPathName() instead FileDlg.GetFileName().
regards,
Eli
|
|
|
|