|
Hi,
Just wondering if anyone can point me to a C++ function or run-time library call that I can use to create a new folder like this:
NewFolder("C:\\Engineering Data\\Diagnostic Data\\2004_10_15");
I did find SHFileOperations but that seems to be used for deleting, renaming or moving files. I just need to create a new folder under an already existing folder. The higher folder "Diagnostic Data" as used above will always exist if that matters.
Thanks,
Robert
|
|
|
|
|
|
CreateDirectory("C:\\Engineering Data\\Diagnostic Data\\2004_10_15") will fail if "C:\\Engineering Data\\Diagnostic Data\\" does not exist.
|
|
|
|
|
vcplusplus wrote:
CreateDirectory("C:\\Engineering Data\\Diagnostic Data\\2004_10_15") will fail if "C:\\Engineering Data\\Diagnostic Data\\" does not exist.
Correct but did you read the initial post?
I just need to create a new folder under an already existing folder. The higher folder "Diagnostic Data" as used above will always exist if that matters.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
You're right, my mistake.
|
|
|
|
|
|
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
|
|
|
|