At the moment I know only two reasons for denied permissions when trying to write to HKCU:
Using RegOpenKeyEx(), the key was not opened with the KEY_SET_VALUE or KEY_WRITE access right.
Using RegOpenKey() instead of RegOpenKeyEx().
Regarding the second reason I will cite the MSDN:
The RegOpenKey function uses the default security access mask to open a key. If opening the key requires a different access right, the function fails, returning ERROR_ACCESS_DENIED. An application should use the RegOpenKeyEx function to specify an access mask in this situation.
If this does not solve your problem, you should show us the code that fails (including the RegOpenKeyEx() call).
Sir i have an base class which has an pure virtual member function..i have made it and also made other member function. now this is a general base class.i want that member member functions in derived class by their virtual function in which i can get the member function of base class and can do individual operation in each derived class.. what will be the syntax code for this problem how i can do these things? please reply my soon because this is my last day of assignment.. please
You will get a EN_KILLFOCUS message,when the focus switch from CIPAddressCtrl to another control, and this is normal case. But when you click at the dots among four ip fields,
you will get the EN_KILLFOCUS message too(with SPY++), which is not what I want, because I just want to do data validation when
the CIPAddressCtrl lost focus. How can I filer the EN_KILLFOCUS message when I click the dots???
Not sure if this will work or not, but in the message handler for EN_KILLFOCUS, check where the focus "went" with GetFocus[^] or CWnd::GetFocus[^] (whichever suits you best) and determine if the newly focused control is still "inside" the IP address control. I suspect it has four separate edit fields for each segment and all four have the IP address control thing set as its parent, so i supose a GetParent[^] or CWnd::GetParent[^] call can tell you if the user is still editing the IP address or is trying to leave the control altogether.
If you try this, do share with us if it worked or not, thanks in advance.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
Thanks for your reply. Yes, you are correct and we dont even have audio. I already have a way to save videos, but when saving longer videos, I am facing issues such as file index corruption etc and these longer videos are very important for us as they are research data.
I am looking for a new better way tos ave videos without any problems.
Would AVIFileWriteData do the trick?
"The AVIFileWriteData function writes supplementary data (other than normal header, format, and stream data) to the file."
I hope you are well aware that there are at least three Win32 API for working on audio / video files.
The "AVI", "capAVI" and "wave".
I am curently using capAVI and recomend always to use whatever standard status/ error reporting API's are avaiable in the particular set.
Try to Google "ffmpeg" this library helps you to write avi files with very little hassle. You can even choose coded or write uncompressed files using their example code included in the library download.
I'm trying to copy some C code to a C++ class and I've got stuck with a function pointer issue. I've been trying to mess around with calling conventions but I don't want to make my C++ function static and don't want to change the old C code. Thanks for looking.
int theFunction(int theParam1);
typedef int (*funcPtr) (int Param1);
int theClass::theFunction(int theParam1)
int function(int theParam1)
bool globFunction (funcPtr aFunction, bool someOtherArg)
int anArg = 0;
int ret = aFunction(anArg);
globFunction (function, false);
globFunction (&theClass::theFunction, true); // error C2440: 'type cast' : cannot convert from 'int (__thiscall theClass::* )(int)' to 'funcPtr'return0;
If I remember correctly, you can't declare a pointer to a non-static member function in native C++. If you need to keep the original functions as they are, I would add a static helper function which gets the class object pointer as additional parameter and calls the member function. Something like that:
/*static*/int theClass::theFunctionCaller(theClass * obj, int theParam1)
if (obj != NULL)
bool globFunction (theClass * obj, funcPtr aFunction)
int anArg = 0;
int ret = aFunction(obj, anArg);
globFunction (this, &theClass::theFunctionCaller, true);
If you need the globFunction() for different classes, you could pass the obj as void * and cast it back in the helper function, because you know which class it is for at that point.
Cheers.. I'm having a play with this but you've modified globFunction, which in my case I'm really trying to avoid. Also it wont build as it stands (you can't call non static functions from a static function).
error C2352: 'theClass::theFunction' : illegal call of non-static member function
Last Visit: 31-Dec-99 19:00 Last Update: 8-Dec-22 7:09