|
I think you can ignore the question 1 when you import cur into resouce,then you can try run it.
|
|
|
|
|
Off memory, VS6 doesn't handle deep colour depth very well. You can get around this by making a cursor it can handle, then replacing the cursor file in the res directory with your shiny new one. Just don;t try editing it...
And yes, if you do LoadCursorFromFile, it will do what the function says. Disc caching should help a lot though.
But what's wrong with storing a HCURSOR somewhere, and using that, rather than loading it afresh each time?
Iain.
|
|
|
|
|
Perfect answer, thanxxxxxxxxxxxxxxxxxxxxx very much.
|
|
|
|
|
Hello, is it possible to somehow use directives that start with a "#" when declaring a #define?
What i want to do is this:
#define ENABLE_DEBUGGING #include "my_header_with_overloaded_new_and_delete.h"
so i can begin each file with that macro that includes that header, and on platforms that does not support that header's functions, that macro would be defined as nothing.
If i try to compile the line above, i get alot of errors, example:
error C2017: illegal escape sequence
error C2121: '#' : invalid character : possibly the result of a macro expansion
So i guess the define gets confused by the # of the #include.
I know there are other ways to do this, by just #ifdef the include in each file. Example:
#ifdef DEBUGGING
#include "my_header_with_overloaded_new_and_delete.h"
#endif
But i want to keep it to one line if possible. Is there anyway to use # directives in #define's?
Thanks in advance.
|
|
|
|
|
No
|
|
|
|
|
As workaround, you can put the
#ifdef DEBUGGING
guard inside your "my_header_with_overloaded_new_and_delete.h" and always include it.
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.
[my articles]
|
|
|
|
|
clever guy
A Chinese VC++ programmer
|
|
|
|
|
Well, another beginner issue from me.
I want to serialize several structs to a char array.
In the end, the char* should point to smth like this: <b1><b2>
Finnaly, i want to de-serialize the B2 from this array to a new B2_dupe;
The problem: with my code, B2_dupe is not filled correctly.
If you dont mind, please have a look at the following code-
<br />
#pragma pack(1)<br />
struct A<br />
{<br />
A(){<br />
Sig1 = 'A';<br />
Sig2 = 'B';<br />
Sig3 = 'C';<br />
Version = '1';<br />
Numbers = 2;<br />
Reserved = 0;<br />
Offset = 0;<br />
}<br />
char Sig1;<br />
char Sig2;<br />
char Sig3;<br />
char Version;<br />
char Numbers:7;<br />
char Reserved:1;<br />
unsigned long Offset; <br />
};<br />
<br />
struct B<br />
{<br />
B(){<br />
Id=0;<br />
Reserved=0;<br />
Offset=0;}<br />
char Id:7;<br />
char Reserved:1;<br />
long Offset;<br />
};<br />
<br />
#pragma pack()<br />
<br />
int sizeA = sizeof A;<br />
int sizeB = sizeof B;<br />
<br />
A a;<br />
a.Sig1 = 'D';<br />
<br />
B b1;<br />
b1.Id = 0;<br />
b1.Offset = 0;<br />
<br />
B b2;<br />
b2.Id = 1;<br />
b2.Offset = 0;<br />
<br />
int nSizeSer = (2*sizeB)+sizeA;<br />
char* pBuff = new char[nSizeSer];<br />
memcpy(pBuff, &a, sizeA);<br />
memcpy(pBuff+sizeA, &b1, sizeB);<br />
memcpy(pBuff+sizeB, &b2, sizeB);<br />
<br />
B b2_dupe;<br />
int offset = sizeA+sizeB;<br />
pBuff+=offset;
memcpy(&b2_dupe,pBuff,sizeB);<br />
<br />
I checked b2_dupe.Offset and this should be zero ... but it isnt (-842150451).
Why is that?
Thanks in advance
|
|
|
|
|
The line
_NielsB wrote: memcpy(pBuff+sizeB, &b2, sizeB);
should be:
memcpy(pBuff+sizeA+sizeB, &b2, sizeB);
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.
[my articles]
|
|
|
|
|
Ah ... thank you again
|
|
|
|
|
Hello everyone,
Just two terminology questions which I have not found answer from MSDN. I am using Windows Server 2003.
1. Page File (PF) Curve
I think Page File is system page swap file (persistent storage to store page-out pages by a page stealer). Is that correct?
If yes, I do not know why this parameter is so important and displayed in central together with CPU surve. I think physical memory consumed and available is more important to analyze performance, right?
How do you use the page file parameter to analyze performance and how it impacts performance in your experience?
2. What are the differences between System Cache and Kernel memory?
thanks in advance,
George
|
|
|
|
|
See <a href="http://www.answers.com/topic/kernel-space?cat=technology">kernel space </a>[<a href="http://www.answers.com/topic/kernel-space?cat=technology" target="_blank" title="New Window">^</a>] it has other links kernel, user space and virtual memory(Maybe they will be new questions )
Do you want to set virtual memory?
|
|
|
|
|
Thanks Hamid,
I have not found any information from the links you recommended describing the differences between System Cache and Kernel memory, which is my original question.
regards,
George
|
|
|
|
|
It doesnt about different,it was for information .
|
|
|
|
|
Thanks Hamid,
I mean what is the different meaning between System Cache and Kernel memory? What belongs to System Cache in memory and what belongs to Kernel memory?
regards,
George
|
|
|
|
|
Did you use of server that you want to set System catche
|
|
|
|
|
Thanks Hamid,
My question is answered. System Cache is something for application purpose, Kernel memory is for kernel internal usage.
regards,
George
|
|
|
|
|
Good
|
|
|
|
|
Thanks Hamid,
I appreciate your patience help.
regards,
George
|
|
|
|
|
Thank you,
Do you live in china?
|
|
|
|
|
Hello everyone,
I heard some points that the memory allocated by new does not belongs to virtual memory, and onlymemory allocated by VirtualAlloc belongs to virtual memory.
1.
I think this statement is not correct. Since all memory touched by current process belongs to virtual memory (either reserved or committed). No matter how (through which API) developer is using.
2.
And new always utilize VirtualAlloc in underlying internal implementation code, so new (in implementation point of view) will consume virtual memory -- the same as what VirtualAlloc does.
Are my points (1) and (2) correct?
thanks in advance,
George
|
|
|
|
|
All of the application's memory belongs to virtual one.
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.
[my articles]
|
|
|
|
|
Thanks CPallini,
1.
So, I think you mean the memory either allocated by new or allocated by VirtualAlloc should be counted as part of the virtual memory in the Perfmon virtual bytes counter, right?
2.
I think new is always implemented through HeapAlloc, and do you think HeapAlloc is implemented using VirtualAlloc?
3.
If so, then new is implemented through VirtualAlloc?
regards,
George
|
|
|
|
|
Delve into the Microsoft VC++ runtime library, you'll find that new operator is implemented in terms of VirtualAlloc .
A Chinese VC++ programmer
|
|
|
|
|
Thanks zengkun100!
So, both the memory allocated by new and VirtualAlloc should be counted as a part of virtual memory counter of Perfmon, right?
regards,
George
|
|
|
|