|
Hello !!
I want to have a CHeaderCtrl at the top of a view.
How can I do this??
Because it is a aplitter window , and in the other view is a CListView with a Header Control at the top
and the same header I want to have in the other View.
|
|
|
|
|
Since it's usually positioned above columns of text or numbers, why would you want one in a view with no columns?
|
|
|
|
|
A header control can be created on its own, just like any other type of control. Create it as a child window of the view in question.
--Mike--
Yeah, payin' the bills with my mad programming skillz.
Defraggin' my hard drive for thrills.
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
===========
#include <iostream>
int main()
{
double z = 20.0;
std::cout<
|
|
|
|
|
a double is only a 64bit value. You can't get a 128 bit number out of that. You're going to have to find some other way of getting your precision.
Joseph Dempsey
joseph_r_dempsey@yahoo.com
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."
--anonymous
|
|
|
|
|
double on Win32 is of course 64bit.
long double on SGI and on Sun is 128bit.
The question is - why does VC++ produce such a weird output?
I am not trying to get 128bit number out of Win32 double, I'm just trying to output it with 50 digits after the decimal point. And when I try to do that, I get completely wrong result. Borland C++ and g++ produce correct results on Win32.
|
|
|
|
|
Just a guess but I think it may be outputting the least number of digits required for significance.
|
|
|
|
|
The problem is quite different,
20
and
2000000000000000
are just very different numbers, it is not the same nubmer with a different number of digits after the decimal point .. there is no decimal point
|
|
|
|
|
Perhaps you'd want this instead:
void main( void )
{
double z = 20.0123;
for (int x = 1; x < 40; x++)
cout << setprecision(x) << z << endl;
}
|
|
|
|
|
It is a bug in Microsoft's STL when the precision is greater than _MAX_SIG_DIG and the formatted number doesn't contain any decimal point. Send the bug off to Microsoft and/or Dinkumware http://www.dinkumware.com/[^].
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I thought it is a bug, weird one. Thanks for the explanation.
|
|
|
|
|
Currently I'm considering my options with a small project and if it is posible I think the easiest way to do some of the data handling would be to read and write to the ASCII keyed files using VC++. And while I say this, I can't seem to find any online refferences on how to do this ... any suggestions?? As a little background info ... these keyed ASCII files where created and maintained originally in MTB
BASIC.
Thanks in advance ..... Bryan ~
|
|
|
|
|
You did not indicate that you're using the MFC, so I am going to assume you are ... check into CStdioFile class. That should give you the functionality you need/want.
D.
|
|
|
|
|
What do you mean by "keyed files".
Trust in the code Luke. Yea right!
|
|
|
|
|
Hello, my name is Alexander, I need urgent help with how to write a C++ program to read the data from an Excel spreadsheet (exported in fixed length format or comma delimited) to an object of the CFile class. Then, how to write a program to look at the records in the CFile object. Please, HELP
Alexander
|
|
|
|
|
|
Gee, if you submit this as your assignment, you might get 4.31/5.0, say 86%. I'll have to remember this, the next time I'm interviewing a Devry grad.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"Microsoft hasn't ever enforced its patents. Apparently they keep them for defensive reasons only. Or, they could be waiting 'til they have a critical mass of patents, enforce them all at once and win the game of Risk that they're playing with the world." Chris Sells Feb 18, 2003.
|
|
|
|
|
Hey all.
Just wanted to ask if it is possible to make Visual Studio break whenever a given variable gets a specific value?
Thanks in advance.
-Rune Svendsen
|
|
|
|
|
One Word: "Softice"
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Just modify the breakpoint to be a conditional breakpoint.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"Microsoft hasn't ever enforced its patents. Apparently they keep them for defensive reasons only. Or, they could be waiting 'til they have a critical mass of patents, enforce them all at once and win the game of Risk that they're playing with the world." Chris Sells Feb 18, 2003.
|
|
|
|
|
Yes. Set your break-point. Then press the ALT-F9 key to open up the BreakPoints watch window. Select the DATA tab. You'll now have the ability to set an expression based on a value. If you click on the ADVANCE button on that data tab, you can get really fancy.
D.
|
|
|
|
|
Dear all,
I can't borrow a book even though the code does not have any error. When I try to display the book details along with the member's name (in case the member has borrowed the book), I can't display the member's name, but only the book details and a message: "no member has borrowed a book".
Though the code works fine when I have one book and one member, but now that I'm using an array of books and members it doesn't work.
The code that displays the book and the member's name when I have 1 book and 1 member is:
<code>
void Book::display(Member* borrower)
{
cout<<"Book title and author are: "<<this->bookDetails<<"."<<endl;
if (borrower)
cout<<"The member's name is: "<<borrower->get_Data()/*get_name()*/<<"."<<endl;
else
cout<<"No member has borrowed a book."<<endl;
}
</code>
<code>
char* get_Data(){return this->name;}
</code>
<pre>returns the member's full name, entered in the constructor
I have an associationlist that holds pointers to associations. Each association has two pointers, one to a book object and the other to the member object.
<br />
class AssociationList<br />
{<br />
public:<br />
AssociationList();<br />
<br />
<br />
Member* get_data(Book* book);<br />
<br />
<br />
Book* get_data(Member* member);<br />
<br />
<br />
bool link(Book* book,Member* member);<br />
<br />
<br />
bool unlink(Book* book,Member* member);<br />
private:<br />
Association<Book,Member>* association_list[LIST_SIZE];<br />
};<br />
The code that performs the linking between 1 book object and 1 member object is the following:
<br />
template<class Book,class Member><br />
bool AssociationList<Book,Member>::link(Book* book,Member* member)<br />
{<br />
bool searching=true;<br />
bool success=true;<br />
int index=0;<br />
int free_slot;<br />
<br />
while(searching)<br />
{<br />
if(this->association_list[index])<br />
if((this->association_list[index]->linked_book()==book ||<br />
(this->association_list[index]->linked_member()==member)))<br />
{<br />
searching=false;<br />
success=false;<br />
}<br />
else<br />
index++;<br />
else<br />
{<br />
free_slot=index;<br />
index++;<br />
}<br />
if(searching&&(index == LIST_SIZE))<br />
searching=false;<br />
}<br />
if (success)<br />
this->association_list[free_slot]=new Association(book,member);<br />
return success;<br />
}<br />
Code that is used in the link function
<br />
template<class Book,class Member><br />
class Association<br />
{<br />
public:<br />
Association(Book* book, Member* member);<br />
<br />
Book* linked_book(){return this->book;}<br />
<br />
Member* linked_member(){return this->member;}<br />
<br />
private:<br />
Book* book;<br />
Member* member;<br />
};<br />
and
<br />
template<class Book,class Member><br />
Association<Book,Member>::Association(Book* book, Member* member)<br />
{<br />
cout<<"Association constructor called\n";<br />
this->book=book;<br />
this->member=member;<br />
}<br />
What needs to be done so that each member to be able to borrow one book?
(10-members)
(10-books)
(1 member can only borrow one book at a time)
Regards,
grscot
|
|
|
|
|
Dear all, I'm still struggling to display the book and borrower's details together.
Could someone help me?
regards,
grscot
|
|
|
|
|
I developed a simple object swap template. I simply do a binary swap of the class/structure contents. Yet I know that the developers of the STL libraries do not implement swaps in this way. Their implementation will make copies (via a copy constructor) and then use an assignment operator - "operator=()". The reason I want to do swaps in this manner is because of the obvious efficiencies. For instance, if I wanted to swap two branches of two very large tree structures, the copy and assignment operations become prohibative.
My question is in what instances does the code below NOT work?
template <typename _Ty>
void ObjectSwap(_Ty &obj1, _Ty &obj2)
{
// Don't swap on the same object
if (&obj1 != &obj2)
{
char tmp[sizeof(_Ty)]; // create a memory buffer
size_t sz = sizeof(_Ty);
memcpy((void *) tmp, (const void *) &obj1, sz);
memcpy((void *) &obj1, (const void *) &obj2, sz);
memcpy((void *) &obj2, (const void *) tmp, sz);
}
}
Scott K
|
|
|
|
|
I could see this working but it could lead to unexpected results if there are other pointers that point to the same object.
I'm confused though: why not just swap the pointers to the objects instead of the objects themselves? If you want to swap two branches of a large tree structure, you simply swap the pointers that point to those branches.
|
|
|
|