|
I know it. But since our application is written with usage CRectTracker reasonably simply to add this class with the necessary methods. Somebody already did it?
|
|
|
|
|
Excuse me I haven't understood your problem before. Unfortunately I don't know if someone have done this method before.
|
|
|
|
|
|
SandipG wrote: Does QTransformTracker[^] help?
No Since our application is written with usage CRectTracker reasonably simply to add this
class with the necessary methods.
|
|
|
|
|
nItem = m_ctrlList1.GetSelectedCount();
if (nItem > 0)
{
for (int i=0;i < nItem;i++)
{
m_ctrlList1.GetItemText(i,0,szText,sizeof(szText));
nItem = m_ctrlList1.GetNextItem(nItem, LVNI_SELECTED);
m_ctrlList1.Update(nItem);
::MessageBox(NULL,szText,"Test",MB_OK);
}
}
Im using ListCtrl with one column. If i have selected items 3,4,5, GetNextItem is showing item number 1 and 2.
Can anyone please tell where is the mistake?
|
|
|
|
|
Your code have several flaws (for instance you're badly changing the value of the variable nItem , that controls the loop). Try
int nSel = -1;
do
{
nSel = m_ctrlList1.GetNextItem(nSel, LVNI_SELECTED);
if ( nSel != -1 )
{
m_ctrlList1.GetItemText(nSel, 0, szText, sizeof(szText));
::MessageBox(NULL, szText, "Test", MB_OK);
}
} while (nSel != -1);
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
You are welcome.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I'm working on an application that processes several kinds of file formats. The parsing and processing of the format take place in external plug-in libraries, implemented as DLLs. The parsers and processors are COM objects, implementing a few simple custom interfaces.
The problem is this: When importing files into the application we use a wizard with three pages (Select File->Define Settings->Finish). The first page of the wizard finds the correct external library to use for the file provided by the user, and then the library should create the second page with settings that apply to this file format only. This is where I get stuck.
One option would be to let the libraries add the page with something like this:
HRESULT GetPropertyPage(PROPSHEETPAGE** ppPage); However, the server application is implemented in MFC, and CPropertySheet doesn't play very well with the PROPSHEETPAGE struct. As far as I can see, there's no way to construct a CPropertyPage around a PROPSHEETPAGE . This solution would require that the first and last pages are implemented without MFC (not a major problem, but inconvenient).
Another option would be to venture into the world of IPropertyPage and other pre-defined interfaces. I have absolutely no idea on what to choose here, any input would be appreciated.
Thanks
|
|
|
|
|
Hi,
I have some code in Visual C++, which I had earlier compiled using Visual Studio 6.0, and it compiled and linked fine. But the same code which I converted to VS 2005, is giving me this error 2440, as follows:
error C2440: 'specialization' : cannot convert from 'BOOL (__stdcall *)(LPCSTR,UINT_PTR)' to 'BOOL (__cdecl *const )(const char *,UINT)'
I think this is the error regarding the calling convention. Could somebody resolve this problem for me?
Thanks in advance.
Sanjay Khapre
Software Developer
|
|
|
|
|
SanjaySMK wrote: Could somebody resolve this problem for me?
It would help a lot if you provide some code (how you declared your function, the expected prototype, ...)
|
|
|
|
|
can we use this grid in vs 2003
|
|
|
|
|
|
I'm using the VS 2008 MFC feature pack. ... Here ON_NOTIFY_REFLECT is not working can any one suggest the alternate for this messageHandler.
I tried with AFX_WM_RESETTOOLBAR but it is not working...
|
|
|
|
|
How about ON_CONTROL_REFLECT?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
I have only the process name with me. I don't know how to get the process handle or the process id from the process name. Any api to fetch this.
Thanks..
|
|
|
|
|
|
How did you get its name? you can use of CloseHandle but you need to a handle.
|
|
|
|
|
I can see it in the task manager. I need its handle for PID programmatically
|
|
|
|
|
I think its better use of EnumWindow it gives you hwnd for each window and then you can use of SendMessage(hWnd,WM_CLOSE,0,0); for close that program.
|
|
|
|
|
Try GetModuleHandle(process_name);
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Closing a process HANDLE using CloseHandle doesn't kill the process.
Steve
|
|
|
|
|
Does this[^] article help?
Regards,
Sandip.
|
|
|
|
|
At first you may be attempted to do something like the following:
DWORD CProcessList::Toolhelp32FindProcess(TCHAR szModuleName)
{
HANDLE hSnapShot=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
PROCESSENTRY32 processInfo;
processInfo.dwSize=sizeof(PROCESSENTRY32);
while(Process32Next(hSnapShot,&processInfo)!=FALSE)
{
if(0 == _tcscmp(szModuleName,processInfo.szExeFile)
{
return processInfo.th32ProcessID;
}
}
CloseHandle(hSnapShot);
return -1;
}
But unfortunately there can be multiple instances of the same PE images executing concurrently. To be certain that you are targeting the correct one you will also require a window handle.
You can have a look at a previous post to see How to Find a PID from a window handle[^].
Hope it helps,
-David Delaune
At first
|
|
|
|
|
Hi all,
I have a problem with multithreading I want to make a dialog in a new thread. And I want to paint in this dialog a scale view of what is painted in the parent window (of an MDI application) . I have studied the MSDN reference but still now is not clear to me how to do this. So my questions are:
1- Where can I find some sample that fit my necessity?
2- I have to start a UI Thread or a work thread?
3- If this is simple can anyone give me some little indication on where to start?
Thank you in advance for your help
|
|
|
|