|
why would we reply when you never answer our questions ?
i'm still waiting my answer...
|
|
|
|
|
Well.. if both programming and non-programming ways are welcome... why not writing the folder on a CD/DVD (i suggest multisession) and then try accessing it with your application. Or on a diskette, with the lock on..
|
|
|
|
|
Thanks shpid3r,
It is better if we could have hard disk to simulate the read only function. Any ideas?
About the solution of using CD/DVD, each time I changed the data, I need to record a new CD/DVD, and the cost is too high;
About the diskette, I do not have any reader at hand, and my machines are modern -- do not have such diskette interface.
regards,
George
|
|
|
|
|
ignoring me Mr George ?
may I know why you don't answer my posts ?
|
|
|
|
|
Hello again!
Well then, if by hardware means making stuff read only isn`t possible, i suggest trying with a memory stick that has the possibility to lock it (similar to a diskette).
Anyway, I've searched about your problem and found out:
"(...)It's greyed out because folders generally can't be read-only. It's greyed out because the read-only property of a folder either makes all files in the folder read-only, or not read-only."
(a discussion on why a lad couldn`t uncheck a read only property of a folder)
I`ve seen that read only folders was a problem in XP SP1, fixed in SP2. Some explanation on this topic is provided on Microsoft's Site. It's a workaround that problem to fix it. Maybe you can do the reverse of that "fixing" and succeed in what you need.
Please let us know what's new!
Regards,
Shpid3r
|
|
|
|
|
Thanks Shpid3r,
I have tried,
attrib +r +s <folder name="">
then I tried that I still can create new files into the folder. I think read only concept of Windows folder does not mean we can not create new files into the read only folder. Right?
regards,
George
|
|
|
|
|
yes, you might be ignoring me... well, if you don't answer, i'm going to ask Maunder to take action against you (at least, part of you - i'm sure you know which).
|
|
|
|
|
Well, I`ve asked my colleagues, and we`ve agreed that the concept of read only folder only mean that you cannot delete a read only folder. So, yes, you can write a file inside it...
Too bad... it means that the USB Stick trick remains the only cheap solution
Shpid3r
|
|
|
|
|
Thanks Shpid3r,
You are correct. It is my mistake to mis-understand what is read-only.
regards,
George
|
|
|
|
|
Dear Friends,
I want to write a program to lock an executable on the disk. For example, what i want is that whenever user clicks on calc.exe, a dialog box should appear showing 'Access Denied' message.
Please tel me what approach to use in order to develop such application. Please tell me relevant APIs or such article you aware of.
Imtiaz
|
|
|
|
|
Hi,
I have not heard about any APIs doing this. I suppose you know this can be done by user management but I am not sure this is your case. There are some tools written in a way that they change the executable itself so that it prompts for username and password. Another approach is to run a program in the background watching which exe is started but this approach has disadvantages either. Imagine someone kills this process and the executables may be started without problems. There may be APIs which do some user management if you wanna do it that way.
modified 7-Mar-17 16:43pm.
|
|
|
|
|
IIUC, you would have to manually set the security information on the file you are trying to "lock out". This is not easy to do, as messing with NT Security Objects and APIs is tricky.
It is also a sneaky thing to do, as a virus/malware application could do things like prevent task manager from running, to make it harder to kill the app.
Not something I would recommend doing, because it looks suspicious as hell.
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
|
|
|
|
|
Create an ACE for that file that denys execution.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
See here.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
\\m_sTime is the local computer time
\\m_strOn1 -> m_strOn8 are edit box's that a user can enter time's into
the problem is the if statment keeps returning true,varibles m_strOn1 too m_strOn7 are all the same,but m_strOn8 is different and the secondif statment should return true not the first.
obviously im doing something incorrect here,can anybody help?
if(m_sTime == m_strOn1 && m_strOn2 && m_strOn3 && m_strOn4 && m_strOn5 && m_strOn6 && m_strOn7 && m_strOn8 )
{
Out32(0x378,255);
m_Pin1 = TRUE;
m_Pin2 = TRUE;
m_Pin3 = TRUE;
m_Pin4 = TRUE;
m_Pin5 = TRUE;
m_Pin6 = TRUE;
m_Pin7 = TRUE;
m_Pin8 = TRUE;
UpdateData(false);
MessageBox("11111111","here",MB_OK);
}
else
if(m_sTime == m_strOn1 && m_strOn2 && m_strOn3 && m_strOn4 && m_strOn5 && m_strOn6 && m_strOn7 != m_strOn8)
{
Out32(0x378,254);
m_Pin1 = TRUE;
m_Pin2 = TRUE;
m_Pin3 = TRUE;
m_Pin4 = TRUE;
m_Pin5 = TRUE;
m_Pin6 = TRUE;
m_Pin7 = TRUE;
m_Pin8 = FALSE;
UpdateData(false);
MessageBox("11111110","here",MB_OK);
}
|
|
|
|
|
thes3cr3t1 wrote: if(m_sTime == m_strOn1 && m_strOn2 && m_strOn3 && m_strOn4 && m_strOn5 && m_strOn6 && m_strOn7 && m_strOn8 )
You have to check all the variables like
m_sTime == m_strOn1 && m_sTime == m_strOn2 && m_sTime == m_strOn3 ... etc.
- NS -
|
|
|
|
|
NS17 wrote: m_sTime == m_strOn1 && m_sTime == m_strOn2 && m_sTime == m_strOn3 ... etc.
Easy when you know how,it worked perfectly thankyou very much!
Chris
|
|
|
|
|
thes3cr3t1 wrote: \\m_sTime is the local computer time
In what kind of variable ? A char*, a CString, a DWORD, ... ?
thes3cr3t1 wrote: \\m_strOn1 -> m_strOn8 are edit box's that a user can enter time's into
Not the edit boxe classes but a string variable (CString) associated to the control ? Right ?
thes3cr3t1 wrote: if(m_sTime == m_strOn1 && m_strOn2 && m_strOn3 && m_strOn4 && m_strOn5 && m_strOn6 && m_strOn7 && m_strOn8 )
What are you trying to do there ? You want to compare the m_sTime string (if it is a string) to all of the other strings ? You cannot do it that way. And also you probably have a problem with operator precedence.
I think you need to revise a little bit how to use operators in C++. The way to do it is:
if ( (m_sTime == m_strOn1) && (m_sTime == m_strOn2) )
(and you continue for all the variables you want to test). Otherwise, in your case, you will check if m_strOn1 is true (and I even wondering how it does compile ).
|
|
|
|
|
Okay let me explain, i have a electronic circuit board with eight relay switches on it, it is connected to my computer via the parrallel port,i am trying to code an aplication that can
1)individualy turn on and off each relay
2)turn on\off one or more of the eight relay's at a certain time
To that end i have a timer that gets the current time (m_sTime) and updates every second
i have 16 editbox's that are CString varibles that a user can enter time's into,eight for on time,eight for off time.
then on every clock tick i want to check if any of the user inputted times match the realtime i.e m_sTime.
i need to know which of the user inputted times match, e.g if all of the times match i need execute binary 11111111, "Out32(0x378,255);.
or if say m_strOn1 and m_strOn2 match and all the others do not match i need to send binary 00000011, "Out32(0x378,3);" by converting binary to decimal
there must be a easier way of achiving what im trying to do,currently im having to use a binary conversion table to calculate ever posibility of on/off sequnces
and hard code them into my aplication
I hope this makes a little more sense to you,im in the army so coding has become just a hobby as work dominates my weekday time.
many thanks chris
|
|
|
|
|
int timerPinout = 0;
void CChrisRelayDlg::CheckTimers()
{
if (m_strOn1 == m_sTime)
{
m_Pin1 = TRUE;
timerPinout |= 0x1;
}
if (m_strOn2 == m_sTime)
{
m_Pin2 = TRUE;
timerPinout |= 0x2;
}
if (m_strOn3 == m_sTime)
{
m_Pin3 = TRUE;
timerPinout |= 0x4;
}
if (m_strOn4 == m_sTime)
{
m_Pin4 = TRUE;
timerPinout |= 0x8;
}
if (m_strOn5 == m_sTime)
{
m_Pin5 = TRUE;
timerPinout |= 0x10;
}
if (m_strOn6 == m_sTime)
{
m_Pin6 = TRUE;
timerPinout |= 0x20;
}
if (m_strOn7 == m_sTime)
{
m_Pin7 = TRUE;
timerPinout |= 0x40;
}
if (m_strOn8 == m_sTime)
{
m_Pin8 = TRUE;
timerPinout |= 0x80;
}
if (m_strOff1 == m_sTime)
{
m_Pin1 = FALSE;
timerPinout &= 0xFE;
}
if (m_strOff2 == m_sTime)
{
m_Pin2 = FALSE;
timerPinout &= 0xFD;
}
if (m_strOff3 == m_sTime)
{
m_Pin3 = FALSE;
timerPinout &= 0xFB;
}
if (m_strOff4 == m_sTime)
{
m_Pin4 = FALSE;
timerPinout &= 0xF7;
}
if (m_strOff5 == m_sTime)
{
m_Pin5 = FALSE;
timerPinout &= 0xEF;
}
if (m_strOff6 == m_sTime)
{
m_Pin6 = FALSE;
timerPinout &= 0xDF;
}
if (m_strOff7 == m_sTime)
{
m_Pin7 = FALSE;
timerPinout &= 0xBF;
}
if (m_strOff8 == m_sTime)
{
m_Pin8 = FALSE;
timerPinout &= 0x7F;
}
if (m_strOff6 == m_sTime)
{
m_Pin6 = FALSE;
timerPinout &= 0xDF;
}
Out32(0x378,timerPinout);
m_iCout--;
UpdateData(false);
}
|
|
|
|
|
Gentlemen,
I am reworking on a japanese database project which was previously done.
Instead of using ms-access database, they used their own defined database with *.cho as extensiion not *.mdb, and this database is using jet engine and MFC wrappers.
How could one create database with custom extension and communicate with jet engine using Dao MFC wrappers?
Padam Raj Gurung
|
|
|
|
|
Hi!
i know virtual address of code section (of an exe) is 401000 (for example).
when this exe is running, how do i get real address with virtual exe?
i want to determinate which exe call my function (my function is in other exe).
in my function, i pop of stack, this value is virtual address of exe that call my function. but real address?
Zo.Naderi-Iran
|
|
|
|
|
Well, you can use LoadLibrary(...) to load an executable into your address space. If you know the relative offset of the code you are trying to execute, you should be able to calculate the offset after loading it into your address space (and knowing where it was loaded at).
Getting the offset in the other running executable may be possible via injection or using CreateRemoteThread(...) . How to inject into running processes and/or use CreateRemoteThread(...) is a whole series of articles in itself.
If the function is exported via an export table (yes, EXEs can export functions just like DLLs), you can just use GetProcAddress(...) after calling LoadLibrary(...) , just like a normal DLL.
Note that even though you will be running code in the other executable, you will not be able to share data easily between the two because they are running in completely separate address spaces.
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
|
|
|
|
|
Hi,
I execute the lines of code below
<br />
#include "ATLComTime.h"<br />
<br />
COleDateTime tmVal = COleDateTime::GetCurrentTime();<br />
CString tmStr = tmVal.Format(LOCALE_NOUSEROVERRIDE, LOCALE_NEUTRAL);<br />
On executing tmVal will be say 39391.729583333.
tmStr give me the current time in the format tmStr = "11/5/2007 5:30:36 PM" (Current time).
Now assume, I have only tmStr value of "11/5/2007 5:30:36 PM", can I get the tmVal of 39391.729583333 from tmStr.
Are there any api's which will help me with this conversion?
|
|
|
|