|
symeramon wrote: But the main problem is how can I get the id from vector...
What does a vector have to do with any of this?
symeramon wrote: ...use it in the button click event?
BEGIN_MESSAGE_MAP(CMyDialog, CDialog)
ON_BN_CLICKED(IDC_SOME_BUTTON, OnButtonClicked)
END_MESSAGE_MAP()
...
void CMyDialog::OnButtonClicked()
{
m_listbox.AddString(_T("Hello World!"));
}
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Thanks for your reply David... Finally I got it, by SetItemData!
|
|
|
|
|
1, Window Design
2, Skining the Dialog
3, Other plug in usage
if any one have answers with simple snippets please refer me.
|
|
|
|
|
Are you trying to ask how its used? MFC is basically an objected oriented layer around the WinAPI, but it's not just that, it provides a framework for development. As a framework, it provides base abstraction layers for creating objects, windows, threads, lists, arrays, strings, controls, and many more objects common in desktop development.
|
|
|
|
|
Albert Holguin wrote: basically an objected oriented layer
Emphasis mine: Personally I always considered MFC (any version) to be version 1.0.x of Microsofts attempt to make an object oriented layer. Even the most recent versions still contain way too much remnants of C-style programming to be rightfully called 'object oriented'. To just name one example (or two): the WPARAM and LPARAM parameters widely used in functions all over the API are IMNSHO an abomination all by themselves. Or the 'type', HANDLE : Try to figure out what that type really is, and you'll find there are quite a few different variants, many of them incompatible with each other (as I've learned the hard way)
My hopes are on Windows 8: maybe Metro will provide the long-awaited 'Windows API 2.0' ...
|
|
|
|
|
|
Do you really need to use bold text for a simple list of links?
|
|
|
|
|
LOL.. i like to be dramatic. Just to put a little empasis on topics
|
|
|
|
|
I am new into writing C++ providers.
Can anyoone let me know the basics of provider writing.
I mean I wanted to know about Provider types(Instance, Method, Indication) and why are they needed etc
What are properties, mof, cim, schema etc.
|
|
|
|
|
Providers are used to provide dynamic data which are not stored in internal datastore for the CIMOM .
More details[^] can be found in the link.
Also if you could google with "C++ provider" keyword you can get more results and channels to start.
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
Thanks Anshuman I will have a look at the link.
|
|
|
|
|
|
Thanks Topcoder for the links
|
|
|
|
|
Hello Friends
I want to copy an array of Point3 object to Dynamic Array object of Point3.
I am having Point3 verts[1000],which stores point3 for some size ,say 600.
i want to copy to another Point3 object with size of 600.
Like, Point3* tempVerts = new Point3[600]
Thanks In Advance.
Regards
Yogesh
|
|
|
|
|
tempVerts[i] = verts[i]; // i would be a variable incremented each time by 1 in a loop
BTW can you use a vector<point3> rather than allocating an array dynamically if it fits your design?
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
How'bout:
Point3* tempVerts = new Point3[600];
memcpy(tempVerts, verts, sizeof(Point3)*600); ?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
Correct (+5)... but if it's dynamic then it would be more like (to clarify for OP)...
Point3* tempVerts = new Point3[array_size];
memcpy(tempVerts, verts, sizeof(Point3)*array_size);
|
|
|
|
|
Also correct (+5).
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
thanks
|
|
|
|
|
There's a caveat to this: the data must be blittable.
Steve
|
|
|
|
|
You are right, i simply assumed that Point3 is made up of simple types like 3 coordinates stored as floats or integers, but of course this might not be the case.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
The C++ way to do this would be
copy(verts, verts + 600, tempVerts);
For this you have to add the following lines first -
#include <algorithm>
using namespace std;
You will get a warning which you can avoid by using checked_array_iterator class.
|
|
|
|
|
Thanks Everyone For Reply.
Regards
Yogesh
|
|
|
|
|
Hi all. I have an MDI application that have more then 2 kind of documents : CMy1Doc, CMy2Doc, CMy3Doc, etc. How can I know for sure if an document is already open, if yes then I bring it to foreground, if not then open it ? Thank you.
|
|
|
|
|
You would normally open your documents as a result of user action: button click, menu selection etc. So your program does not need to know whether the document is loaded, it just displays the content in the child window which the user then moves to front or back or tiled as required. Unless of course, your design is totally different from the Windows model. You might also like to consider using more meaningful names for your documents.
|
|
|
|