|
Hello,
Does anyone knows how to work with multi-column listbox, how to work with the columns and the data? any help or link is appreciated!
Thanks
|
|
|
|
|
Have you specified the LBS_MULTICOLUMN style?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I will, but only after I figure out how to deal with the columns and the data
|
|
|
|
|
Deian wrote:
...but only after I figure out how to deal with the columns...
The listbox will not have columns without that style.
Deian wrote:
...and the data
There's nothing special about the items that are inserted into a listbox when multiple columns are involved. Use the LB_ADDSTRING message in either case.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
If you want multi column please check the CListCtrl control
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Well, I wanted to avoid using the CListCtrl, and I was curious on how to make it work. I don't have documentation about the functions involved in manipulating the columns, and dealing with data in the multi-column listbox.
|
|
|
|
|
|
can anyone pls help, i wan to retrieve the RIP header information using c++, anyway to do tis? how?
|
|
|
|
|
Have you read through RFC 1058?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Can someone please help me, I am trying to program my own Html browser, i am new to VC++.
I have two problems.
1) Created a new project in VC++ using the CHTMLVIEW base class, but get error message when i delete all the File,Edit option from the IDR_MainFrame ( I dont want the option bar) "FAILED TO CREATE EMPTY DOCUMENT"
2) I imported a HTML file in the resource, Works fine using the LoadFromResource(IDR_HTML1) but i can not get the links in that page to work,(works fine in normal IE)
Is there a easy way to combine html pages with in the C++ project file??
Please ,Please help....;P
|
|
|
|
|
|
Since I am having problem using drawdragrect(can't get it to work with scrolling) I decided to draw my own draggable rectangle.
I did it with Rectangle and SetROP2(R2_XORPEN). But the problem with that is when I drag the rectangle would inverse the color thus fill the rectangle with black color. Any way around this?
I tried it with Lineto but it would also inverse the color when two line meet at the edge. I tried to set it so line wouldn't overlap but the problem with that it would actually create gap.
Now I am doing Polyline which seems to work. Is this how most people draw their draggable rectangle?
|
|
|
|
|
Hello.
i'm trying to use IOCompletionPort while connecting to servers.
i have one client program which suppose to connect to alot of servers.
i want to do to connection with IOCompletionPort mechanism.
can anyone help me with it a bit?
i need some guidelines. my connecting is alway in blocking mode.
thanks
|
|
|
|
|
I want to serialize CMyTreeCtrl. This class is derived from CTreeCtrl. Can I serialize the whole tree?
MiKE
|
|
|
|
|
I need to eliminate flickering when resizing a derived CMDIChildWnd window that displays an image (already available in memory). I can display a series of images without flickering by opening all images in memory, and painting them from there (File access is done once only). However, I can't seem to get rid of flickering when resizing.
I tried modifying the OnPaint, OnSize, and OnSizing messages, but to no avail.
Please Help
Fayez
|
|
|
|
|
Try modifying OnErase() which erases the background.
|
|
|
|
|
Thank you very much, that works perfect! BTW, I think it was the OnEraseBkgnd()
|
|
|
|
|
I have a dialog with vertical scroll bars and lots of
text and edit boxes. Any ideas on how to automatically
scroll down the dialog as the user is typing in
information? Or somehow, if the user is in a certain
edit box, that it scroll to center itself rather than
making the user scroll down?
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
I'll assume you've got the scrolling working to your satisfaction. When you use the scroll bars, the contents of the dialog scroll appropriately.
DanYELL wrote:
if the user is in a certain
edit box, that it scroll to center itself rather than
making the user scroll down
You can do this by handling the EN_SETFOCUS [^] notification from the edit controls in the parent dialog. EN_SETFOCUS is sent by an edit control to its parent window (the dialog, in this case) when it receives the focus. In the parent dialog, you can use this to scroll the dialog so that the edit control is in view.
Software Zen: delete this;
|
|
|
|
|
I've imported the classes into my app and generated the MFC wrapper classes from the file "MPNA81.TLB". All the classes are there, but I don't know how to put a map control on my dialog. I tried using just the mappoint activex control, but this doesn't have all the functionality I need. I've seen examples where the typelib is used, but then that code instatntiates the application object. I just want the map displayed on my dialog so that I can make routes and place markers at the appropriate stop. Is there a way to do this without opening the whole MapPoint app? Any help is appreciated. Thanks in advance
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
Check out what's being displayed on this phone:
http://www.cnn.com/2004/TECH/ptech/12/27/cell.phone.viruses.ap/index.html
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
interesting....does the mean that I can program a phone using c++?
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Tom Wright wrote:
does the mean that I can program a phone using c++?
I'm not big into telephony, but it would not surprise me one bit, especially with the newer, more powerful computer phones.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
This program in g++ under liunux. then i made it to compile it under vc++(of course i have to change things slightly). the program is compiling without any error but it is not giving any output.
This code is compiled under VC++:
#include <iostream>
#include <set>
#include <queue>
#include <list>
using namespace std;
#include <stdio.h> // 2
struct Situation {
set<int> left, right;
bool torchLeft;
int minutesPassed;
list<string> description;
};
bool operator<(const Situation &a, const Situation &b)
{
return a.minutesPassed > b.minutesPassed;
}
int main()
{
const char *n[11] = { 0, "A", "B", 0, 0, "C", 0, 0, 0, 0, "D" };
priority_queue<Situation> q;
Situation s;
char d[256];
// initial situation: all persons and torch on the left
s.left.insert(1);
s.left.insert(2);
s.left.insert(5);
s.left.insert(10);
s.torchLeft = true;
s.minutesPassed = 0;
q.push(s);
while (!q.empty()) {
// q is sorted by minutesPassed increasing, get the top-most
// entry, which has the shortest minutesPassed of the queue
s = q.top();
q.pop();
// if all persons are on the right, this is a solution
if (s.left.empty()) {
cout << "solution found: " << s.minutesPassed <<
" minutes" << endl;
for (list<string>::iterator i = s.description.begin();
i != s.description.end(); ++i)
cout << " " << (*i).c_str << endl; // 1
cout << endl;
continue;
}
set<int> &src = s.torchLeft ? s.left : s.right;
// single person moving
for (set<int>::iterator i = src.begin(); i != src.end(); ++i) {
Situation t = s;
if (t.torchLeft) {
t.left.erase(*i);
t.right.insert(*i);
} else {
t.right.erase(*i);
t.left.insert(*i);
}
t.minutesPassed += *i;
if (t.minutesPassed >= 18)
continue;
_snprintf(d, sizeof(d), "%s moves %s (%d minutes, %d " // 2
"total)", n[*i], t.torchLeft ? "across" : "back",
*i, t.minutesPassed);
t.description.insert(t.description.end(), d);
t.torchLeft = !t.torchLeft;
q.push(t);
}
// two persons moving
{ // 3
for (set<int>::iterator i = src.begin(); i != src.end(); ++i)
for (set<int>::iterator j = i; j != src.end(); ++j) {
if (j == i)
continue;
Situation t = s;
if (t.torchLeft) {
t.left.erase(*i);
t.left.erase(*j);
t.right.insert(*i);
t.right.insert(*j);
} else {
t.right.erase(*i);
t.right.erase(*j);
t.left.insert(*i);
t.left.insert(*j);
}
t.minutesPassed += *i > *j ? *i : *j;
if (t.minutesPassed >= 18)
continue;
_snprintf(d, sizeof(d), "%s and %s move %s (%d " // 2
"minutes, %d total)", n[*i], n[*j],
t.torchLeft ? "across" : "back",
*i > *j ? *i : *j, t.minutesPassed);
t.description.insert(t.description.end(), d);
t.torchLeft = !t.torchLeft;
q.push(t);
}
}
}
return 0;
}
the required output should be like this:
solution found: 17 minutes
A and B move across (2 minutes, 2 total)
A moves back (1 minutes, 3 total)
C and D move across (10 minutes, 13 total)
B moves back (2 minutes, 15 total)
A and B move across (2 minutes, 17 total)
solution found: 17 minutes
A and B move across (2 minutes, 2 total)
B moves back (2 minutes, 4 total)
C and D move across (10 minutes, 14 total)
A moves back (1 minutes, 15 total)
A and B move across (2 minutes, 17 total)
can you please point out the error and re-paste the correct code(so that i can compare and understand better), i will be thankful to you.
|
|
|
|
|
compile under debug (which may actually be the default setting if you haven't changed it in VC), and use the step function.
It will serve you better to learn how to watch the program progress through stepping through your own code as you can find your mistakes in the future faster. Use the step to step through one line at a time. With a program this size, it should be very easy and very rapid to step through. You can inspect variables using the tools in the system as well so that you have a full detailed knowledge of how things are progressing.
As your programs get more complicated, and you can narrow down where an error occurs before you debug, you can set a "break" which will stop execution and let you step through from that point forward. You shouldn't need that yet as this program is small. Do familiarize with the tools at your disposal. Similar tools are available in most compilers, if you know "what to look for" rather than specific instruction, you can find the same capability.
Use the help, search the index for key words, "debug" "trace" "step". There is a lot of information to help you if you learn where to look and what is there to help you.
Jeff
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|