|
And also is there a way to get a window rect that only gives you the coords of the actual view, i.e. ignores the title bar, status bar etc?
|
|
|
|
|
I wanted to know how would I start to write a program to use your voice to execute specipic programs on the comupter?
|
|
|
|
|
have a look at microsoft's Speech API ( SAPI ).
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
since no one is online elsewhere, here it goes
explain
int *p;
p=(int (*)[4])malloc (3*sixeof(*p))
please
|
|
|
|
|
What exactly are you wanting to know about the two statements?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
int *p;
p=(int (*)[4])malloc (3*sizeof(*p));
This code is allocating an array for
12 bytes long (3 ints = 12bytes) in memory and returns result to variable p
_________<br />
I'm made in C++... and I'm proud of it!
|
|
|
|
|
this code trully allocate array of three int elements.
int *p;
p=(int *)malloc (3*sizeof(int));
|
|
|
|
|
I can't. I'm guessing sixeof is a typo and you ment sizeof. (a forgivable mistake unless you really ment sixeof, in which case I'd need to know more about it)
the int (*)[4] part is wrong. It is tyring to tell the compiler that you have an array of 4 ints, but just allocated 3! Not that the compiler would check, it is legal C to then use p[5], though it is undefined behavior and will randomly crash your program.
Just write
int *p = malloc(3*sizeof(int));
like the rest of us would.
|
|
|
|
|
|
Hi All
I am trying to build a Debug version of Win32 DLL under Dot Net 2003 framework. I link to a Release version of Win32 DLL not using MFC built under the Visal Studio 6.0 .
I always get the above mentioned error with Unresolved external symbols.
Anyway, I can fix it.
I can build release version successfully.
Thanks
Sankar
|
|
|
|
|
Is your Release Win32 DLL in the second sentence also your code or are you using a Windows DLL? If it is your code can you recompile using the debug configuration? If you are using a Windows DLL use the analogous debug version under 2003.
Daniel
|
|
|
|
|
Hi Daniel
No, the Release DLL is supplied by one of the other vendors with which I have to integrate.
But, normally, we can build the debug version of one DLL linking with the Release version of the depending DLLs, right?
\
Thanks
Sankar
|
|
|
|
|
Sorry this is so late I have been on holiday for the last week.
Yes, you can link against release DLL's for debug versions of your code. But, you will not be able to step into the release DLL's using the debugger.
Daniel
|
|
|
|
|
In the results I recieve a pointer to void type as every1 know with bytes from memory. But they are reversed =\
How can I change it ?
I.e.:
bytes in memory: 00218040 // this is in memory
bytes in result: 00408021
I want them like they are in memory.
_________<br />
I'm made in C++... and I'm proud of it!
|
|
|
|
|
Don't know exactly how ReadProcessMemory works but you can make a casting on the result. For example, if you want to read an integer value, do something like this:
int Result = *(int*)lpResult;
lpResult is the void pointer you get from ReadProcessMemory(). The compiler will automatically handle all the work for you .
Hope this help.
|
|
|
|
|
to reverse u can use following code:
for (DWORD x=0x00408021, i=0, r=0; i<32; i+=4, r+=(((x << i) & 0xf0000000) >> (28 - i)));
|
|
|
|
|
Are you talking about big-endian vs. little endian?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Are you waiting for my reaction? I don't u'stand last solution made by 4apai. Could some1 make this with comments?
And what do u mean by big-endian and little-endian? I'm newb in C++ things, that's why I'm here.. where I can get answers for my questions
_________<br />
I'm made in C++... and I'm proud of it!
|
|
|
|
|
Micie wrote:
Are you waiting for my reaction?
Well, since I did ask for clarification, a reaction response would be nice.
Micie wrote:
I don't u'stand last solution made by 4apai. Could some1 make this with comments?
I assume the code snippet provided was to reverse the bytes of a 32-bit number. Isn't that what you requested?
Micie wrote:
And what do u mean by big-endian and little-endian?
Try these sites for a description of endianness:
http://www.webopedia.com/TERM/b/big_endian.html
http://whatis.techtarget.com/definition/0,,sid9_gci211659,00.html
http://www.netrino.com/Publications/Glossary/Endianness.html
http://support.microsoft.com/default.aspx?scid=kb;en-us;102025
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Just for the info:
He wanted:
bytes in memory: 00218040
bytes in result: 40802100
4api suggested:
to reverse u can use following code:
for (DWORD x=0x00408021, i=0, r=0; i<32; i+=4, r+=(((x << i) & 0xf0000000) >> (28 - i)));
but this will reverse the whole order, not byte by byte.
inputing 00218040, will result in 12080400 which is not what was requested
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
That's what I mean!
Thanks Papa for help - my system is working
in little-endian.
_________<br />
I'm made in C++... and I'm proud of it!
|
|
|
|
|
u'r the observant one)
i dont pretend to get the same result as he wrote. People can make mistakes. i'm too)
but he wrote: "In the results I recieve a pointer to void type as every1 know with bytes from memory. But they are reversed =\"
it was quaternion reversion...
bit-by-bit reversion has following syntaxis:
for (DWORD x=0x00408021, i=0, r=0; i<32; i++, r+=(((x << i) & 0x80000000) >> (31 - i)));
// r = 0x84010200
but it still dont get needed result. or i made some mistakes in algorythm. it'll be the hometask)
i think its not a kind a reversion.
maybe the truth is in the words of DavidCrow (about the endian).
|
|
|
|
|
Its not "bit by bit", but "byte by byte"
(try saying it 20 times )
00 40 80 21 (little end in)
would be
21 80 40 00 (big end in)
As suggested in the first post, the cast into the correct type give him the relevant result, and the compiler will handle it gladly
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
))))
4apai.
p.s.
finally code sample:
for (DWORD x=0x00408021, i=0, r=0; i<32; i+=8, r+=(((x << i) & 0xff000000) >> (24 - i)));
// r = 0x21804000
i do it!!!)
|
|
|
|
|
Gratz and thanks
Could you translate now how u done it? I don't
u'stand everything starting from
r+= ... Just do as big comment as you can.
Thanks in advance ^^
_________<br />
I'm made in C++... and I'm proud of it!
|
|
|
|