Getting input from the user (newbie question) [pocket pc 2003] [eVc++]

My problem is about getting a filename from the user as an input, and reading / writing to that file name. Unfortunately I don't know much about CE programming, I used to have a simple C++ function, which I'll post here, if you guys can make it into CE (pocket pc) compatible, it'd be great. Because I can't seem to take any keyboard data as input for pocketpc. Well here's the code for win32 c++:

char type, *filename;

filename = prompt_string( "Please enter a file name", "default.txt" );

and the function was:

char *prompt_string ( char msg[], char *def )
{
char *retval;
retval = ( char * ) malloc( sizeof( char )*100 );
printf( "%s [%s]: ", msg, def );
gets( retval );
if ( strlen( retval ) == 0)
{
strcpy( retval, def );
}
return( retval );
}



Answer this question

Getting input from the user (newbie question) [pocket pc 2003] [eVc++]

  • jasontehpirate

    Hi,

    I don't know if I have the time to answer your entire question (rewiting code and all) but maybe I can point you in the right direction. As you might have noticed there is no prompts in CE so you will have to write a GUI. To get a string from a text box you can look here:

    http://msdn.microsoft.com/library/default.asp url=/library/en-us/wceshellui5/html/wce50lrfgetdlgitemtext.asp

    This will get you a good start if you are used to GUI programming. If not you may want to play around with various sample projects to get a feel for it. Hope this helps.



  • Getting input from the user (newbie question) [pocket pc 2003] [eVc++]