|
in your structure, why don't you just replace BYTE* by HBITMAP* ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
someone created that structure for me. later on, each image will be passed into memcmp (memory compare), along with a gui bitmap, to see whether the bitmap exists.
will this still work with HBITMAP?
|
|
|
|
|
I have some problems handling two print buffers of the printer's native resolution (720 dpi).
I can do one m_hBitmap=CreateCompatibleBitmap(pDC->m_hDC,5784,7938), but the second buffer returns me a NULL handle...
How can I increase the heap memory buffer ? The GDI object's memory seems very thigh. Can the HeapCreate function solve the issue ? Just a quick note, the PC features 1.5 GB of RAM, and currently only 300 MB is used. So it's not a memory problem...
Kochise
In Code we trust !
|
|
|
|
|
can anyone give me the programme to make telephone dictionary in c++
|
|
|
|
|
std::map<std::string, std::string>
where the first string could be the name and the second one the phone number...
if you're not satisfied, please be more specific in your question !!!!!
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
try std::map or std::multimap.
|
|
|
|
|
Anonymous wrote:
can anyone give me the programme to make telephone dictionary in c++
Try Google.....
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hi!
ive got a problem developing an avi source filter!
the problem is that i need to read the file from disk while the file is playing in directshow! the other way is the example that shows directshow in its sample file source that comes with the sdk, but it is too slow, because it reads the full avi file in ram in the load function (from the ifilesourcefilter interface) before getting connected to the avi splitter and so on it wastes too much time! ive read that it is possible not to read the whole file and get connected succesfully to the avi splitter faking the contents of the memory buffer and reading from the file only the riff header, the avimainheader structure and the idx1 structure, but i dont know if its really true!if you please wonna confirm me the parts of the file and the structures to do it that are needed to make the avi splitter get connected i will apreciate it a lot, cause im getting frustrated with this and it doesnt go on!
thanks a lot!
villalvilla
|
|
|
|
|
how do we copy data from a buffer to a structure
|
|
|
|
|
you can use bitwise operators (>>, &, |, <<) to copy certain bytes from a buffer to the corresponding field in the structure.
Er zit een korstje op mijn aars.
|
|
|
|
|
Or memcpy(&struct, buffer, sizeof(struct));
|
|
|
|
|
That's a solution but you'll need to be sure that the data in the buffer has the same format as your structure. What I mean is that in your structure, the members will be aligned on a 8 bytes boundary (but you can change that). So, if it is not the case in your buffer, you will have some problems.
|
|
|
|
|
Alignment can be adjusted and by default uses natual alignment up to 8 byte PODs. VC doesn't use 8 byte alignment.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Tim Smith wrote:
Alignment can be adjusted and by default uses natual alignment up to 8 byte PODs
Yes, that's what I said .
Tim Smith wrote:
VC doesn't use 8 byte alignment
Err, pretty sure that it does. I had a bug two years ago because of that (loading data from a file and memcpy it to a struct) and I spent a lot of time to solve it. And it was because of the member struct alignement that was to 8 by default.
|
|
|
|
|
actually the thing isthat we have stored data in a buffer.....now we declared an aaray of a structure to copy that data.abb i dont know that how do we specify no of bytes using bitwize operator.
|
|
|
|
|
you cannot copy a whole group of varialbes into a structure, except at its initialization.
the rest of the time, you'll have to point each member of the structure to affect it...
this is because generally, the members of a structure may be by side, but not necessarily...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Try being more specific. How is the buffer declared? What's its content? In what format? How is the structure declared?
Withouth such details, the answer can only be as vague as your question:
Q: how do we copy data from a buffer to a structure?
A: you extract pieces of data from the buffer and put them into the appropriate fields of the structure.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
i have read a log file through buffer.it tells us that how many calls are in the log file!now wat i have to do is that i have to copy the certain bytes of each call in a structure. lets suppose 364 bytes i have to copy of each call!
|
|
|
|
|
now tell me how do we extract peices of data from buffer?
|
|
|
|
|
see this[^] posted on the forum yesterday...
it's quite similar as you extract datas from a buffer...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
we have character data in our main buffer and also we need to pack two bytes of data from our main buffer into 1 byte of data in our small buffer.how we'll do this
|
|
|
|
|
hey hey hey,
please calm down, otherwise, noboody will help you...
moreover, you question is far from being clean... what are those buffers ? i've understood you had only one, and now, you talk of two buffers !
i think the best way to make us understand is to provide so little schemas (into <pre></pre> tags) and some code...
explicit also you question clearly, with what you have, what you want, what don't work and what error messages are sent.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
actually i'm in office.....n m tensed as well...oki let me explain again that i've read a file and stored its data in buffer righttt! now i have to copy some specific bytes from that buffer to a structure.the thing is that the data in my file is stored in characters.means there is one character at each index.and i have to pick two characters at a time and store it in a structure....right now plzz tell me how we'l do this.......
|
|
|
|
|
If you could post your structure, this would help a little bit more. You have to understand that we cannot see what's on your screen so we have to guess what you want to do with the little clues you gave us.
Ok, in which 'format' you want to store this two characters ? Is it an integer or a string ?
If it is a string, you can simply do that:
struct.MyString[0] = Buffer[Index];<br />
struct.MyString[1] = Buffer[Index+1];
If it is an integer, you could do that:
char Temp[3];<br />
Temp[0] = Buffer[Index];<br />
Temp[1] = Buffer[Index+1];<br />
Temp[2] = '\0';<br />
struct.MyInt = atoi(Temp);
If it doesn't help, try to be more specific and POST CODE !!
|
|
|
|
|
Nadia,
Could you please provide us your structure prototype?.
And I also intersteded in your buffer data?. How they are categorised/delimited from each item?
What do you mean by big buffer and small buffer ?
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|