|
I am working at tree view. My application is just like Address Book of Windows. I am using instance TV_INSERTSTRUCT to insert items in tree view. It works well in this way. I also save TV_INSERTSTRUCT instances for all items in array. After adding few items I delete all item at runtime and again inserts those item from array, which already have instance of TV_INSERTSTRUCT of previously, inserted and deleted items. But this time only first two items are inserted and all others are not shown in Tree view window. Can some body help me to solve this problem.
|
|
|
|
|
Hi everybody,
Does someone know if there is a way to present a table like a real table in a list box ?
Thank you in advance
|
|
|
|
|
I to all,
does anyone know how to use the LVS_EX_FLATSB style on a CListCtrl class?
I can display the scrollbar, but I can do anything with it : it's disabled .
Thanks to anyone. .
|
|
|
|
|
m_List.SetExtendedStyle(m_List.GetExtendedStyle()|LVS_EX_FLATSB);
Jerzy
|
|
|
|
|
I agree you solution, but my problem is that the scrollbar (when displayed) is always disabled!
Can you tell me why?
Thanks.
Massimo
|
|
|
|
|
a scroll bar in list box is disabled until it needs to be enabled, ie its enabled when there are mroe items in list box than the list box can show at one time.
|
|
|
|
|
My problem is that the ListCtrl is not empty! but have some items loaded .
Thanks.
|
|
|
|
|
in my program i use a list of pointers to objects like this:
class object
{
public:
int x;
int y;
};
class A
{
public:
std::list<object*> list_b;
};
now.. i do have got problems, because i should sort this list by object.x . i have tried to use te list::sort() function.. but it obviously doesn´t work, case the program doesn´t know how to compare this objects..
is there any member function i can override?
or is there any possibility how to use a set instead of that (would be perfect) ?
i am sorry.. i really tried to find a solution on my own.. but in all the docs and webpages i was searching in this problem seemed to be too obvious... so nobody ever told me how to do this
thanx in advance
|
|
|
|
|
Use the code below, just don't ask why it's done this way.
template<>
struct std::greater<object *>
{
bool operator()(const object* &lhs, const object* &rhs) const
{
return (lhs->x < rhs->x);
}
};
std::list<object *> lst;
lst.sort(std::greater<object *>());
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi,
I would like to be able to create small thumbnail previews of word documents and HTML documents.
Can anyone offer any advice.
Cheers
Rich
|
|
|
|
|
Check out IViewObject::Draw, one parameter lets you specify DVASPECT_THUMBNAIL
|
|
|
|
|
I am wondering if there is possibility to strip zeroes from floating point number using printf () function. I searched all printf options and didn't find any suitable one. Is there any other function convenient for this easy task?
Example: I have an array of doubles and I want to display them with .3 precision:
printf ("%.3f\n" f[i]);
Some numbers will look like 45.100 and some like 568.897. In case of 45.100 I want it 45.1 without trailing zeroes.
|
|
|
|
|
I searched all printf options and didn't find any suitable one.
Well, your search quality isn't very good. Use %.3g, 'g' instead of 'f' will strip trailing zeros.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
How can switch the different view in the SDI with the docking TreeCtrl?
|
|
|
|
|
May I know what MFC class is suitable to act as a canvas that used to
display an animating frame image. I want to add that canvas on my dialog based
application.
thank you.
|
|
|
|
|
just can tell you how i do this..
i don´t think that this is the best solution.. but it works..
you have to make a new CView derived class (works with the derived classes like CScrollview perfectly too).. then you change the CView into a control. (like paul dilascia did it in the c++ q&a in msj jan 2000)
in this control you can do whatever you would do in the view..
don´t be afraid.. it is not as complicated as it may sound like.. all you have to do is to override 3 or 4 member - fun´s..
but i don´t have got the energy right now to post in the whole thing.. but if anyone is interested in my solution you can write me an email..
and if anyone of you knows a better aproach.. i would be happy too..
|
|
|
|
|
Could somebody please help me with this?
I have a client program and server program... I am just testing if data in specific structure is being sent to the server program..... ok... In my client program there are 3 edit boxes.. so i want these three variables being sent to server program.. so let me just write down some of source codes... and please modify it... Everthing related to socket
works fine... Using IP addresses, the client project can be connected to Server project. I guess it's a matter of receiving
datas in the structure from the server. Garbage datas are being sent to the server program....
//Those 3 variables for Edit Boxes...
CString m_Age;
CString m_Email;
CString m_Name;
// class
class sMsg
{
public:
char cUserEmail[50];
char cUserAge[10];
char cUserID[10];
};
// Client program
void CStructTestClientDlg::OnSend()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
sMsg *msg = new sMsg;
strcpy(msg->cUserID,m_Name);
strcpy(msg->cUserAge,m_Age);
strcpy(msg->cUserEmail,m_Email);
m_ClientSocket.Send((LPVOID)msg,sizeof(msg));
}
//Server Program
void TChildSocket::OnReceive(int nErrorCode)
{
sMsg *msg = new sMsg;
m_pServerSocket->Receive(msg,sizeof(msg));
CString i = msg->cUserID; //(just checking if one variable could be printed out....)
AfxMessageBox(i);
}
|
|
|
|
|
m_ClientSocket.Send((LPVOID)msg,sizeof(msg)); You should use sizeof(sMsg) or sizeof(*msg), or you will send/receive only 4 first bytes of your message.
|
|
|
|
|
sizeof(msg) returns 4 which is the size of the pointer, instead you should use sizeof(sMsg)
BTW, is it possible to send binary data through a socket connection. I thought it was a text_only_thing
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
There's really no difference between "text" and "binary data", both are simply a stream of bytes. Sockets don't care about the bytes you send. It's true that most Internet protocols are text-based, but that's for interoperability of different computer architectures (no byte ordering or word length problems)
|
|
|
|
|
Is there any message fired when an application looses the focus by Alt+Tab and gets back the focus?
I have an application which has a modal dialog.
I need to call one function from the dialog when my application gets back focus after switching to another application (say Notepad) and comes back ro mine.
Can anybody help?
|
|
|
|
|
|
Is there any message fired when an application looses the focus by Alt+Tab and gets back the focus?
I have an application which has a modal dialog.
I need to call one function from the dialog when my application gets back focus after switching to another application (say Notepad) and comes back ro mine.
Can anybody help?
|
|
|
|
|
How to Maximize a Dialog Based Program But not Covering the Task Bar?
I use the statement "SetWindowPos(&wndTop, 0, 0, 800, 600, 0)" or the statement "ShowWindow(SW_SHOWMAXIMIZED)" ; But the dialog based program still covers the task bar. Why?
Thanks
|
|
|
|
|
1. Right click on your taskbar, select properties, and check the "Always on top" item.
2. Use ShowWindow(SW_SHOWMAXIMIZED);.
3. All sorted
|
|
|
|