Like any other uninitialized variable, an uninitialized pointer contains garbage (or, in other words, points to garbage). In the shown code, head is initialized with NULL to mark the list as empty, it is responsibility of appendNode (or insertNode) implementation to allocate a fresh ListNode and make head pointing to it.
i saw ur name in top experts Great.! i've a question and i posted it in forum but i didnt get correct answer so i want too ask u that question as u r an expert please give me answer sorry for writing here i'm waiting for ur reply Thanks in advance
HOW TO WRITE SQL QUERY IN XML? please explain about it i seen an article in this forum but it not help me lot of errors in it
Actually I'm not an expert, neither of SQL nor of XML. However you may store data both in databases and in XML files, each method having its pros and cons. Typically you query for data in databases using SQL, while use XPath for finding them in XML files. If you are interested in using XML files as data storage then you may find many many tutorial available on the web, just use Google.
The initialization of your static variables are performed before main() and their deinitialization is performed after main() returns or after the exit() call. If you put buggy code in there then you can easily crash before/after main().
I am trying to design and develop a DXF importer using C++. I have gone through the DXF references starting from version 2000 onwards. There are four things which have put the development on hold for me right now.
1) Handles for each entity. Are they really important? If so, then how are they related to other entities?
2) Entities such as ARC, POLYLINE, TEXT etc occurs in BLOCKS section and in ENTITIES section. What difference does these two sections make? Why not all the entities are placed in ENTITIES section?
3) What is INSERT entity? How does this work? Does it have any visualization (as it contains insertion point, scale and rotation factors)? If so, how is it represented graphically? As a point (as it contains only one point )?
4) I see that some points are in OCS and some are in WCS. How do I convert OCS to WCS? For this point I did some google research and didn't get much help, as most of them use auto-lisp for this and I am using C++.
Kindly learned people guide me, by clarifying these doubts.
I might be stating the obvious but is sounds like you need to find a good specification of what a .dfx file can contain. I've never written a .dfx importer but did look at a similar task once in C++, then quickly opted to use an XML type export (Drawing XML?) from the CAD program and import that into my C++ instead.
I am drawing Owner Draw Menu Icons. For that I want to use Toolbar bmp images as Menu Item icons.
I used LoadImage to Find the Icons from Resources Like this
hIcon = (HICON)::LoadImage(::AfxGetResourceHandle(), resName, IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR | LR_SHARED);
And it is working fine. But forthis I need to Define All new Icons with same name as MenuItem in resources.
That's, why I want to Load it from Toolbar bmp resources inspite of Icon Resources.
How can I load Image in same manner by name from Toolbar bmp ?
Basically, MFC is quit strong to handle all this things enternally, you only need to do is that give same ID to toolbar and menubar item. Like, If you have PQR.bmp on ID_CLICK_ME toolbar then give ID_CLICK_ME to menu bar item so it directly taken POR.bmp as menubar bitmap.
In a dialog I had replaced an CListBox with CListCtrl ... the old CListBox had used SetItemDataPtr, to store a CMyObjects pointers ... but CListCtrl does not have not such a thing (CListCtrl::SetItemDataPtr, only CListCtrl::SetItemData) ... how can I store an object pointers into CListCtrl ? Is it posible ?
Thank you so much for your answers (both of you), I will try that right away and tell you what I've done ... but it came into my mind a question ... if I could store pointers into SetItemData(...), why CListBox does have SetItemData and SetItemDataPtr ... it is not a kind of redundancy ?
I can't see anything seriously wrong in the posted code. So the error may be also somewhere else (probably in a line before number 33 in mydialog.cpp). A possible error source is forgetting the trailing semicolon after the class declaration:
class CMyDialog : public CDialog
}; // <- Don't forget the semicolon here.
I have some more notes:
You should always use parentheses with definitions and macros:
Such mistakes happen (even to me after years of programming). When forgetting the semicolon at the end of a header file, the error is thrown at the first semicolon in the next file which might be another header file or the source file. If you remember this and get such a bulk of messages the next time, you will probably know where to look first.