Click here to Skip to main content
15,922,007 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionInsert text to opened word-document Pin
baerten21-Jun-07 21:26
baerten21-Jun-07 21:26 
AnswerRe: Insert text to opened word-document Pin
Matthew Faithfull21-Jun-07 21:37
Matthew Faithfull21-Jun-07 21:37 
GeneralRe: Insert text to opened word-document Pin
baerten21-Jun-07 21:46
baerten21-Jun-07 21:46 
GeneralRe: Insert text to opened word-document Pin
Matthew Faithfull21-Jun-07 22:04
Matthew Faithfull21-Jun-07 22:04 
GeneralRe: Insert text to opened word-document Pin
baerten21-Jun-07 22:10
baerten21-Jun-07 22:10 
GeneralRe: Insert text to opened word-document Pin
Matthew Faithfull21-Jun-07 22:28
Matthew Faithfull21-Jun-07 22:28 
JokeRe: Insert text to opened word-document Pin
baerten21-Jun-07 22:49
baerten21-Jun-07 22:49 
QuestionUSB Removable Drive Detection in Win CE 5.0 Pin
cyberanee21-Jun-07 21:06
cyberanee21-Jun-07 21:06 
I have an data-acquisition application in which data-logging is
performed constantly and data is stored in a CF Card, which acts as the primary data-storage device for the system.

The Windows CE image that i have loaded has support for automatic
detection of USB mass storage devices.

The User can retrive the data from the system (CF Card) thru USB Drive.

There is no screen or console , it is an industrial Controller.

The data acquistion goes on constantly , and the applicaiton
periodically polls the USB slot to see if the user has inserted any
USB Drive in it.

For this, i use the standard CreateFile() function in order to detect
if the user has inserted USB Pen Drive into USB slot or not. I get the
handle to the device using CreateFile(), is user has inserted it.
If he has, then all reqd. data from the CF Card is copied to the USB drive.

if ((hFile=CreateFile(_TEXT"DSK2:",GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL))!=INVALID_HANDLE_VALUE)
{Do further processing}

NOTE: Here DSK2: is the disk number of the Pen Drive

Whenever the user insertes the USB Drive, the OS detects this, and
CreateFile function therefore returns successfully with the USB dive
handle. Thus, USB Drive is detected.

Now, the problem is that sometimes, although the Pen Drive is
inserted, it is not detected by the OS, whearas at other times it is.
That is, in the Windows Explorer, where I can see the CF Card mounted
as "Hard Disk" and USB Pen Drive as "Hard Disk2", sometimes, this
"Hard Disk2" is not seen. It leads me to the conclusion that the USB
Dive is not mounted by the Windows Device Manager. Even if i remove the Pen Drive and re-insert it, it will not be detected hence-forth , once it is not detected. I don't know how to make the OS detect it then , the only way i know is rebooting the system. (Which is definetely not the solution!!)

What can possibly be causing this irregular behavior?

At such times, I cannot obtain a handle to the device using
CreateFile. Is there any alternate way to obtain access to the USB
device, rather than relying on Windows OS, and the Device Manager??

I have also completely checked the hardware, to verify that there is
no problem on hardware side, no loose connections etc. Another
important point is that the LED on the USB Pen Drive always glows when
I insert the Pen Drive, even when it is not detected by Windows CE.



Regrds,
CR
AnswerRe: USB Removable Drive Detection in Win CE 5.0 Pin
Matthew Faithfull21-Jun-07 21:29
Matthew Faithfull21-Jun-07 21:29 
QuestionRe: USB Removable Drive Detection in Win CE 5.0 Pin
cyberanee27-Jun-07 2:28
cyberanee27-Jun-07 2:28 
AnswerRe: USB Removable Drive Detection in Win CE 5.0 Pin
Matthew Faithfull28-Jun-07 7:29
Matthew Faithfull28-Jun-07 7:29 
Question16-bit Windows program and 32-bit DLLs Pin
Krishnatv21-Jun-07 20:48
Krishnatv21-Jun-07 20:48 
QuestionRe: 16-bit Windows program and 32-bit DLLs Pin
David Crow22-Jun-07 2:43
David Crow22-Jun-07 2:43 
AnswerRe: 16-bit Windows program and 32-bit DLLs Pin
Mark Salsbery22-Jun-07 6:16
Mark Salsbery22-Jun-07 6:16 
AnswerRe: 16-bit Windows program and 32-bit DLLs Pin
Mark Salsbery22-Jun-07 6:21
Mark Salsbery22-Jun-07 6:21 
QuestionCList new and delete Pin
devvvy21-Jun-07 20:34
devvvy21-Jun-07 20:34 
AnswerRe: CList new and delete Pin
Cedric Moonen21-Jun-07 20:48
Cedric Moonen21-Jun-07 20:48 
GeneralRe: CList new and delete Pin
devvvy21-Jun-07 21:07
devvvy21-Jun-07 21:07 
GeneralRe: CList new and delete Pin
Cedric Moonen21-Jun-07 21:20
Cedric Moonen21-Jun-07 21:20 
QuestionDisplaying text on a Dialog Pin
Suneet.0321-Jun-07 19:50
Suneet.0321-Jun-07 19:50 
AnswerRe: Displaying text on a Dialog Pin
Hamid_RT21-Jun-07 20:25
Hamid_RT21-Jun-07 20:25 
GeneralRe: Displaying text on a Dialog Pin
Suneet.0321-Jun-07 21:32
Suneet.0321-Jun-07 21:32 
AnswerRe: Displaying text on a Dialog Pin
zhang80060521-Jun-07 21:12
zhang80060521-Jun-07 21:12 
AnswerRe: Displaying text on a Dialog Pin
sps-itsec4621-Jun-07 21:14
sps-itsec4621-Jun-07 21:14 
GeneralRe: Displaying text on a Dialog Pin
Suneet.0321-Jun-07 22:29
Suneet.0321-Jun-07 22:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.