|
Have a look at GetExitCodeProcess .
|
|
|
|
|
But it doesn't seem to work!! Does the following piece of code look alright ? Thanks
while (WaitForMultipleObjects(5, proHandle, TRUE, 1000) == WAIT_TIMEOUT);
{
for(i = 0; i <5; i++)
{
if(!GetExitCodeProcess(proHandle[i], &status[i]))
cerr << "GetExitCodeProccess Fail" << endl;
if(status[i] != STILL_ACTIVE )
runningProcess--;
}
printf(" %d ", runningProcess);
}
|
|
|
|
|
tcuong wrote:
Does the following piece of code look alright ?
No. You have a spurious semicolon after the while condition.
|
|
|
|
|
After running the SQL query, we got rewsults the ADO recordset object. How can we retrieve the total number of records present in recordset object.
|
|
|
|
|
By searching the forums maybe? This was answered just a couple of days ago...
Anyway, the record count (rs.Count) usually isn't valid until EOF has been seen,
count reports the current number of seen records.
|
|
|
|
|
If you are using static or keyset cursor then the recordset count
you get from the property 'RecordCount" is valid
else you need to go from record to record manually
and then use the property.
|
|
|
|
|
Does anyone know how to detect if a service is running ?
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
|
Hi,
I have developed a dialog based application in VC there I want to provide standard Font Control & color control...Is it possible?
Please help me.
Thanks in advance
Prateeti
|
|
|
|
|
Check your MSDN collection:
CFontDialog
CColorDialog
Have fun.
|
|
|
|
|
;m_hWnd is other application listview's handle
;I want to simulate mouse double click on the item
;But it don't work,why?
;I doubt that the parent's handle is not correct,
;But I try all its parent,it don't work too,someone can tell me why?
memset((void*)&view,0,sizeof(NMLISTVIEW));
HWND hParent=::GetParent(m_hWnd);
view.iItem=0;
view.iSubItem=0;
view.hdr.code=NM_DBLCLK;
view.hdr.hwndFrom=m_hWnd;
view.hdr.idFrom=::GetDlgCtrlID(m_hWnd);
int code;
code=::SendMessage(hParent,WM_NOTIFY,view.hdr.idFrom,(LPARAM )&view);
Hi
|
|
|
|
|
The NMLISTVIEW struct is in your process space, the other app can't see it. Use one of the APIs designed for this purpose, mouse_event or SendInput.
--Mike--
Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I have a list box which I would like to include a CEdit control to alow easy editing of fields.
So far I have embeded(composition) a CEdit control in the CListBox class and have created it in PreSubclassWindow and made it invisible. When you double click on the item the CEdit becomes visible...and when you click else where its hidden... Easy...
However I need to capture WM_SETFOCUS && WM_KILLFOCUS && WM_KEYDOWN (Return key) of the CEdit control inorder to know when to copy the contents from the CEdit control to the list item currently indexed.
I have tried:
OnCommand
WndProc
OnParentNotify
I'm doing something wrong or this is not how this is accomplished...I thought I could subclass the CEdit control with a custom WndProc, but this would require a static or global function and I won't be able to call the GetText/SetText functions of my listbox...(It's actually a custom control i've designed from scratch, not a windows LISTBOX).
Anyways...how would I go abouts acommplishing what I want...???
Thanx
Cheers
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Use CListCtrl not CListBox, CListCtrl supports in place-editing: LVM_EDITLABEL style
VOTD: " Yet it was the Lord 's will to crush him and cause him to suffer, and though the Lord makes his life a guilt offering, he will see his offspring and prolong his days, and the will of the Lord will prosper in his hand. 11 After the suffering of his soul, he will see the light of life and be satisfied ; by his knowledge my righteous servant will justify many, and he will bear their iniquities." - Isa 53:10-11 (NIV)
|
|
|
|
|
Hello I have a problem, I created two dialogs and i want the second to appear whenever in the first a button is clicked, I know is very basic but I have searched for it and I cannot find any good example on it. I pressume is with new and ShowWindow() maybe?
Could anyone please explain?
Thank you for your time
|
|
|
|
|
Try
Declaring an instance of the window
CDialogToOpen dlgDialogToOpen;
And then show the window
dlgDialogToOpen.DoModal();
In the buttons OnBnClicked Event
|
|
|
|
|
can someone tell me what functions I should write to implement drag and drop between 2 listboxes.
thanks
|
|
|
|
|
|
When ruuning my exe, i am getting a 'syntax error in my SQL statemnt'.
Here is the code form where the error is coming??
void CMgen1View::LoadListbox()
{
CMgen1Doc* pDoc = GetDocument();
CListBox* pLB = (CListBox*) GetDlgItem(IDC_LIST1);
CMgen1Set sect(&pDoc->m_database);
sect.m_strFilter = "InstructorID = '366'";
sect.Open(NULL,
_T( "Select * from Section WHERE sect.m_strFilter" ));
pLB->ResetContent();
while(!sect.IsEOF()) {
CString str;
str.Format(_T("%d %d"),sect.m_CourseID , sect.m_SectionNo);
pLB->AddString(str);
}
}
|
|
|
|
|
The problem is in your sql statement
"Select * from Section WHERE sect.m_strFilter"
The SQL server doesn't know what sect.m_strFilter means.
Try Select * from Section WHERE InstructorID = '366'
|
|
|
|
|
Replace
sect.Open(NULL,
_T( "Select * from Section WHERE sect.m_strFilter" ));
With
sect.Open(NULL,
_T(CString("Select * from Section WHERE ") + sect.m_strFilter ));
|
|
|
|
|
I am studying OpenGL and all the sample code I found so far are writen using Win32 API. I tried to integrate openGL code to a MFC SDI application, but I am having trouble with OnSize. My code doesn't behave the same as the samples of Win32 API. Anybody can give me any hint? Or some sample code to refer to?
Thank you very much in advance!
|
|
|
|
|
Please do your own googling:
http://www.google.com/search?q=mfc+opengl+sample
|
|
|
|
|
Hi Lucy,
Look at NeHe Productions, you should find some cool stuff. Don't forget to bookmark it.
VOTD: " Yet it was the Lord 's will to crush him and cause him to suffer, and though the Lord makes his life a guilt offering, he will see his offspring and prolong his days, and the will of the Lord will prosper in his hand. 11 After the suffering of his soul, he will see the light of life and be satisfied ; by his knowledge my righteous servant will justify many, and he will bear their iniquities." - Isa 53:10-11 (NIV)
|
|
|
|
|
void CChildFrame::OnSize(UINT nType, int cx, int cy)
{
CMDIChildWnd::OnSize(nType, cx, cy);
wglMakeCurrent(GL->m_pDC->GetSafeHdc(), GL->hrc) ;
WWidth = (GLint)cx;
WHeight = (GLint)cy;
::glViewport(0, 0, WWidth, WHeight);
::glMatrixMode(GL_PROJECTION);
::glLoadIdentity();
::glMatrixMode(GL_MODELVIEW);
}
|
|
|
|