|
How can one read a single bit from a file? Any ideas?
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Can't you just read one byte, and then test the relevant bit of that byte?
|
|
|
|
|
yea, that's what I'll have to do.
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Hi!
I have written a custom messagebox class which is based on CDialog . When I want to call it I have to create a variable of the class type and then call the CDialog::DoModal() function like this:
CMyMsgBox myMsgBox(strTitle, strMsg, MB_YESNO | MB_ICONQUESTION;
myMsgBox.DoModal();
How must I write a static function that I can then call and do the same thing in one line call?
For example:
CMyMsgBox(strTitle, strMsg, MB_YESNO | MB_ICONQUESTION;
Thanks
|
|
|
|
|
no need to call a static variable, just create a global free function ( or part of a namespace )
for example :
::MyMessageBox( ... );
int MyMessageBox(...)
{
CMyMsgBox myMsgBox(strTitle, strMsg, MB_YESNO | MB_ICONQUESTION;
return myMsgBox.DoModal();
}
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Thanks that works now but what is a reason for such functions to be declared static? Is that more efficient? Can I declare it static?
|
|
|
|
|
Hi,
i want to code something like this: on my hard drive is a file. and in my windows explorer i have a virtual drive which can be used like any other drive too, but it is using the file on my hard drive to read and save data on it. i want to do that because i can write some encryption code on the read and write functions to make my data protected.
I dont think that there is freeware out there doing exactly that. So i need a hint on how to get started with writing a driver for winXP which gives me a new virtual drive. I know that this must work because "Daemon-Tools" also make virtual CD-ROM-Drives.
Hope for any tutorials. thx
|
|
|
|
|
hello,
after i used DebugActiveProcess how can i have the handle of the thread who caused a debugging event? I am lost
Thank you!
|
|
|
|
|
It is in DEBUG_EVENT_HEADER.dwThreadId, which is passed into WaitForDebugEvent()
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
dwThreadId is a DWORD value. Is it possible to convert DWORD to HANDLE?
|
|
|
|
|
You can get a handle to the thread on the CREATE_THREAD_DEBUG_EVENT event - the DEBUG_CREATE_THREAD_DEBUG_INFO structure's .Handle member.
Then create a collection keyed by dwThreadId and look up the handle using that?
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
ok
This works fine:
case CREATE_PROCESS_DEBUG_EVENT:
myHandle=DebugEv.u.CreateProcessInfo.hThread;
strangely not this
case CREATE_THREAD_DEBUG_EVENT:
myHandle=DebugEv.u.CreateThread.hThread;
Am i doing something wrong?
|
|
|
|
|
|
Hi All,
I want to capture all the registry data for any application. How can I find out the location in the registry where an application stores its information?
One way is finding out the node in registry under HEY_CURRENT_USER with node name equal to application name. But here its not guaranteed that all application would store the information in a node with the same name as application name.
For instance for an application with name "Adobe Reader 6.0" stores the information is under a node with name "Adobe Reader". Though both texts are very similar they do not match exactly. They may be very different also. So how do I go about it?
Any idea?
Also few applications store their information in some files. For Instance Quark Express. I want to capture all such files also.
Any suggestion?
Thanks,
Vaibhav Sanghavi.
|
|
|
|
|
that's a hard one.
Every application can pretty much do what they want when it comes to application settings.
Those can be stored in the registry ( HKEY_CURRENT_USER\Software is the common place, and other unsafe places ), in a file ( about anywhere the disk, )
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
|
Hello,
can somone tell me if it's possible to alter the windows explorer
(via namespace extensions i guess) to only show the files and subfolders
inside a folder, which I want it to display.
If for example I change into directory C:\Winnt, the windows explorer
should only display the system32 folder and the .bmp files.
All the other files have to be hidden.
I have read that IShellFolder::EnumObjects() is used to enumerate the files
and subfolders of a folder.
But what do I have to do to tell windows explorer which of these
files and subfolders I would actually like to display,
and which I want to be hidden.
Thanks in advance and sorry for my bad english.
Edward
|
|
|
|
|
I have a feature I want to add to my application's dialogs. Trouble is that I have some ordinary CDialog s as well as some CPropertySheet -based ones. As you'll know, both inherit from CWnd...
The feature I want to add modifies the behavior of a window but I cannot create a CMyWnd class and have CDialog and CPropertySheet inherit from those can I? All I can do is move the modified behavior into specializations of CDialog and CPropertySheet so that I have CMyDialog and CMyPropertySheet . Obvious problem with this is that I have repetition of code in two separate but closely related classes.
Can anyone suggest a way around this?
|
|
|
|
|
It may be possible to use multiple inheritance for your problem.
Construct a class that does the window modification work. e.g. CWindowModify
Then for the CDialog derived class and the CPropertySheet derived class inherit the CWindowModify class also.
e.g.
class CMyDialog : public CDialog, public CWindowModify
{
:
:
}
and
class CMyPropertySheet : public CPropertySheet, public CWindowModify
{
:
:
}
That way you only need to maintain the CWindowModify class.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
I thought about multiple inheritance so this would be a "helper class" then?
I have tried it but I get lots of compiler complaints:
e.g.
error C2385: 'CMyPropSheet::delete' is ambiguous
warning C4385: could be the 'delete' in base 'CObject' of base 'CCmdTarget' of base 'CWnd' of base 'CPropertySheet' of class 'CMyPropSheet'
Is this to be expected though?
|
|
|
|
|
I assume you have derived the new class from CObject
i.e. class CMyClass : public CObject
try this instead!
class CMyClass
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Hi,
I have problum in deleting a single line from a text file.
Any body can give better suggestion.
|
|
|
|
|
while (linesToRead)
{
s = ReadLine(in);
if (line != theLineYouWantToDelete)
WriteLine(out, s);
line++;
}
Software | Cleek
|
|
|
|
|
Hello Sir,
I know this technique i.e using temporary file deleting a single line.
Is there any other option to delete without using temporary file?
|
|
|
|
|
read the whole file into memory, write out everything but that one line.
i don't think there are any file operations that will let you edit a file in-place.
Software | Cleek
|
|
|
|