|
I think your application is slow because of the huge number of items in the list control.
You may consider using a virtual list, see, for instance, the following CodeProject article: Using virtual lists.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Read the file THEN populate the list. and as my colleague wrote, use a virtual list.
Watched code never compiles.
|
|
|
|
|
Hi,
I had written programs using TURBO C & C++ IDE. These were written for MS-DOS OS. When ever i talk about these programs i refer them as "16 bit programs (MS-DOS)". Is it right? cause MS-DOS is an os which could manipulate up to 16bits of information so a program written using its api should be 16bit programs besides DPMI(dos protected mode interface) or the TURBO C++ IDE.
I would like to have any kind of reply which could give more information about this and to conclude my doubt.
|
|
|
|
|
It depends on what you mean by MS-DOS, keep in mind since Windows XP MS-DOS is no longer part of the OS. I believe that is the first Windows version that ran a console rather then MS-DOS inside windows (or the other way around). And in Windows XP+ the console is a true 32bit application. In the 64bit version of Windows it depends on the program, but the default console is 64bit then.
A note on the 64bit Windows, I believe that if an application is 32bit it will start the WOW32 emulator.
|
|
|
|
|
Oh... So the virtual machine works like a 32 bit system isn't it?
What in Windows 98? I hope that virtual machine works as 16 bit.
I am using dosbox an emulator in windows xp because this xp 32bit version virtual machine does not render c graphics as expected.
I hope dosbox should run an emulator which is 16bit. Because i get all my outputs as expected. i have used EGAVGA.BGI Borland Graphics Library and i use lot of outport and inport function which interact with the keyboard and video card.
so can i still say that my programs are 16bit apps because they cannot access more memory than that unless we use memory managers which i have tried a lot but could not successfully use them. now we are far away form those concepts... i am documenting my old work . so is the reason for the flashback.
BESIDES I READ THIS AS FIRST REPLY AND I AM RESPONDING TO IT. I DID NOT READ THE OTHER REPLIES UNTILL I COMPLETED THIS REPLY. ANY WAY THANKS FOR ALL EXPERTS WHO HAD REPLIED TO ME.
http://vikku.info/ Today's Beautiful Moments are
Tomorrow's Beautiful Memories
modified on Saturday, October 30, 2010 4:39 AM
|
|
|
|
|
It depends which Turbo C++ you are using. If it is the ancient character-based one (looks like a DOS screen), then it generates 16-bit code. If, however, you use the more modern one (ca 2005, looks like a real Windows IDE), then it generates 32 bit code, even for console apps.
HTH
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
|
Yes you are right.
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy.
|
|
|
|
|
|
It's not a bad description to start with as all DOS programs start life as 16 bit programs. The calling convention for DOS was all real mode and register based so most parameters had to be 16 bit. If you wanted to pass 32 you had to use a structure or pack them in two registers.
However while all DOS programs start execution as 16 bit, by the early 90s most were starting to branch out a bit and would switch to either 16 or 32 bit protected mode fairly quickly, switching back to 16 bit real (or V86) mode when they needed to make system calls. it was a complete rat's nest and you're better off ignoring it unless you're interested in how the whole sorry mess evolved in the name of compatability.
Cheers,
Ash
|
|
|
|
|
oh. haha. hhmmm... nice. i am already out of that for the past 4 years. but still just a little love on it cause i have lived a lot with Turbo C++ and trying to mimic the same in windows like the interrupts for monitoring processes like file system.
thank you.
|
|
|
|
|
Hey, sorry if the threadtitle is a bit in-informative but I didn't know what to call it.
Ok now to my problem, I am playing around with arrays and stuff see here ->
#include <iostream>
#include <string>
using namespace std;
int main()
{
string a[] = { "one", "two", "three" };
for (int i = 0;i <3;i++)
{
cout << a[i] << endl;
}
cin.get();
}
Now my problem is the "i < 3" let's say I wouldn't want to change that everytime i add another string to my array.
How would I do that?
Greetings!
|
|
|
|
|
there is a ARRAYSIZE macro you can use : ARRAYSIZE(a).
#define ARRAYSIZE(a) sizeof(a)/sizeof(a[0])
i don't recommend it. but it should work.
|
|
|
|
|
|
If you are using Visual C++ you can use the macro _countof(x) which returns the size of the specified array. In your case you have to write i < _countof(a)
|
|
|
|
|
I actually am using VC++, thanks for your answer!
|
|
|
|
|
You are welcome!
|
|
|
|
|
What's wrong with asking the compiler how big the array is - it knows, it bunged the thing on the stack for you:
template <typename T, std::size_t N>
std::size_t sizeof_array( T (&)[N] )
{
return N;
}
Most decent compilers (VC++2003, 2005, 2008 and 2010, gcc 3.3 onwards) will inline that to a constant. You can extend it a bit...
template <typename T, std::size_t N>
T *beginning_of_array( T (&a)[N] )
{
return a;
}
template <typename T, std::size_t N>
T *end_of_array( T (&a)[N] )
{
return &a[ N ];
}
which means you can get away from using indexes entirely and start using algorithms to do the sort of thing you're doing in your example:
int main()
{
std::string a[] = { "One", "Two", "Three" };
std::copy( beginning_of_array( a ), end_of_array( a ), std::ostream_iterator<std::string>( std::cout, "\n" ) );
}
From there you're not far away from using overloaded functions to come up with a generic way of handling different aggregates of things.
Cheers,
Ash
|
|
|
|
|
Hi,
I am using default scrollbar for window. In OnSize i am calling SetScrollInfo() function whenever i am resizing the window. But in some situation the scrollbar is getting hidden, if i reduce or increase the size again scrollbar is becoming visible again. I checked the min and max position values but they are correct.
|
|
|
|
|
Are you also resetting your scroll ranges in your paint routine? You need to do this in order to take account of the current client window size and the amount of information you can display relative to the amount of information available. Remember that these values can change just by using a different size font for text or zooming an image.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Thanks a lot, it worked after doing the changes suggested by you.
|
|
|
|
|
You're welcome.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Hello Friends
I am creating a application using GDI/PLus to save tiff as multiPage.
I got the Image object And tried
Image img;
img.save(..,..);
And its working fine
Then I used
img.saveAdd(..,..)
to add other images.but its not working.
And It is accepting one parameter as EncoderParameter which is having option to set multi Frame as I think as I found tht type in c#.
Do anyone is having idea how can I add image as MultiPage.
Thanks In Advance.
Regards
Yogesh
|
|
|
|
|
Hi,
Lets say, I am having Vendor dll and it is non-unicode.
I want to use this dll in my Application and it is unicode.
DLL is built using SDK functions such way that I cannot make is Unicode, same with Application it cannot build without unicode (frame work dependencies). Both of them are using CString.
Is there any way possible by which I can use this dll in my application without changing their nature?
Please let me know if further clarification needed.
Thanks in advance.
|
|
|
|
|
It should be easy enough. Just make sure when calling the vendor supplied DLL to use explicit specialisations of CStringT e.g. CStringT< char, ChTraitsCRT<char> > . It might be a good idea to use a typedef for this.
Oh, one other thing - make sure that around including the header for the library TCHAR is defined as char and not wchar_t or the functions won't link properly.
Cheers,
Ash
PS: Looks like there are already typedefs in MFC for this sort of thing. Have a look in Alain's answer below for their names!
modified on Thursday, October 28, 2010 8:28 AM
|
|
|
|