|
Do you need to write it in C ? If not, try using the string class. In any case, never use realloc. Use delete and new, only, in C++. I am not sure if reallocating the memory, doesn't stomp the old values.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
i am trying to find out which column and row i hit, when i made a doubleclick on a cctrllist.
To get the row is no problem, i simply make a hit test with the coordinates of the message source.
DWORD dw = GetMessagePos();
CPoint p(GET_X_LPARAM(dw), GET_Y_LPARAM(dw));
list.ScreenToClient(&p);
int row = list.HitTest(p);
int col = ????
thanks
|
|
|
|
|
Hi,
Use CListCtrl::SubItemHitTest instead. This returns both the item and sub-item as well.
Kiran
|
|
|
|
|
How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
|
|
|
|
|
typedef is your friend when dealing with complex types:
typedef char* (*func1)();
typedef func1 (*func2)();
func2 myarray[N];
|
|
|
|
|
int test = 1 + 2 + 3;
+2 + 3 +4;
after I compile with Visual studio 6 or .net
the answer test is 6
Is there anyone know what is weird ? the compiler will not have any error message, is this kind of bug ?
Thanks for advance.
coding is just the beginning
|
|
|
|
|
Of course
int test = 1 + 2 + 3;
equals 6.
+2 + 3 +4;
is a seperate expression. Remove the first semicolon if you want to connect the two expressions.
int test = 1 + 2 + 3 +2 + 3 +4;
will result in test == 15.
|
|
|
|
|
Sofian Teja wrote: int test = 1 + 2 + 3;
Evaluates to 6 (according to Adam Riese).
Sofian Teja wrote: +2 + 3 +4;
Is an empty expression (it does nothing), always switch on your compiler warnings and you will be notified when such things happen accidentally. Related articles: Getting pragmatic with warnings, here and here.
Hope it helps.
|
|
|
|
|
Any expression can also be a statement. The statement
+2 + 3 +4;
is perfectly legal. It calculates the value and does nothing with it. (Of course, in optimized builds, the statement will be removed since it does nothing and has no side effects.)
|
|
|
|
|
hi to all!
would like to ask..
can priority be implemented using linked list?
if yes, can you please show me how?
thanks a lot!
newbie
|
|
|
|
|
Yea It can be.
The main logic change will be while "Inserting" a new item.
While Inserting a new "Item" of say "n" priority you have to check that it should be inserted at last item of the same priority but before a low priority item.
Manoj
Never Give up
|
|
|
|
|
hi manojkumarrai! thanks for the reply...
for the implementation... should i have pointer to the last item for each priority category?
thanks!
newbie
|
|
|
|
|
|
Hi all,
Can anybody plz tell me how to use GetExitCodeThread Function.
my thread object is CloseTh.I am not getting how to pass second parameter.
DWORD lpExitCode;
GetExitCodeThread(CloseTh->m_hThread,lpExitCode);
when i write this,this error is coming
cannot convert parameter 2 from 'unsigned long' to 'unsigned long *'
thanks in advance
|
|
|
|
|
DWORD lpExitCode=0;
GetExitCodeThread(CloseTh->m_hThread,&lpExitCode);
|
|
|
|
|
Whitesky was quick to answer.
neha.agarwal27 wrote: DWORD lpExitCode;
Do make a habit to initialize the variables.
Regards,
Vijay.
God may not give us what we 'want', but he surely gives us what we 'need'.
|
|
|
|
|
Read the error message. The function takes a pointer to an unsigned long but you are passing an unsigned long . (DWORD is a typedef that resolves to unsigned long .) You need to pass the address of that DWORD variable. Fixing the Hungarian prefix would be nice too.
|
|
|
|
|
how to create IPAddress control with the style IPAS_NOVALIDATE
|
|
|
|
|
|
I can't find IPAS_NOVALIDATE defined in any of my platform SDK/MSDN files.
What is it?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I am playing movie in directshow . now I want to fastforward the movie
2x 3x 4x etc . also I want to rewind the movie. can any body tell me
how it is possible
RajeshGupta
|
|
|
|
|
On the MCI functions you can use of MCI_DGV_SET_SPEED see MCI_SET[^]
|
|
|
|
|
I want to fastforward and rewind in localfile scenario . i .e
I am using the .asf or .wmv file .
RajeshGupta
|
|
|
|
|
|
Hi,
I know that but problem is that when I set g_pSeek->SetRate(2.0);
it fast forward for few milli seconds then again playback with
normal speed . again tell me how to rewind the playback.
RajeshGupta
|
|
|
|