|
|
Hi,
I hope someone could help me with this because i'm totally stuck.
The problem i have is an application that locks my cdrom drive so it can not read data cd's.
I have used a program called API spy to figure out how the drive is locked. It calls the function "DeviceIoControl" with dwControlCode 0x24014 and 0x24028 which is functions IOCTL_CDROM_GET_VOLUME and IOCTL_CDROM_SET_VOLUME.
After this the drive is locked, i have tried to unlock it by calling IOCTL_CDROM_SET_VOLUME and revert to the original values but the drive is still locked.
The drive remains locked until the process that locked it terminates.
Any help appreciated!
--Genfors
|
|
|
|
|
Genfors wrote:
The drive remains locked until the process that locked it terminates.
If you know the name of the program that is locking the drive, why not just terminate it, and possibly remove it from your machine?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
If you know the name of the program that is locking the drive, why not just terminate it, and possibly remove it from your machine?
I need that program up and running it does other thing besides locking my cd.
It's a comercial presentation software, i don't know why but their runtime component locks the cd or sets it in a CD Audio only mode.
|
|
|
|
|
Your problem is the application has told Windows that it is the only thing that should be allowed to use the drive. Windows obeys this, like it should.
Call your vender and see if there is soemthing you can do. The DeviceIoControl function call has nothing to do with it, it is the open call.
|
|
|
|
|
Call your vender and see if there is soemthing you can do. The DeviceIoControl function call has nothing to do with it, it is the open call.
I have tried to reach the Vendor but they have not responded, yet.
I tried to create an application that used the same DeviceIo calls that the comercial app and that locks the drive in the same way so it seems like the call with DeviceIoControl has something to do with it.
|
|
|
|
|
Hai,
I am working on win32 vc++.I have set of commands that i have to send it to serial port..how should i do that programatically..
thanks a lot..
|
|
|
|
|
You simply opens the port using CreateFile. The filename is the name of the serial port.
After that you can send and receive using ReafFile and WriteFile.
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
For additional info, please see Communication Functions in VC++ MSDN.
|
|
|
|
|
Hi, I am trying to make a program where the program asks me for a password and if the password is correc t it will tell me something important whereas if the password is incorrect it will tell me that the password is incorrect.
I have used MFC so far. Could any body help me read what is written in the Edit box to verify the password. Oh and yes I am completely new to this so please dumb it down a bit as well.
The code I have so far is:
void CpasswrdtestingDlg::OnOK()
{
// TODO: Add extra validation here
char *s1,*s2;// Declareing identifiers
(s1) = GetDlgItem( IDC_EDIT1 ); // Reading input from IDC_EDIT1 (NEEDS IMPROVEMENT)
s2 = "my password"; // Defines the password
// Outputs to give out to the user.
if (s1 == s2)
{
MessageBox ("Hello well done you got it right");
MessageBox ("Yey");
}
else
MessageBox ("It didnt work. Try again!!");
}
I would greatly thank full if anybody could help me with this. Thanks.
Buyer1
Buyer1
|
|
|
|
|
GetDlgItem() returns a CWnd*, not a char* .
CWnd::GetWindowText returns a CString; it might be usefull.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
You can do it may like this:
CString strEnter; //Edit box string
CString strPassword = "My Password"; //Define the password
CEdit* pEdit = (CEdit*)GetDlgItem( IDC_EDIT1);
pEdit->GetWindowText( strEnter);//Get string you enter in the editbox
if(strEnter == strPassword)
{
MessageBox ("Hello well done you got it right");
MessageBox ("Yey");
}
else
{
MessageBox ("It didnt work. Try again!!");
}
|
|
|
|
|
rename also you control into a more significant name.
for example, IDC_PASSWORD_EDIT.
then, you can access like that :
CString strPassword;
CEdit* pEdit = (CEdit*)GetDlgItem(IDC_PASSWORD_EDIT);
pEdit->GetWindowText(strPassword);
or faster if you like :
CString strPassword;
((CEdit*)GetDlgItem(IDC_PASSWORD_EDIT))->GetWindowText(strPassword);
TOXCCT >>> GEII power
|
|
|
|
|
Is there an easy way to center the title text "My window title"?
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
IDR_MAINFRAME "My window title"
END
|
|
|
|
|
The last time I read about something related to this, it involved drawing your own caption in the client area of the window. Yes it involved several lines of code but it did not seem all that bad. The code was well documented and laid out in an easy-to-read format.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
On one of my Dialogs I have a list of checkboxes, each one activates a different set of options, but how can you arrange for the Tab key to have the same effect as checking each Checkbox with the mouse.
grahamfff
|
|
|
|
|
The tab key should be used to navigate the controls on the dialog. Why are you wanting it to behave differently?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
The normal operation was to Tab and hit SpaceBar to select, its just the user wanted the Tab to do both the tabbing and selection.
i.e. if you arrange the first to be selected then could tab to the next and arrange for it to be selected.
I just did not know how to tab and select.
grahamfff
|
|
|
|
|
Hello,
Do you know a simple solution to extract headers from a jpg file (size, color depth, channels) ?
Regards,vince
|
|
|
|
|
If you know the JPG file format, it's easy. Go to www.wotsit.org and search for jpg. There are six examples.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
First you need the JPG file format
get it from www.wosit.com
|
|
|
|
|
Hi, i've tried and apoke with like a zillion people, but i did not succees in resolving this problem. I have to do in my app dome direct-draw drawing and on resize it flickers like hell. I've use "Clip children" options from dialog propertis (no ideea what this actually does) and the DDraw flickering stopped BUT the all buttons and stuff from my dialog "stays a little behind", giving a very ugly aspect. So, if i can't repaint the dialog correctly, i thought to force that windows option "show window contents while dragging" so that my app does not display anything on resize. Any ideea how i can do that?(or if you have an article on repainting a dialog app, that would be even more great).
Thanks alot guys ( and girls ?)
|
|
|
|
|
1. For starters, DO NOT EVER adjust a user preference because of a defect in YOUR software. That will surely piss off the end users.
2. You are not setting up or processing the clipping region/rectangle in the WM_PAINT correctly, for some reason. For example, if your window is SHRINKING, there should not be any drawing at all. IF your window is EXPANDING, then you should only need to repaint the areas that are newly exposed. Since a dialog does not normally resize, I am thinking that in the code where your dialog is being resized, if you are invalidating the ENTIRE client area, that is where your problem starts. You should only add the parts of the window that are newly exposed to an update region. Then, when the WM_PAINT comes in, your clipping rectangle should represent the area exposed, not the entire client area. Also, you can process the window background erasing. If you erase to the color of the dialog's background, instead of letting the default color (white, usually) come in, there will be less apparent flicker.
|
|
|
|
|
In my class definitions, I declared a public struct with multiple fields. I then declared both a public and private instance of it. The reason why I have the public instance is to be able to transport the manipulated variables or fields to those of the private ones via the Get and Set methods. Does this still follow the principle of encapsulation? Thanks!
|
|
|
|
|
you only need to have on private member variable of you field.
the Get/Set methods will be public, and will access the private data members.
typedef aStruct {
int a;
} aStruct_t;
class AClass
{
private:
aStruct_t myStruct;
public:
void SetValueInMyStruct(int i ){ myStruct.a = i;};
int GetValueInMyStruct(){ return myStruct.a; };
}
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|