G
Guest
Hello there,
Following autorun.exe code is used in ARM4 device (XDAII) with PPC 2003.
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
if (lstrcmpi(lpCmdLine, _T("install")) == 0)
{
int retVal = ::MessageBox(NULL,_T("Do you want to install mSD
Application?/Möchten Sie die mSD-Applikation installieren?"),_T("mSD
installtion wizard"),MB_YESNO|MB_ICONQUESTION);
TCHAR path[100];
int osLang;
if(retVal == IDYES)
{
retVal=0;
TCHAR sqlCab[100];
//get OS language
osLang = GetOSLanguage(); //this function retrieves os language
if(osLang == GERMAN)
wcscpy(path,_T("\\Speicherkarte\\mSD\\"));
else if(osLang == ENGLISH)
wcscpy(path,_T("\\Storage Card\\mSD\\"));
//copy SQLCE CAB to temp directory
wcscpy(sqlCab,path);
wcscat(sqlCab,_T(SQLCE_ARM));
retVal = CopyFile(sqlCab,TEXT(SETUP_CONFIG), false);
if(retVal == 0)
{
int err = GetLastError();
::MessageBox(NULL,_T("Internal error has occurred,Please reset the
device"),_T("Error"),MB_OK);
exit(0);
}
OnCardInsert(path,osLang); // this function copies three cab files in
temp directory and executes from there. And finally starts a configuration
exe, written in C#
}
else
{
exit(0);
}
}
return 0;
}
It behaves little erratically. Some time when I insert card, application
starts automatically some time it does not. When it does not, I tried
different process to appear again. Some time if I put it in cradle and
disconnect again, it works, but not always. Some time it works only after a
hard reset!
Is there any problem in the code? Or in the logic?
Any idea will be a great help.
Following autorun.exe code is used in ARM4 device (XDAII) with PPC 2003.
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
if (lstrcmpi(lpCmdLine, _T("install")) == 0)
{
int retVal = ::MessageBox(NULL,_T("Do you want to install mSD
Application?/Möchten Sie die mSD-Applikation installieren?"),_T("mSD
installtion wizard"),MB_YESNO|MB_ICONQUESTION);
TCHAR path[100];
int osLang;
if(retVal == IDYES)
{
retVal=0;
TCHAR sqlCab[100];
//get OS language
osLang = GetOSLanguage(); //this function retrieves os language
if(osLang == GERMAN)
wcscpy(path,_T("\\Speicherkarte\\mSD\\"));
else if(osLang == ENGLISH)
wcscpy(path,_T("\\Storage Card\\mSD\\"));
//copy SQLCE CAB to temp directory
wcscpy(sqlCab,path);
wcscat(sqlCab,_T(SQLCE_ARM));
retVal = CopyFile(sqlCab,TEXT(SETUP_CONFIG), false);
if(retVal == 0)
{
int err = GetLastError();
::MessageBox(NULL,_T("Internal error has occurred,Please reset the
device"),_T("Error"),MB_OK);
exit(0);
}
OnCardInsert(path,osLang); // this function copies three cab files in
temp directory and executes from there. And finally starts a configuration
exe, written in C#
}
else
{
exit(0);
}
}
return 0;
}
It behaves little erratically. Some time when I insert card, application
starts automatically some time it does not. When it does not, I tried
different process to appear again. Some time if I put it in cradle and
disconnect again, it works, but not always. Some time it works only after a
hard reset!
Is there any problem in the code? Or in the logic?
Any idea will be a great help.