|
I am not using MFC actually. The CString class is my own class wrapper, and I have only pasted one method implementation from CString to show how charset conversion is done. But virtually all the code is flat WIN32.
|
|
|
|
|
I search to read and view the files thumbnail like windows explorer ... Can you help me?
Thierry
|
|
|
|
|
The windows explorer uses a list view with large icons style, then create the thumbnails of the images and store it in the images list attached to the list view. Therefore all you hsould do is to have a list view, iterate the files in a directory and for each file create its thumbnail and add it to the list view's image list. The Explorer cache the thumbnails for better performance in a file called thumbs.db, I think it contain serialized imagelist in addition to folder modification flags.
|
|
|
|
|
Take a look at c:\winnt\folder.htt
|
|
|
|
|
Hi people
i've got a problem with a project i'm working on. basically its meant to display a new jpeg every time i select a different one from a list box.
If i select one, it loads, but i have to move the window for it to display. then if i click a different jpeg, i have to minimise and open it again to see the new image...
i know there's probally a basic awnser to this, like sending a WM_PAINT to the main dialog window, but i just cant get it to work.
any help would be greatly appreciated...
Oh, and its an all win32 program, no wizard or MFC
thanks
-Mortis
|
|
|
|
|
Call RedrawWindow() to make a window repaint. Use the RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE flags to make it repaint right away.
--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
|
|
|
|
|
thanks dude
works fine now
|
|
|
|
|
Quick question concerning 1-D vs. 2-D arrays.
Can anyone comment on whether it is faster to address a 2-D
array versus a loooong 1-D array (or vice versa).
Is there any performance difference at all?
|
|
|
|
|
To the compiler, the following both occupy 27 bytes of memory:
char x[27];<br />
char y[3][9];<br />
<br />
int n;<br />
for (int i = 0; i < 3; i++)<br />
{<br />
n = i * 9;<br />
printf("%s\n", x[n]);<br />
}
versus
for (int i = 0; i < 3; i++)<br />
printf("%s\n", y[i]);
Once the address is known, accessing the individual bytes of each variable requires the same amount of time. What does take more time is the calculation in the first example.
|
|
|
|
|
And in the end it will not make any difference.
One would think access to memory is much slower than any integer op.
Brian
|
|
|
|
|
Hoard claims that it uses a per-processor heap. When I went through the code, it does the following:
It has an array of size 2048, that holds indices of seperate heaps. When a malloc is performed, it identifies the heap to use by the expression
int array_index = (GetCurrentThreadId() / 2) % 2048; (assuming that the thread id never goes above 4096. ) It then looks up the heap to use by
heap_array[array_index]
A number of heaps are initially created. If the heap index returned from the array is 0, it assigns the next free heap to it.
This looks rather like a thread based heap, rather than a processor based heap. How valid is the assumption that threadid will not go above 4096?
Thomas
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
The code doesn't assume the thread id never goes above 4096. The expression is using the modulus operator. array_index will always be in the range 0-2047 regardless of the value returned by GetCurrentThreadId().
But your observation is right; if this is what they're doing, Hoard isn't a per-processor heap manager at all and all the problems they claim are caused by multiple processors are not resolved by their algorithm.
|
|
|
|
|
You are right, I got confused
But, then it reuses the heap for multiple threads....and there is always a potential that two threads concurrently running on two processors can get the same heap. If the thread ids are sequentially generated, the chances of 2048 being used is quite low. If they are generated randomly, then collisions will be much more frequent; and the performance will not be predictable.
If its is ensured that each thread has its own heap, then two concurrent mallocs will never be operating on the same heap, even though two free operations can be.
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I have a project that I'm linking to some libraries (sizable but not huge), and my linker has been running for the past 8 minutes @ 99% processor util!
That's a 1.8GHZ P4 w/ 1.5GB RAM BTW!
Any ideas?
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Have a and chill on it until Monday.
It is Friday night, after all.
Seriously though, something must be screwy. Are there any demo projects which came with the libraries that do the same?
Beyond that, I've no idea, other than to check your linker settings, disk space, fragmentation and so on.
Another thought - were the libraries created with the same version of Visual C++ as your project?
Anna
Homepage | My life in tears
"Be yourself - not what others think you should be"
- Marcia Graesch
"Anna's just a sexy-looking lesbian tart"
- A friend, trying to wind me up. It didn't work.
Trouble with resource IDs? Try the Resource ID Organiser Visual C++ Add-In
|
|
|
|
|
Anna-Jayne Metcalfe wrote:
Another thought - were the libraries created with the same version of Visual C++ as your project?
hmmm....
Anna-Jayne Metcalfe wrote:
Have a and chill on it until Monday.
Good idea!
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Slow disk, or compiling over the network...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Can anyone give me an code-example howto write into an excelfile?
It should not be odbc-like (this already works).
I need something to write direct in an excelcell.
for example I want to write an formula in a cell which refers to the data i've imported "odbc-like" in the excelfile.
Sorry for my terrible English
|
|
|
|
|
Can anyone give me an code-example howto write into an excelfile?
It should not be odbc-like (this already works).
I need something to write direct in an excelcell.
for example I want to write an formula in a cell which refers to the data i've imported "odbc-like" in the excelfile.
|
|
|
|
|
Search MSDN for examples of Excel automation. Here's one I came up with:
_Application app;
Workbooks books;
_Workbook book;
Worksheets sheets;
_Worksheet sheet;
Range range;
COleVariant vtOptional((long) DISP_E_PARAMNOTFOUND, VT_ERROR),
vtTrue((short) TRUE),
vtFalse((short) FALSE);
CString strText;
if (app.CreateDispatch("Excel.Application") == TRUE)
{
app.SetVisible(TRUE);
books = app.GetWorkbooks();
book = books.Add(vtOptional);
sheets = book.GetSheets();
sheet = sheets.GetItem(COleVariant((short) 1));
range = sheet.GetRange(COleVariant("A1"), COleVariant("A1"));
m_ebCellA1.GetWindowText(strText);
range.SetValue(COleVariant(strText));
range = sheet.GetRange(COleVariant("A2"), COleVariant("A2"));
m_ebCellA2.GetWindowText(strText);
range.SetValue(COleVariant(strText));
range = sheet.GetRange(COleVariant("A4"), COleVariant("A4"));
range.SetFormula(COleVariant("=A1 + A2"));
}
|
|
|
|
|
Thx for the fast answer
Which headers do I have to include
|
|
|
|
|
First you'll need to create a new class from the EXCEL9.OLB (or whatever version of Excel you are using) type library. That process will create a .CPP and .H file that gets added to your project.
|
|
|
|
|
And how to start this process? which tool generates this .cpp an .h files.
I'm using vc++ 6.0
|
|
|
|
|
Search MSDN for "excel.automation" and "excel9.olb".
|
|
|
|
|
ok thx,
i will first study a little bit.
I ask again when I knew it a bit better and can ask more special questions.
I thought it would be not as difficult because the odbc-connection was quite easy
|
|
|
|