|
If it's an option, it seems to me it's easier to just intercept WM_LBUTTONDOWN notification
messages and check for the cursor being in a certain region. A simple flag to toggle can keep the
expert/novice state.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Mark Salsbery wrote: ForumVisual C++ / MFC
Subject:Re: Need to make a button (or checkbox) invisible..
Sender:Mark Salsbery
Date:13:47 16 May '07
If it's an option, it seems to me it's easier to just intercept WM_LBUTTONDOWN notification
messages and check for the cursor being in a certain region. A simple flag to toggle can keep the
expert/novice state.
Mark
Thanks Mark,
Now, how do you intercept the WM_LBUTTONDOWN notification from the main window before the control beneath will intercept and handle it? I have an ActiveX control beneath. (2D Graph ActiveX Control[^])?
If this is not possible, can I intercept the notification after the control beneath?
Thanks in advance.
-- Ricky Marek (AKA: rbid)
-- "Things are only impossible until they are not" --- Jean-Luc Picard
My articles
|
|
|
|
|
Well I didn't know there was a control beneath where you need to click
In that case you'd need to catch it at the control since that's where the click message goes.
So I guess in that case, maybe an owner-drawn control that draws nothing is a worthwile solution.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
In a non-MFC application, I would have suggested owner-drawn pushbutton, with the "in" and "out" buttons the colour of the dialog box. (Not that I ever used owner-drawn pushbuttons, but I thought about it once.)
Of course, everything is easier with MFC. . .
|
|
|
|
|
normanS wrote: ForumVisual C++ / MFC
Subject:Re: Need to make a button (or checkbox) invisible..
Sender:normanS
Date:15:44 16 May '07
with the "in" and "out" buttons the colour of the dialog box.
This is a problem for me due that I have an ActiveX control beneath (2D Graph ActiveX Control[^]) has its background changing all the time... therefore making the "invisible button" follow these changes is not easy.
The solution may be to use a "rectangle" and add some code to intercept when the user clicks on the mouse over it, and if it is in the rectangle do something otherwise call the 2D Graph ActiveX Control[^] handler for the mouse click. (But I'm not sure if this will work)
-- Ricky Marek (AKA: rbid)
-- "Things are only impossible until they are not" --- Jean-Luc Picard
My articles
|
|
|
|
|
Ah - maybe you could make owner-drawn buttons with the IN and OUT transparent?
In any case, I would guess that checking for mouse clicks in a certain area would actually be easier than making an owner-drawn button.
I don't think that there should be a problem intercepting mouse clicks in the message handler and checking if they are within your defined rectangle. If they are, do something. If not, I don't think you have to explicitly call the 2D graph handler - just let Windows handle them using the DEFAULT.
|
|
|
|
|
OK, now that I've clicked on your "My articles" link, I guess I'm not qualified to advise you on the use of owner-drawn buttons! Good thing I said my knowledge was based on having thought about using them.
Maybe I should read your article to see how to make them work . . .
|
|
|
|
|
Hi,
I have a function for comaring.
int DataPeakCompareFunc(const void *el1, const void *el2)
{
const DataPeak *peak1 = reinterpret_cast(el1);
const DataPeak *peak2 = reinterpret_cast(el2);
if (peak1->position < peak2->position)
{
return -1;
}
else if (peak2->position < peak1->position)
{
return 1;
}
return 0;
}
this is my qsort function
int (FConvert::OConvevw::*pt2Function) (const void*, const void*) = NULL;
pt2Function = &FConvert::OConvevw::DataPeakCompareFunc;
qsort((void*)pScan, num_readings, sizeof(DataPeak),pt2Function);
But i am getting this error
Error 206 error C2665: 'qsort' : none of the 2 overloads could convert all the argument types d:\cougar_io_development\cougar\core\libraries\cplusplus\dlls\fconvert\OConvevw.h 789
both are residing in oconvevw.h file only.
What to do?
Thanks in advance.
Regards, Eswari
|
|
|
|
|
may be this is the wrong forum to ask.. But i could not see any C++ category.
That's why i posted here
|
|
|
|
|
At least one of the parameters you are passing to qsort() is the wrong type.
I suspect the last parameter. The compare function should have the following prototype:
int (__cdecl *compare )(const void *, const void *)
but you are passing a
int (FConvert::OConvevw::*compare)(const void*, const void*)
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Is DataPeakCompareFunc() a static or non-member function?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
member function defined in the same class where qsort is being called
|
|
|
|
|
subramanyeswari wrote: member function defined in the same class where qsort is being called
Thus it needs to be a static member.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Don't use qsort ; it's outdated. Use STL.
e.g.
inline bool operator<(const DataPeak &l, const DataPeak &r)
{
return l.position < r.position;
}
std::sort(container.begin(), container.end());
std::sort is in <algorithm>
Steve
|
|
|
|
|
Hello,
I have an int array
int a[10].
The array will have only 3 to 4 values in the it.
so how do I check for NULL values in the array
because I cannot check
a[i]!=0 since I want 0 as a value
Thanks
Prithaa
|
|
|
|
|
Not sure I understand your problem, but the simplest thing to do is to initialize your array to zeros before you even use it. But why use an array of size 10 when a size of 4 would suit your needs??
John P.
|
|
|
|
|
ints are just integer values. If you need to indicate an uninitialized int then you'll need to
set aside one number to represent an invalid value.
What are the valid range of values for your arry members? Pick a number outside that range
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Alternatively, you can use int pointers instead of array. This way you can check if the value is NULL
|
|
|
|
|
or an array of int pointers.
|
|
|
|
|
To make sure, use an array of int pointer pointers, each member pointing to the corresponding
member in the int pointer array, whose members point to the actual ints!
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Sure that'll work.
Another alternative - make a "smart int" class, wrapping an int with some flag indicating
its initialized status Then you wouldn't need the added indirection of a pointer.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
A dynamic array as std::vector<int> doesn't fit your needs?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
You need to use a different value and initialize the array to that. Since you want to allow 0 to be placed in the array then use -1 to initialize it. That is fill the array with -1 and check for that. If that is not an option, and there is no other value you can use, then you have a real problem.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hi Guys,
I am developing an Encrypted VoIP application for PocketPC(Windows Mobile 5.0). The VoIP part is ready and I am looking for a AES encryption algorithm to encrypt/decrypt my RTP Payload/Packets for PocketPC Windows Mobile5.0.
Anybody knows of such an implementation ?
Thanks in advance,
Best Regards,
Gaurav
|
|
|
|
|
Just google for source code for AES if you want to roll your own. However, I believe the built-in MS crypto providers have a certified implementation of AES. I can't double check now, since I'm not at work, but I know I used the built-in AES for a previous customer who was rather anal about certified algorithms. That was XP however. It's been too long since I worked on the Mobile Windows variants to know if the full crypto is supported in those OSes. Worth checking before writing your own.
Judy
|
|
|
|