|
Hi
Thank you very much
I am waiting for a reply.
I am going to implement your method. I will let you know it it works.
And hope to help me if I will stuck some where.
Thankx again.
Regards
Anil.
|
|
|
|
|
Hi
Thank you very much.
I am able to get the result.
Regards
Anil
|
|
|
|
|
HAI,
I am not able to put the IStream generated by me into the IDataObject.Here is the code snippet can anyone point out where i am going wrong?
IStream *lpStream = NULL;
//Put some data into IStream
LPDATAOBJECT pDO = new LPDATAOBJECT();
//FORMATETC definition
FORMATETC *fmtetc = new FORMATETC ;//= {0};
fmtetc->cfFormat = CF_TEXT;
fmtetc->dwAspect = DVASPECT_CONTENT;
fmtetc->lindex = -1;
fmtetc->tymed = TYMED_ISTREAM;
fmtetc->ptd = NULL;
//STGMEDIUM definition
STGMEDIUM *medium = new STGMEDIUM ;
medium->tymed =TYMED_ISTREAM;
medium-> pstm = lpStream;
lpStream->AddRef();
medium->pUnkForRelease = NULL;
//I get error in this line.
pDO->SetData(fmtetc,medium,TRUE);
Can anyone tell me what i should do before calling the setData()?
Thanks in advance.
Saravana Kumar
-- modified at 2:24 Monday 30th January, 2006
|
|
|
|
|
What is the size of a empty class
If the size of the class is zero what can be the problem
with the class?
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
vikas amin wrote: What is the size of a empty class
1 or (>0)
vikas amin wrote: If the size of the class is zero what can be the problem
with the class?
It cannot be zero.
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#99ccff;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Defeat is temporary but surrender is permanent
--Jesus is Lord
|
|
|
|
|
first thing...
The size of the empty class is 1 if it doesn't contains any member variables
else its size is the total bytes required for the variables in that class.
second thing...
if the class contains atleast one virtual function then its size is 2 bytes without member variables
as the object of the class contains the address of the VTABLE.
for the existance of the object the class having minimum 1 byte size.
Thanks and Regards
Laxman
FAILURE is the first step towards SUCCESS
|
|
|
|
|
Yeh i checked it IDE but the question
is why ?
For a class containing only one "char" variable the
size of the class is 1 . how???
even if the class is empty its 1 and even if it has a
character variable its one?
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
that is the trick
if class contains any variable the size of the class is the summation of bytes of member variables
and if no variables then it's size is 1 byte.
and as we know that minimum variable size is 1 byte and those for char variables.
Thanks and Regards
Laxman
FAILURE is the first step towards SUCCESS
|
|
|
|
|
|
The size of an empty class is non-zero. Otherwise, two empty classes of the same type would have the same address.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
I am a newbie in C++ and looking for your help!!
In the below 2-dimensional arrays, what are the index numbers of A, B and C?
_| 0 | 1 |
0| A | B |
1| C | h |
Is (0, 0) the index number of A?
Is (1, 0) the index number of B?
Is (0, 1) the index number of C?
If so, how can I put, let's say, the index number of A(0, 0) into a temporary variable for swapping with the "hole"(1, 1)?
Please advise?
Thanks in advance!!
|
|
|
|
|
eivanlo wrote: Is (0, 0) the index number of A?
No It's (1,1)
eivanlo wrote: Is (1, 0) the index number of B?
No It's (1,2)
eivanlo wrote: Is (0, 1) the index number of C?
No it's (2,1)
eivanlo wrote: If so, how can I put, let's say, the index number of A(0, 0) into a temporary variable for swapping with the "hole"(1, 1)?
int temp = nArray[1][1];
nArray[1][1] = nArray[2][1];
nArray[2][1] = temp;
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#99ccff;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Defeat is temporary but surrender is permanent
--Jesus is Lord
|
|
|
|
|
Thanks for your kindly replying!!
But why the index number is (1, 1) for A when the index number in C++ is starts from 0?
|
|
|
|
|
|
If the arrays is like that,
| A | B |
| C | h |
then, would the index numbers of them be that?
Is (0, 0) the index number of A?
Is (1, 0) the index number of B?
Is (0, 1) the index number of C?
|
|
|
|
|
|
Thankyou very very much!!
|
|
|
|
|
Indexes starts from 0 for arrays.
|
|
|
|
|
|
Owner drawn wrote: eivanlo wrote:Is (0, 0) the index number of A?No It's (1,1)
i didnt get this?
|
|
|
|
|
Mr.Prakash wrote: i didnt get this?
He wanted to know the position of A in the Array.
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#99ccff;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Defeat is temporary but surrender is permanent
--Jesus is Lord
|
|
|
|
|
When I am writing a puzzle game and its size can be made from 2 to 5:
e.g. the index number of h is (1, 1)
| H | G | E |
| F | h | C |
| D | B | A |
or the index number of h is (3, 3)
| D | A | K | F |
| G | I | N | J |
| B | E | H | O |
| M | L | C | h |
since the elements and the hole(h) are randomly generated, it means I dont know the exact location of the hole(h), how can I use the suggestion you gave me for swapping?
|
|
|
|
|
Yeah you are right this time. h is at (3,3)
eivanlo wrote: since the letters A to H and the hole(h) are randomly generated, it means I dont know the exact location of the hole(h), how can I use the suggestion you gave me for swapping?
You have to loop through and find out where h is?
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#99ccff;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Defeat is temporary but surrender is permanent
--Jesus is Lord
|
|
|
|
|
Again, since I dont know the size of the puzzle, how do I know the index number of the target element for swapping, at this moment I know the index number of h is (hrow, hcol)?
Am I wrong if I think this way?
e.g.
C | B
A | h
Assume the location of h at the keyboard is always on 5, then I hit 4 to swap h with A, hit 8 to swap B with h, and hit 7 to swap C with h.
For swapping A
tar_row = hrow;
tar_col = --hcol;
For swapping B
tar_row = --hrow;
tar_col = hcol;
For swapping C
tar_row = --hrow;
tar_col = --hcol;
Am I wrong?
|
|
|
|
|