|
ON_CONTROL_RANGE try this. I hope it will solve the problem
|
|
|
|
|
What happens if you use ON_NOTIFY for only one of the controls?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thanks you for your help!
I don't want to use ON_NOTIFY because there are many controls and this will cause many ON_NOTIFY macro.
I try with ON_CONTROL_RANGE and it work fine. But I am still not clear the difference between ON_NOTIFY_RANGE and ON_CONTROL_RANGE...
Once again, thank you.
|
|
|
|
|
TPN wrote: I don't want to use ON_NOTIFY because there are many controls and this will cause many ON_NOTIFY macro.
I know, my point was that if something doesn't work you should revert to the easiest way to test that you've got the concept down correctly.
You thought there was something wrong with your use of the ON_NOTIFY_RANGE mechanism, but if you would have tried with the simpler ON_NOTIFY you would have found that it won't get called since the control sends a WM_COMMAND notification and not a WM_NOTIFY notification.
TPN wrote: I try with ON_CONTROL_RANGE and it work fine. But I am still not clear the difference between ON_NOTIFY_RANGE and ON_CONTROL_RANGE...
The difference is that it handles two separate windows messages: WM_COMMAND and WM_NOTIFY .
For actions that send WM_COMMAND notifications you have to use ON_CONROL_RANGE .
WM_NOTIFY was introduced with Win32 API to send notification messages that requires more information and the message handler receives a pointer to a NMHDR struct with control specific data. WM_NOTIFY didn't exist in Win3.x API.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
To further clarify Roger's point - the "older" Windows controls, meaning the ones available in 16-bit Windows like Button, Edit, Static, ComboBox, ListBox, etc. all use WM_COMMAND for their notification messages.
The "new" 32-bit common controls, such as the ListView, TreeView, Progress Bar, Slider, Rich Edit, etc. all use WM_NOTIFY for their notification messages.
If using MFC, the easiest way to tell the difference is that the older control's wrapper classes do not end with Ctrl and the newer ones do. For example, the MFC class for the (older) Button is CButton and the class for an (older) Edit is CEdit , while the class for a (newer) Rich Edit is CRichEditCtrl and the class for the (newer) TreeView is CTreeCtrl . So if your control's wrapper class ends with Ctrl , use the WM_NOTIFY -based handlers.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
James R. Twine wrote: So if your control's wrapper class ends with Ctrl, use the WM_NOTIFY -based handlers.
Good point James.
Hi 5 for that.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Danka!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I'm looking to enable writing data on CD/DVD in my App.
If anyone encounter whit this before and could point the way please help!
Thanks in advance.
|
|
|
|
|
See this[^] article its about Pdf but it has Nero SDK
|
|
|
|
|
Check out IMAPI from MS (XP and later). You can find it here[^]
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Thx, I checked it out, but I can't find SDK for downloading it!
I need IMAPIv1 because I'm running on XP! I'm also wondering is it possible to copy data on DVD? According to msdn it is not possible to do so, only using IMAPIv2 which requires Vista???
If anybody knows solution for this (not using Nero SDK or similarly) please let me know how.
Thanks to all
|
|
|
|
|
I think it's in the platform SDK.
But you are correct, version 1 can't burn DVD.
I don't know of any other alternatives.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Do you mean the February 2003 version (which is a latest windows SDK that supports Visual Studio 6.0?)or you mean new Windows SDK (Date Published: 8/24/2006, combining of the Platform SDK, .NET Framework SDK, and WinFX SDKs)?
Or could you post link, please.
THX!!!
|
|
|
|
|
Hi all
I am currently using VC++ 6.0 and Crystal Reports 8.5. I have placed a Crystal Report Viewer in my dialog box, i dont understand how to populate it with a report at run time. I tried finding the features this tool offers but was not able to find any solution to my problem.
I kindly request anyone of you to provide me the information to make it happen.
Thank you very much
Kind Regards
Sandy
|
|
|
|
|
I am facing a problem in copying file in C:\windows\fonts folder in vista computer. my application is properly working on other machine but in vista i dont receive any error message but my file is not copying.can anyone give me solution y it is so
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Shilpi Boosar wrote: copying file in C:\windows\fonts
How are you copying the file to the destination?
Shilpi Boosar wrote: my application is properly working on other machine but in vista i dont receive any error message but my file is not copying
Did you try and check by debugging what is happening behind your code? If not, please try it out.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
yes i debug it properly and i dont find any exception in opening and writing a file. and it will properly working on Common folder in vista like C:\
but not in C:\windows\fonts.
i import ttf file using resource and just copy and paste that file to fonts folder.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Try to login in Pure Admin user and then see. I hope it will work definitely.
Try it.
|
|
|
|
|
I have full rights but it is not working
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
|
Hi,
I have the following function
int DataPeakCompareFunc(const void *el1, const void *el2)
{
const DataPeak *peak1 = reinterpret_cast<const datapeak="" *="">(el1);
const DataPeak *peak2 = reinterpret_cast<const datapeak="" *="">(el2);
if (peak1->position < peak2->position)
{
return -1;
}
else if (peak2->position < peak1->position)
{
return 1;
}
return 0;
}
I am calling qsort function with the below parameters
qsort((void *)pScan, num_readings, sizeof(DataPeak), DataPeakCompareFunc);
Then i am getting the above error.
What to do?
Thanks in advance
|
|
|
|
|
subramanyeswari wrote: qsort((void *)pScan, num_readings, sizeof(DataPeak), DataPeakCompareFunc);
qsort((void *)pScan, num_readings, sizeof(DataPeak), <code>&</code>DataPeakCompareFunc);
Remember that this function should not be member function. Either it should be static or a global function.
Lookup qsort . Here is the callback function signature.
int (__cdecl *compare )(const void *elem1, const void *elem2 ) BTW why are you posting the whole error as caption for your post. Looks odd.
|
|
|
|
|
|
I swear I already answered this. I'll repeat:
Don't use qsort : it's crap, old, not type safe, etc....
Use STL instead. Here's an example:
#include "stdafx.h"
#include <algorithm>
class CData
{
public:
CData(int val) : m_val(val) {}
friend bool operator<(const CData &l, const CData &r)
{
return l.m_val < r.m_val;
}
private:
int m_val;
};
int main(int arvc, char* argv[])
{
CData SortMe[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
CData *pOnePastEnd = SortMe + sizeof(SortMe)/sizeof(SortMe[0]);
std::sort(SortMe, pOnePastEnd);
return 0;
}
Steve
|
|
|
|
|
Stephen Hewitt wrote: Don't use qsort: not type safe, etc....
What do you mean by type safe? We are ones who's using it and we know what types we are passing to it. So how can you say it's not type safe.
Stephen Hewitt wrote: old,
Old is gold.
Stephen Hewitt wrote: it's crap
No it's not.
|
|
|
|