|
|
The windows procecure like LRESULT CALLBACK MainWndProc(), windows get the return value.
I wonder what are the meanings of the return value, for example,
return 0, return 2, etc.
I saw many example codes using return 0.
modified 6-May-13 11:57am.
|
|
|
|
|
|
hello every body :
i just want to under
stand what the pointer in linked list point to ,it is a object pointer but it seems to me that it doesn't point to any thing
class LList
{
private:
struct ListNode int var2;
ListNode *next;};
ListNode *head; public:
LList( void ) { head = NULL; } ~LList( void ); void appendNode( float , int );
void insertNode( float , int );
void deleteNode( float , int );void displayList( void );
};
|
|
|
|
|
Within your
struct ListNode I would expect a
ListNode* pNext
and another
ListNode* pPrev which must be set by one of the methods called on an instance of your
LList to point to the next and previous structures in the list.
They don't point to anything to start with, it's only when you add one to a list that they are used - they are the links in the linked list.
|
|
|
|
|
This is a class definition, so it merely describes the parts of the class. You need to write the implementation of each function which will manage the pointers.
Use the best guess
|
|
|
|
|
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.
Veni, vidi, vici.
|
|
|
|
|
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
Thanks in advance
|
|
|
|
|
i'm waiting for ur response ---CPallini
|
|
|
|
|
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.
Veni, vidi, vici.
|
|
|
|
|
Hi,
I have one question...
Is there any way a C/C++ program can crash before main()?
Regards,
Mbatra
modified 3-May-13 6:46am.
|
|
|
|
|
The question is unclear: are you asking about compilation order?
int x = ;
int main()
{
return 0;
}
this will not compile, error is before main
there are no facts, only interpretations
|
|
|
|
|
Hi,
My question was:
Is there any way a C/C++ program can crash before main()?
Like when u run your program, it crashes even before it starts to execute main..
Regards,
Mbatra
|
|
|
|
|
Yes, it is possible, but without more details it is impossible to guess why.
Use the best guess
|
|
|
|
|
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().
|
|
|
|
|
Yes ! A c/c++ program will crash when it can't find a necessary library.
|
|
|
|
|
Here is a cooked-up example:
#include <iostream>
using namespace std;
class Crash
{
public:
Crash()
{
int *a = new int[5];
for (int i = 0; i < 7; ++i)
{
a[i] = 25;
}
delete[] a;
}
};
Crash crash;
void main()
{
cout << "If ever I come here ..." << endl;
}
This program will crash even before entering main().
modified 3-May-13 11:15am.
|
|
|
|
|
Yes, it can if the program didn't find dependency libraries in the search paths.
|
|
|
|
|
Hello,
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.
Thanks in advance
|
|
|
|
|
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.
|
|
|
|
|
Hello Friends
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 for this 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 ?
Any Help will be Appreciated.
Regards
Yogesh
|
|
|
|
|
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.
|
|
|
|
|
Thanks For your Reply.
Actually , I am giving toolbar single bmp name to MenuItem.
For Example. ToolBar name is IDR_TOOLBAR1 which consist of images whose names are ID_FILE_NEW,ID_FILE_OPEN.
And Under Menu IDR_MENU1 have menuItems New,Open with ID ID_FILE_NEW and ID_FILE_OPEN same as in toolbar bmp.
And Used same LoadImage function to load Icon but returning NULL.
Or am I doing something Wrong?
Regards
y
|
|
|
|
|
why are you not trying this??
CImage image;
image.Load(_T("C:\\image.png")); CBitmap bitmap;
bitmap.Attach(image.Detach());
|
|
|
|
|
If I try this way then I have to load each and every image for Menuitems again single by single.
I am looking for a way to use from Toolbar bmp into MenuItems Icons.
So,only I am accessing over resources by name to match with same menuitem Icon.
Anyway,thanks For ideas. But ,better if I use from toolbar bmp.
Y
|
|
|
|