|
How to find item or string in ListCtrl
I am using finditem but it is searching in first column only.
|
|
|
|
|
|
I want to add XP look to my buttons and ListCtrl (Visual C++ 6.0).
I added manifest file in same folder of my exe file and that works with buttons and edit ctrl, but when I click on vertical scrollbar of my listctrl i get extra lines in ctrl (it is set that list ctrl has gridlines) or they wanish ?!
Does anyone knows how to solve this problem??
|
|
|
|
|
Hi guys,
Does anybody have an idea how I can get the type of
a class member variable ?
I'm looking for something like:
template<class c=""> swap(C &v)
{
typeof(v.x) t; //<-- t has to be the same type as v.x
t = v.x;
v.x = v.y;
v.y = t;
}
Thanks in advance.
|
|
|
|
|
You could use dynamic_cast and if the returned pointer is not NULL, it was a good cast.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Given that in this case all you want to do is swap the member, why not call swap on that? The nice part about this is that it requires at compile time that what you pass into swap_x_with_y has an x and y member variable. The realswap function will happily just swap over whatever you give it, providing they are the same type.
template<class T> swap_x_with_y(T &v)
{
realswap(v.x, v.y);
}
template<class T> realswap(T &x, T&y)
{
T t = x;
x = y;
y = t;
}
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
hello,im interested to know if there is a way to capture the output from a program like telnet or something and save it to a text file?
i see no reason why this isnt possible,so if any 1 has any info regarding this,id like to know...
thanks 4 ya time
chris
|
|
|
|
|
You may use pipes.
at the prompt type
dir *.* > directory.txt
you may also send the output to 2 devices.
Make a file with all the commands you want to carry out in telnet seperated by a newline.
Don't forget to include q a the end.
then save the file as telnet.cmd or something you will remember.
at the command prompt enter
telnet < telnet.cmd > telnet.res
That will work just fine.
The other way is to echo to a file but that is noit good practice any more because window may not support the src device anymore.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
thank's this will work just fine;)
|
|
|
|
|
Hello
Has the registry changed at anytime from win 95 to win XP concerning the following keys?
HKEY_CURRENT_USER\Identities\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx}\
HKEY_CURRENT_USER\Identities\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx}\Software\Microsoft
HKEY_CURRENT_USER\Identities\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx}\Software\Microsoft\Outlook
Express
HKEY_CURRENT_USER\Identities\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx}\Software\Microsoft\Outlook
Thanks Marty
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Yes it work fine, I think you are on to a better way.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Well, I looked around, and everyone seems to think this is hard to do, but here's what I came up with:
BOOL CD3PlayRecsDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CRect frameRect;
GetDlgItem(IDC_STATIC_VIEWFRAME)->GetWindowRect(&frameRect);
m_pView = new CDialogView(NULL);
ScreenToClient(&frameRect);
DWORD winStyle = WS_CHILD | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE | WS_BORDER;
m_pView->Create(NULL, NULL, winStyle, frameRect, this, AFX_IDW_PANE_FIRST+1, NULL);
m_pView->SetScrollSizes(MM_TEXT, CSize(100,100));
m_pView->MoveWindow(&frameRect, TRUE);
return TRUE;
}
In the dialog tempate, I created a static frame to use as an anchor (where and how large I wanted the view window to be), and then created a CScrollView object and moved it into position. The tricky bit was getting it not to crash when the dialog box tried to display itself, but calling SetScrollSizes fixed that.
Am I missing something? Should this be hard to do than it appears to be?
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Hi Jason
Try some ASSERTS
like
CHttpMyDlg* pDlg = ( CHttpMyDlg*) pParam;
ASSERT(pDlg);
ASSERT(pDlg->IsKindOf(RUNTIME_CLASS( CHttpMyDlg)));
Then take pDlg-> and set your rect and view.
When you get the error you may see your mistake. I looks good to me so I am just trying to give you another way to look at it.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
I don't understand what you're trying to do/say.
This is a dialog-based app, and the code I posted is in the OnInitDialog() function of the main dialog.
It works, and even under debug, there are no memory leaks or anything...
Why would I care what kind of dialog it is?
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Do you know?
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Do I know what?
It's a CDialog with a CScrollView embedded in it.
It doesn't crash. It doesn't leak. I can update the view object (drawing in it) without any problems.
What's to know?
If you're gonna make a point, then make it, but don't draw this out. I don't have the time to banter back and forth with pointless discussion. If I screwed something up, then by all means tell me what I did wrong. The whole reason I even posted this is because it was easier to do than the impressions I was getting by reading the articles.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Ride Outlaw Programmer, Ride into the lonely night, ride cowboy ride.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
What is the var is it CDialogView* m_pView; ?
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
class CDialogView : public CScrollView...
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
It's only hard to do because it's not the recommended/documented way to use MFC. The designers intended a view to be inside either a frame window or a splitter window. If you can devise your own window code to properly contain a view, and it sounds like you have, then party on.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
"Just because the box has 2 gigabytes of memory doesn't mean you get to use it all!"
-- Rico Mariani, CLR perf guy
|
|
|
|
|
Yes it works fine, I think you are on to a better way.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
good work. keep it up.;)
I think dialog box is basically a window. as I recall the MFC hierarchy. so, thats why what you thought has worked.
|
|
|
|
|
Hi..Everybody..
:|My problem is:
I want to save my drawing in Tiff format (in painbrush like application)..
Now as I draw any shape or Image(BitBlt)..then I want all my matter in CDC is saved in Tiff format...
Can any body guide me to convert memory DC to Tiff file using MFC.
I hope u help me..;)
Thanks...sumit;)
Sumit Kapoor
|
|
|
|
|
u need to get a tiff library (cximage on cp does the trick nicely) or figure out the format urself
best get cximage
"there is no spoon" biz stuff about me
|
|
|
|
|
Hi..
Thanks for reply...
I'm using LibTiff library for tiff.
The problem is how to provide data to tiff file..
As I draw in CDC & all drawing want to transfer to tiff..
Issue is how to pick that drawing & place in tiff...
Plz help me if u know in this side..
Thanks
Sumit
Sumit Kapoor
|
|
|
|