|
HI
i want to make the usb device read only
i already opened the handle for the usb device
now i need to send scsi command to usb device to make it read only
aftert that i will appy dacl to that
now i need to know which scsi command i need to pass to the usb device
and how can i pass that command to usb device using DeviceIoControl
i am using VC++ and visual studio 2005
when ever you are free post the above topic in forums
|
|
|
|
|
Hey people!
In our program a dialog box is displayed with an edit field and some buttons and above the dialog a layered notification window is brought up, stays up for a while (the user has to wait at that point) and then is faded out (using UpdateLayeredWindow). The problem is that all the controls on the dialog (which was under the layered window) remain undrawn and the dialog looks like it has holes on it where the edit field and buttons are (you can then make the controls be drawn for example by dragging another window over the dialog and then removing it). Any idea why we get this and how we could resolve it? I tried playing with the clipchildren style and also tried using RedrawWindow to trigger a redraw but it did not work, also using a RedrawWindow-like solution is very ugly and problematic because the dialog and the layered window both are brought up by different message handlers from different parts of the code and they generally do not know of each other (and i would really like to keep it that way).
Thanks in advance for any usefull hints, fellas.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi All,
I am trying to use _stat C runtime method for a file with time stamp before 1970. It simply crashes.Anybody knows the reason?
Note: My time zone is GMT-5.00 (Eastern time [us+Canada]).
- Vikram S
|
|
|
|
|
_stat uses time which states in the documentation:
The time function returns the number of seconds elapsed since midnight (00:00:00), January 1, 1970
|
|
|
|
|
As far as C is concerned, time (== time_t) started on 1st January 1970[^] - your file with an earlier timestamp is obviously blowing the C runtime's mind. It's like saying to a physicist "here's a file from 10 minutes before the universe existed" - does not compute!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
So what method I should use for stat?
- Vikram S
|
|
|
|
|
I have to ask one question - are file date-times before 1970 actually meaningful? They obviously aren't proper create/modification dates, so why do you need to manipulate them?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
My customer has this kind of data files!
|
|
|
|
|
With creation and/or modification dates prior to 1970? Really.
OK - what do you need from the _stat function? You should be able to use Win32 functions to determine the values of file attributes that _stat gives you.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I write dialog box application using MFC.
my questions is after run the application we are able to view the dialog box there is no problem.
when user click the ok button in the dialog box then i have call userdefind class call MYclass.
From the MYclass I need to create one ProgressBar control and placed to dialog box.
Please clarify me how to create progressBar control from Myclass.
Thanks.
|
|
|
|
|
By reading your description, it seems your design is a bit wrong. In general, you shouldn't let other classses manipulate the controls on your dialog.
What are you trying to achieve at a higher level ? Why does your class need to add a progress bar on your dialog directly ?
|
|
|
|
|
Hi
In my application ,I loaded a dll and tried to update a string in that dll using UpdateResource function,but it is not changing the string in that dll.Please Help !
CString strDll = "C:\\MyRES.dll";
CString strTest = "END";
WORD wLang = MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT);
UpdateMyResource(strDll, _T("108"), wLang, strTest.GetBuffer (strTest.GetLength ()), strTest.GetLength ());
BOOL CBTNDlg::UpdateMyResource(const CString &strFilePath, LPCTSTR lpszResourceId, WORD wLangId, LPVOID lpData, DWORD dwDataLength)
{
HANDLE hUpdate = ::BeginUpdateResource(strFilePath, FALSE);
if (hUpdate == NULL)
return FALSE;
BOOL bUpdateResult = FALSE;
bUpdateResult = UpdateResource(hUpdate, RT_STRING, lpszResourceId, wLangId, lpData, dwDataLength);
return EndUpdateResource(hUpdate, FALSE) && bUpdateResult;
}
|
|
|
|
|
Where has the error occurred?
Has BeginUpdateResource succeeded?
What does UpdateResource return?
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I am getting back to VC++ after a long time. I am using VS 2008 SP1. It is a simple application a button, an editbox (plain) and a richedit box. When i added a control variable (CString) to richeditbox2, a message pops up that i must call this function. The messagebox now does not show again. when i run the program, i get no errors but the dialog fails to load.
I get the following in output window.
<br />
Binary was not built with debug information.<br />
Any info will be appreciated.
|
|
|
|
|
Are you calling AfxInitRichEdit2[^] in your application? Not calling that can have the effect you're seeing...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Yes I tried that after finding some help online but it did not work. Still the same problem. I am using AfxInitRichEdit2() inside the OnInitiDialog as first line. I may need to recompile everything. I also tried linking to RichEdit20.dll ( in project setting) but did not work.
I am using Windows Vista SP1 and Visual Studio 2008 SP1. Could it be that the dll is missing. I tried searching for the dll but could not find it.
|
|
|
|
|
Put AfxInitRichEdit2(); in InitInstance function.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
That actually solved the problem. I was putting it in OnInitDialog. May be i was doped...lol
Thanks
|
|
|
|
|
I have a server app (regular EXE, not service) that supports both ATL and MFC, and it uses Windows messaging as IPC (to exchange data with other applications on the same machine). We run it after an automatic login. So far so good.
Now I've got a new customer that requires that the server be able to run without automatic login. I know we can change the app to a service, replace messaging to other IPC, and bla bla... But, I am looking for some simple solution that minimizes the effort. BTW, the code is from a previous contractor and is not very straightforward.
Any suggestions are welcome!
Best,
Jun
|
|
|
|
|
Take a look at the 'Srvany.exe' program, that used to be part of the Windows NT Resource kit.
|
|
|
|
|
If you want an application to run without a user being logged in, you need to run it as a service. The previous reply mentions a tool that m,ay assist you in this endeavor.
If it needs to run without a user being logged in, and you have the source code, my advice is to convert it to an actual service.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Search for XYNTService here in CP... it can make any application to start as a service...
Also you can create a service that launch your application.
The best option is to transform the application into a service...
Good luck.
|
|
|
|
|
hello , i am new in c++ and i am learing vs c++ MFC.how can i open MFC project in vs c++ and compile and run and want to view my window what i have wrote.i can anyone explain me detail how can i open MFC project in vs c++ 2005.i want to see my created window.
plz help.
|
|
|
|
|
goutom roy wrote: can anyone explain me detail how can i open MFC project in vs c++ 2005
Look on the File menu for an option like Open Project or something.
Good luck
|
|
|
|
|
look for a file with .sln (solution) extension or a file .vcproj (project) extension.
A Solution may contain a number of projects but a project file contains only one project. Usually there are one project per solution though.
good luck
|
|
|
|