|
Roger Stoltz wrote: GetRawInputDeviceInfo() does not even provide you with a device name and/or symbolic link.
GetRawInputDeviceInfoW(hDevice, RIDI_DEVICENAME, pData, pcbSize);
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Sorry about that, you're right; you can get the device name with ::GetRawInputDevice() .
I didn't read the docs carefully enough...
I suppose the answer you got from Sarath helped you.
Otherwise post again...
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
The function runs only under windows XP or above. Please check the WINVER definition in your stdafx.h. before including the windows header, define it as 0x501
Check MSDN: using the Windows Headers[^]
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Hello, I have a view that has a property sheet and property pages. when I want start a new document an assertion error happens. I followed the call stack and found out that problem occurs at this function
CWnd* PASCAL CWnd::FromHandlePermanent(HWND hWnd)
{
CHandleMap* pMap = afxMapHWND();
CWnd* pWnd = NULL;
if (pMap != NULL)
{
pWnd = (CWnd*)pMap->LookupPermanent(hWnd);
ASSERT(pWnd == NULL || pWnd->m_hWnd == hWnd);
}
return pWnd;
}
I took the hWnd and searched it in spy++ windows list and I found out that this window is the property sheet. In spy++ I couldn't find any problem in properties of this window even its childs(property pages) seemed OK. but the problem is when windows look in its permanent handle map it returns an erroneous pointer. the pointer is not null neither the hWnd of the returned pointer but hWnd of returned pointer is 0x30203020 which is different from the FromHandlePermanent(HWND hWnd) supplied sane handle. of course the returned pointer is completely erroneous and this supposed to be a window has no sane owner, child, next window or prev window. How can I find the problem?
thanks
|
|
|
|
|
Electronic75 wrote: I followed the call stack and found out that problem occurs at this function
Is this on a different thread than the thread the
window was created on?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello Mark, No it is in the same thread. I followed the stack more closely and with the help of a lot of breaking points and many hours I found out problem occurs in an XML class that tries to read an XML file. I have a MFC application and I used a MSXML wrapper class from this address http://www.codeguru.com/cpp/data/data-misc/xml/article.php/c8287/[^] (I don't know credit of this work goes to whom I later found out some people developed very similar codes earlier).
Now I already had defined a pointer to my CPropertySheet in my CDocument class
m_pDefineSheet = new CDefineSheet;
and when I open a new document a new view is created and the property sheet will be created as its child
CFormView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
pDoc = (CMyoc*) GetDocument();
if(!pDoc)
return 0;
pDoc->m_pDefineSheet->AddPage(pDoc->m_pDev1);
pDoc->m_pDefineSheet->AddPage(pDoc->m_pDev2);
pDoc->m_pDefineSheet->AddPage(pDoc->m_pDev3);
if (!pDoc->m_pDefineSheet->Create(this,
DS_CONTEXTHELP | DS_SETFONT | WS_CHILD | WS_VISIBLE))
{
DestroyWindow();
return FALSE;
}
No problem thus far then CMyDoc::OnNewDocument()will be executed and there it loads an XML document using CXMLManager m_xmlManager
m_xmlManager.Initlize();
m_xmlManager.Load(sData);
m_xmlManager.GetRoot()->get_childNodes(&pList1);
n1 = m_xmlManager.GetNoOfChilds(pList1) ;
for(i1=0;i1<n1;i1++)>
{
pNode1 = m_xmlManager.GetItemNode(i1,pList1);
pList2 = m_xmlManager.GetChildList(pNode1);
n2 = m_xmlManager.GetNoOfChilds(pList2) ;
sName1 = m_xmlManager.GetNodeName(pNode1);
sData = m_xmlManager.GetText(pNode1);
}
Upon execution of this code it seems that something overwrites the m_pDefineSheet location and when I execute
AfxGetMainWnd()->FromHandle((HWND)x)
in immediate window
x is the handle of m_pDefinesheet which was ok prior to execution of this code
it returns error
note that I receive no error of memory access violation that someone illegally has tried to write in memory
This is first time I have encountered such problem!
Thank you anyway.
|
|
|
|
|
Hi Mark, It took almost a day of my time but problem solved problem was in MSXML get_text when it tries to read a big chunk of data it was overwriting on m_pDefineSheet place so FromHandle() returned an erroneous address that already had been overwritten by evil get_text. One thing I still didn't understand is why windows wouldn't give a memory access violation error.
cheers
|
|
|
|
|
Hi,
I am using a CListCtrl control in my mfc application. This control is having 5 columns.
Each column is being filled by some information from the server. I want to show the information in the columns for records in deifferent colors.
I want to know hot to Set Color for Text of CListCtrl Control .
Thanks.
Dhiraj
|
|
|
|
|
|
Thanks It solved my problem.
|
|
|
|
|
I glad hear it.
|
|
|
|
|
Hi,
I got the following while building a project in VS.Net 2003
fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'f:\vs70builds\3077\vc\Compiler\Utc\src\P2\main.c', line 148)
the line that caused the error is as below
vector<Test> childObject = spChildObject;
where spChildObject is defined as
vector<Test1> spChildObject(
Is there any way to correct this code without installing a hotfix?
Thank you
|
|
|
|
|
wait, you're doing this inside main.c ?
but this is C++ !
so you need to name the file main.cpp at least !!!
|
|
|
|
|
there is no main.c in my project. The line that is giving error is in a cpp file
|
|
|
|
|
subramanyeswari wrote: there is no main.c in my project
WTF is that :
"fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'f:\vs70builds\3077\vc\Compiler\Utc\src\P2\main.c', line 148)"
if it's not a file you own, then look anyway at its line 148 to see what could make it crash from your code...
also, a little code sample could help maybe.
|
|
|
|
|
Have you seen this link[^]
Regards,
Rane
|
|
|
|
|
subramanyeswari wrote: Is there any way to correct this code without installing a hotfix?
I think you may have to install the hotfix provided by MS to resolve this issue.BTW,Why are you hesitating to install the hotfix?
Regards,
Rane
|
|
|
|
|
fatal error C1083: Cannot open source file: abc.cpp: No such file or directory
fatal error C1083: Cannot open source file: abc.cpp: No such file or directory
But this file is included before and then deleted from the projected and
#include "abc.cpp" is also deleted
I did clean Rebuild, but stil the same problme exist. Pls advice
|
|
|
|
|
Did you do a find for "abc.cpp" in the whole project?. May be you would be referencing the "abc.cpp" through some other header files...
Regards,
Rane
|
|
|
|
|
Yes yes I did, the included is cleaned from the whole project, even the word is not avaliable in the who project..
|
|
|
|
|
ptr_Electron wrote: But this file is included before and then deleted from the projected and
#include "abc.cpp" is also deleted
what ???
|
|
|
|
|
Are you sure you have this file? and "#include "abc.cpp" is also deleted"
|
|
|
|
|
Yes, how can I slove this, pls advice
|
|
|
|
|
Maybe the abc.cpp is still in the solution explorer?
In the solution explorer, open your project, open "Source", mark abc.cpp and hit the "del"-key.
Do the same under "Headers".
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Yes, yes I did that also, no abc.h and abc.cpp is not displayed in the work space
|
|
|
|