|
Why 1024 perform much worse than 1023 and 1025 in the same program, even 1025 is bigger than 1024?
You are not allocating 1024 bytes on the Heap and you are not copying 1024 bytes. So, what exactly you want to test?
If speed of memcpy -- then I'll give you an answer: the shorter the better -- just check the code: nothing specific to pow of 2...
If you assume that allocation with size 1024 would be alligned at 1024 address: wrong again -- that is true for HeapAlloc -- you are using new, which is default malloc that in reality is your requested size + 4 bytes in front to be returned by _msize()...
Now I agree, that getting non-linear results seems weird.
However, are you running any kind of optimization?...
I would recommend trying to decrease Z, while making N=M -- see what happens...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
In fact, i am working on a tiled image application, each tile sometime need several rows or columns of data in nearby tile. This is the reason i write the tester.
In this situation, you will find 1024 is not a good selection, even you create a matrix with side of 1025 (but not use the extended 1 pixel) will work better than exactly 1024.
I think i didn't turn on any special optimization. Just use the default release option as console in vs7. I also copy my tester to other pc. The result is almost the same.
PS. my Os is win2k, CPU is P4 1.7G, Memory 512M
|
|
|
|
|
I have an edit box. I click Properties, then Border
and the border of the edit box goes away. The problem
is, the text in the box now appears way in the upper
left corner. Is there any way to not have a border
and make the text start down just a pixel or 2 (and
maybe to the right by 1-pixel)???
Please any response anyone can give me will be greatly
appreciated.
Sincerly,
Danielle (an overworked graduate student)
|
|
|
|
|
I don't think this is possible in the resource editor properties so you can either reduce the height of the edit control or do the following in code.
Try pEdit->SetRect() and position the rect vertically in the middle of the edit window. Use GetRecit() to get its current rect, then just update the top and bottom values.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
When my application is runing ,other aplications of in Windows 2k don't work (when my application runing ,my application has a appropriation the operating system itself )
|
|
|
|
|
You're writing a virus ?
What is your question ? What does your program do ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
not virus , a user run my application ,don't ask him to run others ,the clients sue .this is for MIS . Do you understand ?
|
|
|
|
|
No, I don't understand. What does 'don't ask him to run others' mean ? What's MIS ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
After you run my application ,the other application will be stoped .MIS(manager Information System).thank you .
|
|
|
|
|
Stopped as in a killed process, or as in stops doing anything ? What is Manager Information System ? What does this app of yours do ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
|
Let's see - an anonymous guy won't tell me what his app is, or answer my other questions to try and figure out what his problem is. Should I be trying to help here ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
do you understand me ? are you a programmer ?
|
|
|
|
|
Check how many articles I have on this site and then you decide.
The problem is not who is and isn't a programmer, it's that you can't speak English ( which is not a crime ), and, more importantly, won't answer my questions. I still don't know if your program stops other processes from responding, or kills them. Did you understand when I asked you that ? Are you a programmer ?
Apart from that, you're secretive about what your program does, and you're posting anonymously. You need to be less rude if you want to act like that and still get people to help you.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
hmm my guess is that, he wants his users not be able to run any other applications while his application is running, it probably works like a "lock" on the clients' machines: while my app is running, you cannot alt-tab out, cannot browse files/folders on the hard disks, cannot access "my computer" or "control panel", cannot do whatever until my app is terminated.
That I think is reasonable since computers in some public environments such as libraries or internet bars are acting like this, in a library you can use their computers to search for some particular books you needed, but you can't delete their files or run you own programs on that machine right?
Anyway, to the original poster, I think you might want to develop a program that runs in "full screen" and "exclusive" screen mode and install global hooks to disable system keys, such as "alt-tab", "ctrl-alt-del", etc... I'm not good on those stuff, though.
|
|
|
|
|
|
thank you very much .
|
|
|
|
|
I want to use ms word as a doc viewer,and incapacitate it's most function,such as "save as","copy","paste".
I have not idea about this.Is that a comparative easy method can achieve my goal??
lost my way
|
|
|
|
|
Microsoft also distributes a word document "viewer" for people who do not have Word.
It may be able to be controlled via COM/OLE just like Word can.
|
|
|
|
|
Where can I get the doc viewer?
Is that a activex?
lost my way
|
|
|
|
|
|
Hi,
I'm attempting to add some Windows Explorer style functionality to my archiving program, which is dialog-based and uses the straight Windows API with _no_ MFC. So far I have created a tree view and a list view with a splitter between them. However, I am having problems in finding any decent information on how to implement full drag and drop functionality *without* using MFC. I found the following two excellent articles on tree views and list views using Win32:
http://www.codeproject.com/useritems/TreeView.asp
http://www.codeproject.com/useritems/ListView.asp
The Tree view article covers the rudiments of dragging and dropping, so that I am able to create a drag image and drag one directory onto another. The TVN_BEGINDRAG and WM_MOUSEMOVE sections of the code work great. However, what the article doesn't cover in the WM_LBUTTONUP section is the code required actually to move the dragged directory into the selected directory (my tree view items are directories). This is the code I have in the WM_LBUTTONUP function so far:
<br />
case WM_LBUTTONUP:<br />
{<br />
if (Dragging) <br />
{<br />
ImageList_DragLeave(hTree);<br />
ImageList_EndDrag();<br />
ReleaseCapture();<br />
ShowCursor(TRUE); <br />
Dragging = FALSE;<br />
<br />
<br />
}<br />
}<br />
I have found some MFC code at http://www.codeguru.com/treeview/drag_drop.shtml that seems to do what I want, but I don't know how to convert it into non-MFC, simple Win32 API code. The section that I need to convert from MFC and insert into the above code is this:
<br />
SelectDropTarget(NULL);<br />
if( m_hitemDrag == m_hitemDrop )<br />
return;<br />
<br />
HTREEITEM htiParent = m_hitemDrop;<br />
while( (htiParent = GetParentItem( htiParent )) != NULL )<br />
{<br />
if( htiParent == m_hitemDrag ) return;<br />
}<br />
<br />
Expand( m_hitemDrop, TVE_EXPAND ) ;<br />
<br />
HTREEITEM htiNew = CopyBranch( m_hitemDrag, m_hitemDrop, TVI_LAST );<br />
DeleteItem(m_hitemDrag);<br />
SelectItem( htiNew );<br />
In particular, I have no idea what the equivalents of GetParentItem() and CopyBranch() are in Win32... Can anybody please help me convert this so that I can get drag-and-drop functionality between treeview items in my app?
Also, if anyone knows where I can find a good tutorial/example on how to drag and drop between a list view and a tree view using _no_ MFC, I would be very grateful, as that will be my next problem after sorting this out...
Any help would be much appreciated,
Many thanks,
KB
|
|
|
|
|
It sounds like you want to make your job a lot harder by not using MFC. Hopefully you have a very good reason for this.
GetParentItem() is:
_AFXCMN_INLINE HTREEITEM CTreeCtrl::GetParentItem(HTREEITEM hItem) const
{ ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)hItem); }
If you have the MFC Source it is very easy to find this out.
I can't find CopyBranch() - are you sure this isn't a function in the example program.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Kayembi wrote:
I have no idea what the equivalents of GetParentItem() and CopyBranch()
GetParentItem() --> TreeView_GetParent() macro or TVM_GETNEXTITEM with the TVGN_PARENT flag. The macro is the simpler way though.
CopyBranch() is not an MFC function. It's a function that was written for that code. You'll have to look at the source code for it to work out how to convert it.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thank you both for the replies, much appreciated.
The only reason I'm not using MFC is that as a relative coding novice, I haven't really touched it yet - I need to buy a book on it and dive in soon, I know.
Also, the rest of my program has been written without MFC, as it started off as a fairly straightforward dialog app a year or so ago. Now that I'm updating it, though, it's getting a lot more complicated, but I'm reluctant to rewrite the whole thing in MFC because of my inexperience and the amount of time this would take (re-learning how to do everything I've already coded + coding it).
Many thanks again for the help!
Cheers,
KB
|
|
|
|
|