Re: Urgent: Storage Card Mount and UnMount Event WM 5.0



Questions about programming are far more likely to get useful answers
if asked in a newsgroup for programmers. For C/C++, that would
probably be microsoft.public.pocketpc.developer.

I just used google (http://groups.google.com/advanced_group_search) to
look up
WM_FILECHANGEINFO
in microsoft.public.pocketpc.developer and got 9 hits. I think they
will be useful, but can't really tell.


On 18 Apr 2007 06:01:26 -0700, Krish
<mohanakrishnan.giridharan@xxxxxxxxx> wrote:

Hi,

My application access the database stored in a Storage Card, I connect
to the database when application loads and disconnect it on exit.

My question here is

1. When I pull out the Storage Card, the event WM_FILECHANGEINFO is
triggered only after a delay, after analysis I beleive the delay is
due to "pnpunloaddelay" set by OEM. But the problem is when I try to
access the database during the delay, I am getting database exception.
Is there any other event which I can handle to find the card is
removed. Here is the code fragment which I am using

LRESULT CMainFrame::OnFileChangeInfo(WPARAM /* wParam */, LPARAM
lParam)
{
FILECHANGENOTIFY *pFCN = (FILECHANGENOTIFY *)lParam;
FILECHANGEINFO &nfo = pFCN->fci;

switch(nfo.wEventId)
{

case SHCNE_DRIVEREMOVED:
{
CString s("Storage media has been removed From a drive.");
LOG_MSG(s);
break;
}

case SHCNE_DRIVEADD:
{
CString s("Storage media has been inserted into a drive.");
LOG_MSG(s);
break;
}
}
return 0;
}

Will the Database connection handle will be valid even after unmount
and mount event?

2. When device goes to sleep mode or manual switch off, sometime the
card is getting unmounted and mounted and sometime it is not...why is
that?

3.When device goes out of sleep mode or on switch on, I am
intercepting the wake up notification using a Event in my application.
I have tried to access the file using FindFirstFile on a infinite loop
to find whether the database file is available or not after receiving
the notifications. Once the file is accessible I am trying to use the
same old DB handle which got created on application Init, but
sometimes the operation fails(Not always).

Can anyone help me in resolving these issues...

Any pointers to understand the storage card related details for WM 5.0
would be a great help.

Thanks,
Krish

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com
.



Relevant Pages

  • Re: Help Request
    ... you have not read all the responses to my ... database, because the expert offering the code doesn't have your database in ... The "Getting Started" newsgroup is intended for beginners. ... programming, event-oriented programming with objects, ensuring that the ...
    (microsoft.public.access.forms)
  • Re: Auto Launch an application from Storage Card
    ... Questions about programming are far more likely to get useful answers ... SetEvent from driver once storage card is mounted. ... remove the underscores from my email address (and please indicate which newsgroup and message). ...
    (microsoft.public.pocketpc)
  • Re: Anyone know of a good ODBC Database Class?
    ... >> These things are better discussed in a database programming newsgroup. ... > is some limit somewhere on the atomicity of topicality. ...
    (comp.lang.cpp)
  • Re: i need an example: anyone help me
    ... Questions about programming are far more likely to get useful answers ... I replicate the example i read in the book "Sql Server Ce Database ... remove the underscores from my email address (and please indicate which newsgroup and message). ...
    (microsoft.public.pocketpc)
  • Re: Using DB
    ... Questions about programming are far more likely to get useful answers ... if asked in a newsgroup for programmers. ... I suggest using google to look up ...
    (microsoft.public.pocketpc)