my .NET CF application just disappears...

M

McFar

I have a problem. I'm writing the pure .NET CF application and it is being
tested, I found one problem, the application fails
just disappears without any reason... the code that fails are placed inside
try - catch block and when the application fails the code in catch block
are not executed.....
If anybody has the same problem, please tell me
 
D

Daniel Moth

So you have identified the code that causes the problem but it is not
caughtable? Show us the code.

Cheers
Daniel
 
M

MacFar

I found a reasone why my application fails....
I spend mych time to get to conclusion.
It fails because of PInvoke to native code...
For this purpose I wrote the code that does nothing, just by pressing on
Button performe the following

int i = 0;
while(i < 100)
{
Int32 handle = Win32Api.FindFirstFile(path, ref findData);
if ( handle == 0 )
return;
string fname;
int retVal = 0;
do
{
fname = findData.FileName;
int fAttr = findData.FileAttribute;
if ( (fAttr & WIN32_CONST.FILE_ATTRIBUTE_DIRECTORY) ==
WIN32_CONST.FILE_ATTRIBUTE_DIRECTORY )
{

}
retVal = Win32Api.FindNextFile(handle, ref findData);
}while(retVal != 0);
Win32Api.FindClose(handle);
i++;
}

using this code the application fails randomply, sometimes I need to press a
button several times, sometimes
it fails after second execution...

What do I have.
It is
OS: Ms PocketPC version 4.20.0 (Build 14053)
Device: HP iPAQ h2200

I have .NET CF 1.0 with SP3 installed
(I do not know if it have a any difference, but I installed SP2 and SP3 and
did not install SP1)

If someone have an idea please help me.

What do i need, it is just to write FileExplorer and for the purpose I need
to get information
about files and folders...
 
M

MacFar

Thank you for your replaying, If be true,
I did not know that System.IO.Directory can be used for the purpose...
and I and rewriting the code already, thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top