|
Use CTreeCtrl::Expand() .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
i hav a CView derived class in which i draw Records (some data) row by row.
Now i must implement drag n drop on these rows to change their display order.
I did it, but i need a 'drag image' while dragging the rows. The 'drag image' will be the image of the row on which i started the drag.
what should i do to associate the image to the mouse..
can anyone help ???
regards,
abin
|
|
|
|
|
I get the error:-
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\wchar.h(437): error C2011: '_stat' : 'struct' type redefinition.
I have checked all my header files to see if any included more than once.
The only way I can get the program built is to comment out the following lines in this (Visual Studio wchar.h) file!
#if !__STDC__<br />
<br />
#endif /* __STDC__ */<br />
I am worried that this will cause me problems later.
Are they anything I can do to overcome this problem?
Cheers,
|
|
|
|
|
sweep123 wrote:
#if !__STDC__
the syntax is not correct...
replace with #if !defined(__STDC__)
or with #ifndef __STDC__
cheers,
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Both options produced the same error (C2011) when comments removed.
This is a Microsoft file, so should we be modifing it?
|
|
|
|
|
sweep123 wrote:
This is a Microsoft file, so should we be modifing it?
wow, absolutely not !!!
i thought it was one of your when you told you commented on... never do this !!!
however, don't you create a struct in your files that is in fact already defined in the library ? if so, change your structure identifier...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I have searched my project to ensure that no types/structures have the name stat.
None present.
Still confused, but thanks for your help.
PS Still have the Visual Studo file with my commented out section.
|
|
|
|
|
sweep123 wrote:
I have searched my project to ensure that no types/structures have the name stat.
but what about _stat as the compiler says ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
The result of the search as follows:-
Find all "_stat ", Subfolders, Find Results 1, Entire Solution, "*.*"<br />
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\wchar.h(421):struct _stat {<br />
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\wchar.h(493):_CRTIMP int __cdecl _wstat(const wchar_t *, struct _stat *);<br />
Total found: 2 Matching files: 1 Total files searched: 101
Are they any tools hidden away in Visual Studio to help wit this problem?
|
|
|
|
|
Try to use /P compile key it will produce *.i file in which you can find where is was already defined.
|
|
|
|
|
Hi guys
I have an application which reads from an Excel sheet. The application reads from the sheet properly till a specific row is reached. After that the next row is not read properly and the subsequent read returns blank data.
Please help me with suggestions...
Regards
Sreekanth Muralidharan,
Corporate Systems Consultant [Embedded Systems],
INDIA
|
|
|
|
|
i created a buffer,
how do i reduce the size of lpBuffer without losing the initial items in it.
LPBYTE lpBuffer;
lpBuffer = new BYTE[5000];
lpBuffer[0] = 'h';
lpBuffer[1] = 'i';
easiest way to make lpBuffer smaller size?!
Any help is appreciated thanks!
Mepho
|
|
|
|
|
|
|
Hello
You can try to use realloc(lpBuffer, new_size)
Andrew
|
|
|
|
|
Andrew Kirillov wrote:
You can try to use realloc(lpBuffer, new_size)
No! The original buffer was allocated with new.
|
|
|
|
|
Sloppy Joseph wrote:
No! The original buffer was allocated with new.
So ? Does not the new equal to malloc() , and delete equal to free() ?
Andrew
|
|
|
|
|
Andrew Kirillov wrote:
Does not the new equal to malloc(), and delete equal to free() ?
no, not at all !!!
new and delete are re-entring functions, while C ones (malloc, realloc, free) aren't.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Yes, you are right. I found the answer. I just was confused by a small sample using MFC - it was looking that they are the same. But they are not.
Thanx !
Andrew
|
|
|
|
|
I guess Andrew mean to use maalloc(...) then realloc(...) no "new" shoud be used in this case.
|
|
|
|
|
you could use list<> or vector<> .
otherwise, the only way is to create a new array (using new operator, the length you like), then copy the datas you want to preserve during the "resize operation", then delete the old array...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
If possible, use stack memory instead of allocating. Then you don't have to care about size.
Don't try it, just do it!
|
|
|
|
|
Why do you want to decrease the size of the buffer? You know that there are no easy ways to manipulate the size of an array! The only way to change the size of an array is to create a complete new one with the size you want and copy all the items you can from the old array..
As other users pointed out, you can use a std::vector or some other collection class.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Something like:
LPBYTE lpBuffer2 = new BYTE[1000];
memcpy(lpBuffer2, lpBuffer, 2 * sizeof(BYTE));
delete [] lpBuffer2; The other way is to not make it too big in the first place. Lastly, even if you ended up just using 2 of the 5000 bytes, that's not a big deal in the overall scheme of things.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Strange.
Declare and array of 1000 bytes, then copy 2 bytes from the old array to the new array.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|