|
grahamoj wrote:
Hiya, ok I know about Threads and Processes to a point. A process is the app you run and a thread links 2 apps together.
???????
ok i agree with what you says with the process...
but not in the matter of thread, threads are the childs of procesess..i never think it can synchronise or communicate with the independent procesess...
i think ur neeed is the simple synchronisation of two program datas/something else...u just need to perform some sockets/shared memory/pipes/mailslot for acheving that
be specific with you requirements
thanks
CodeTheDreams();
|
|
|
|
|
I have a formview based project, it washes the system, while its clearing, a progress dialog bar appears, but it goes too fast.
Is there any way to slow down the progress dialog bar?
|
|
|
|
|
Anonymous wrote:
Is there any way to slow down the progress dialog bar?
?
Slow down the progress. Add a sleep in your loop...
Just Kidding..
John
|
|
|
|
|
Actually, I'm not sure why you would want to do this. If the operation is too fast for a progress bar to display than you don't need a progress bar. Maybe just use an hour glass.
John
|
|
|
|
|
if your operayion is so fast, just avoid the use of progress bar. it usually helpful when we want to show the progress of lenghty / time consuming operations infront of the crazy users..hihih (pardon me ..)
Just Use the controls in appropriate situations...
thanks
CodeTheDreams();
|
|
|
|
|
I write a program,which I can choose a program(exe file) that and I can run it as a SERVICE.I do it like this:
SC_HANDLE schSCManager = OpenSCManager( NULL, NULL, SC_MANAGER_CREATE_SERVICE);
if (schSCManager==0)
{
Errorrrrrrr
}
else
{
SC_HANDLE schService = CreateService
(
schSCManager,
servicename,
"My Service",
SERVICE_ALL_ACCESS,
SERVICE_WIN32_OWN_PROCESS|SERVICE_INTERACTIVE_PROCESS ,
SERVICE_AUTO_START,
SERVICE_ERROR_NORMAL,
pPath,
NULL,
NULL,
NULL,
NULL,
NULL
);
if (schService==0)
{
AfxMessageBox("Fail to create");
}
else
{
AfxMessageBox("Service Created");
CloseServiceHandle(schService);
}
CloseServiceHandle(schSCManager);
Now the problem is I choosed one windows application,then whenever it start as service,it stay at STARTING mode,never
go to STARTED mode.Any idea about it?
Thanks.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Once the service object has been added to the SCM database, don't you need a subsequent call to StartService()?
|
|
|
|
|
No,thats not the point.By default it does not start and I have to call StartService(),my problem happendafter calling this function and always stay at STARTING node after calling this function.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
I don't see that as a possible state. Perhaps it's one of:
SERVICE_CONTINUE_PENDING
SERVICE_PAUSE_PENDING
SERVICE_PAUSED
SERVICE_RUNNING
SERVICE_START_PENDING
SERVICE_STOP_PENDING
SERVICE_STOPPED
What does StartService() return?
|
|
|
|
|
DavidCrow wrote:
What does StartService() return?
0
DavidCrow wrote:
SERVICE_START_PENDING
I think it stay at this status.It show the service in Services list,and show it whit STARTING state.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
check ur service doesnt depend on another service that hasnt started yet
this happened to me and i had to rummage around and figure out how to make it dependent on other services cos the load order isnt determined
im gonna make an article on this subject when i get a bit of time soon i hope
"penguins have no bill" biz stuff about me
|
|
|
|
|
Thanks for your reply. But I don't think thats the problem,because its windows application and I can run it without problem.It happend when I run it as service.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Since StartService() is returning 0, what does GetLastError() return?
|
|
|
|
|
Thanks for your help David.My problem is solved.I was going the wrong way.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Please enlighten us so that others may benefit.
|
|
|
|
|
|
Clickety!
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
When I resize column by click and drag column header, so that... client area of ListView control look like need to redraw immediately (paint disorderly), but I dont know how to instruct it to do this
help me
I create ListView control and add item to ListView by following code:
<br />
HWND CreateListView (HWND hWndParent)<br />
{<br />
hWndList = CreateWindowEx( 0L,<br />
WC_LISTVIEW,
STR_NULL,
WS_CHILD | WS_BORDER | WS_EX_CLIENTEDGE<br />
| LVS_REPORT | LVS_SINGLESEL|LVS_SHOWSELALWAYS|LVS_AUTOARRANGE ,<br />
0+10,110, 572,180,<br />
hWndParent,<br />
(HMENU) IDC_TIME_LVW_CONTENT,<br />
hInst,<br />
NULL );<br />
<br />
lvC.iSubItem=0;<br />
strcpy(szText,LVW_TIME_ALERT);<br />
ListView_InsertColumn(hWndList,0,&lvC);<br />
lvC.iSubItem=1;<br />
strcpy(szText,LVW_TIME_RUN);<br />
ListView_InsertColumn(hWndList,1,&lvC);<br />
lvC.iSubItem=2;<br />
strcpy(szText,LVW_TIME_PATH);<br />
ListView_InsertColumn(hWndList,2,&lvC);<br />
lvC.iSubItem=3;<br />
strcpy(szText,LVW_TIME_MESSAGE);<br />
ListView_InsertColumn(hWndList,3,&lvC);<br />
<br />
return hWndList;<br />
}<br />
<br />
<br />
<br />
InsertItemToListView(LPSTR lpszTime, LPSTR lpszRun, LPSTR lpszPath, LPSTR lpszMessage)<br />
{<br />
<br />
INT nCount=SendMessage(hWndLvwContent_Time,LVM_GETITEMCOUNT,0,0);<br />
LVITEM lvI;<br />
<br />
lvI.mask = LVIF_TEXT;<br />
lvI.iItem = nCount;<br />
lvI.iSubItem = 0;<br />
lvI.pszText = lpszTime;<br />
lvI.cchTextMax = sizeof(lpszTime);<br />
ListView_SetItemState(hWndLvwContent_Time,<br />
ListView_InsertItem(hWndLvwContent_Time,&lvI),<br />
LVIS_SELECTED,LVIS_SELECTED);<br />
<br />
ListView_SetItemText(hWndLvwContent_Time,nCount,1,lpszRun);<br />
ListView_SetItemText(hWndLvwContent_Time,nCount,2,lpszPath);<br />
ListView_SetItemText(hWndLvwContent_Time,nCount,3,lpszMessage);<br />
return TRUE;<br />
}
|
|
|
|
|
_skidrow_vn_ wrote:
lvI.cchTextMax = sizeof(lpszTime);
This is not going to return the expected result. lpszTime is a pointer, thus 4 will be returned rather than the actual size of the buffer it points to.
_skidrow_vn_ wrote:
ListView_SetItemState(hWndLvwContent_Time,
ListView_InsertItem(hWndLvwContent_Time,&lvI),
LVIS_SELECTED,LVIS_SELECTED);
Why are you not checking the return value of ListView_InsertItem()? This can have undesirable results when subsequently calling ListView_SetItemText(). Do this instead:
item = ListView_InsertItem(hWndLvwContent_Time,&lvI)<br />
if (-1 != item)<br />
{<br />
ListView_SetItemState(hWndLvwContent_Time, item, LVIS_SELECTED,LVIS_SELECTED);<br />
<br />
ListView_SetItemText(hWndLvwContent_Time,item,1,lpszRun);<br />
ListView_SetItemText(hWndLvwContent_Time,item,2,lpszPath);<br />
ListView_SetItemText(hWndLvwContent_Time,item,3,lpszMessage);<br />
}
According to the documentation, the LVS_AUTOARRANGE style only applies to the LVS_ICON and LVS_SMALLICON styles. It might just be ignored if not needed but why litter your code with unnecessary stuff?
|
|
|
|
|
return value of ListView_InsertItem() is
"the index of the new item if successful, or -1 otherwise."
thank you for your ideal
i checked it
sizeof(lpszTime) return 4
strlen(lpszTime) return 11 // "11:11:11 AM"
>>so I want how to repaint the client area of ListView (auto when user resize column)?
thanks!!
|
|
|
|
|
If the return value of a function were not important, it would not bother to return a value and be void instead.
|
|
|
|
|
can you tell me the way to auto repaint listview when user resize column?
|
|
|
|
|
I'm not sure I understand exactly what symptom you are describing. When you "grab" the vertical line between the column headings and drag it left or right, the data in the columns should adjust automatically. Are you saying that if a column was too small, and you then widened it, the data in the column would still not be totally visible? If so, I've never seen a list control behave in this fashion.
|
|
|
|
|
before resize
after resize
after resize
how can i detect when I finish resizing column of listview?
I mean: when I finish resize colummns of listview... i will send a message to instruct listview repaint immediately
thanks
|
|
|
|
|
|