|
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);
}
|
|
|
|
|
Thank you all very much. I found a sample, and I got one running in the dialog framework, which is good enough for the time being.
Again, many thanks!
|
|
|
|
|
Just a small question.
You mentioned that you found OpenGL tutorials that use Win32API. Can you point me to some good ones? You see, I do not like using MFC
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
When i try to compile a program, VirtualDub actually (www.virtualdub.com), it says that INVALID_SET_FILE_POINTER is an unknown identifier. Accoring to MSDN it's defined in winbase.h (include windows.h) but when i search for that phrase (INVALID_SET_FILE_POINTER) in my include folder, no results are found. Anyone know what could be wrong?
Thanks
|
|
|
|
|
I have found it in winbase.h
#define INVALID_SET_FILE_POINTER ((DWORD)-1)
but only in sdk downloaded from Microsoft. This define does not exist (on my computer) in both VC6.0 and VC7.0 include/src folders.
Mukkie
|
|
|
|
|
In a function I have a local connection object declared as m_pConn1:
Ihad trouble working with a member variable so I made it local. The code works now but each time the function is called:
_ConnectionPtr m_pConn1;
HRESULT hr = m_pConn1.CreateInstance (__uuidof (Connection));
if (FAILED (hr))
{
AfxMessageBox ("Can't create intance of Connection");
}
if (FAILED (m_pConn1->Open (_bstr_t ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source = "+PhotoDBName ),
_bstr_t (""), _bstr_t (""), adModeUnknown)))
{
AfxMessageBox ("Can't open datasource");
return 0 ;
}
My hope is that the object gets destroyed when the function goes out of scope. Is thsi true or am I setting myself up for a massive memory leak?
I seem to remember something about this _ConnectionPtr being a smart pointer but maybe thats just wishful thinking. DOes anyone have any experience with this? Your suggestions are welcome. I'd not have done it this way but no other way seemed to work. I tried for two days and finally went this route.
Thanks,
ns
|
|
|
|
|
You will not have a memory leak. Hopefully not. Close the connection before you exit the function.
Why can't yo make that a member variable? What problems are you having?
|
|
|
|