Pelles C forum
C language => Pocket PC and Smartphone questions => Topic started by: jasch212 on April 16, 2010, 10:25:58 AM
-
hello,
next question:
how to link a program which uses:
system("notify") ;
how can i find the lib for this function?
thanks
Thomas
-
Have you already tried to compile it?
What error did you get?
What libraries are already included?
I had never had to include a special library for standard functions.
-
hello,
next question:
how to link a program which uses:
system("notify") ;
how can i find the lib for this function?
thanks
Thomas
Place the caret over the word 'system' then press F1, you should be presented with the PellesC help. Within the text you will see what header to include.
John
-
hi,
compile is OK, linking is the problem!
when I used the F1 key over:
system("notify") ;
I get the Help for system, but there is NO info about the lib I had to linked with my progrem.
Help:
Purpose:
Executes a system command.
I used following libs: (some systemLibs and some ownLibs for calculations:
aygshell.lib coredll.lib corelibc.lib geolib_ce.lib AviationFormularyLib.lib
Thomas
-
'system' will compile and link without you needing to specify libs.
All you need to do is include the right header.
John
-
Are you sure, that system is available for Pocket PC?
System starts an other program with cmd.exe, which does not exist on Windows Mobile. :(
-
F1 says:
Declared in:
<stdlib.h>
I included it (compile is OK)
linker:
POLINK: error: Unresolved external symbol 'system'.
POLINK: fatal error: 1 unresolved external(s).
*** Fehlercode: 1 ***
Fertig.
I used pelle 5.0
It seems that "system" is not implememted.
can I otherwise execute an external program?
Thomas
-
linker:
POLINK: error: Unresolved external symbol 'system'.
POLINK: fatal error: 1 unresolved external(s).
*** Fehlercode: 1 ***
Fertig.
I used pelle 5.0
It seems that "system" is not implememted.
Thomas
It is implemented, there must be another problem somewhere. Can you post a small zipped project that shows the error?
John
-
ok,
I have build (via wizzard) a short TestProject, what i now see is an addtional warning:
Erzeugen von main.obj.
E:\ts\workspace\test\main.c(59): warning #2027: Missing prototype for 'system'.
Erzeugen von main.res.
Erzeugen von test.exe.
POLINK: error: Unresolved external symbol 'system'.
POLINK: fatal error: 1 unresolved external(s).
*** Fehlercode: 1 ***
Fertig.
Thomas
-
Sorry, I can't test ARM things, maybe someone else can help.
Also, maybe system is not implemented on ARM, if that is the case I apologize.
John
-
ok,
thankyou JohnF,
does anyone know how to execute an external program on ARM?
or how to create a "beep" or littele sound on the loudspeaker.
Thomas
-
Use CreateProcess.
http://msdn.microsoft.com/en-us/library/ee488927.aspx (http://msdn.microsoft.com/en-us/library/ee488927.aspx)
-
MessageBeep
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
int __cdecl WinMainCRTStartup(void)
{
MessageBeep(0);
ExitThread(0);
}
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
void StartPrg(TCHAR *szModule, TCHAR *szCmdLine)
{
//STARTUPINFO si = { 0 };
PROCESS_INFORMATION pi = { 0 };
TCHAR szBuff[260];
//si.cb = sizeof(si);
// Start the child process.
if (!CreateProcess(szModule, // No module name (use command line)
szCmdLine, // Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
CREATE_NEW_CONSOLE, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
NULL, // Pointer to STARTUPINFO structure
&pi) // Pointer to PROCESS_INFORMATION structure
)
{
wsprintf(szBuff, L"CreateProcess failed (%d).\n", GetLastError());
MessageBox(0, szBuff, L"StartPrg", MB_OK);
return;
}
/*
// Wait until child process exits.
WaitForSingleObject( pi.hProcess, INFINITE );
*/
// Close process and thread handles.
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
StartPrg(L"\\Windows\\calc.exe", NULL);
return 0;
}
-
hello all,
1. MessageBeep(0); compile and link OK but it doesn't work.
2. StartPrg(L"\\Windows\\calc.exe", NULL); compile and link OK it works!!!
3. but I want to here sound or a beep
if (!CreateProcess(L"\\windows\\sndply.exe",
_T("\\windows\\notify.wav"),
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
NULL,
&pi) )
compile and link OK but it doesn't work.
I have now a problem with sndply.exe or with the *.wav file
Thomas
-
- L"\\windows\\sndplay.exe"
- Try to use that CREATE_NEW_CONSOLE
-
with the creation flag CREATE_NEW_CONSOLE
it also does'nt work.
-
Is that sndplay.exe in \Windows folder ?
Can you run it ?
From Control Panel Volume & Sounds:
Is from Volume tab
Enable sound for:
Events (warning, beep and system events) checked ?
Tested with MIO C320b with Windows CE Core 5.0
-
hi,
I thought as much,
I can open sndplay.exe in the \Windows folder.
But i here nothing when I create it from the program, thats the Problem.
CreateProcess(L"\\windows\\sndply.exe",
L"\\windows\\notify.wav", ...
that doesn't work.
thanks
Thomas
-
ok I solved the Problem :)
I changed the registry
from: sndplay.exe %1
to: \Windows\sndplay.exe %1
I do not exactly why, but now it works!
thanks all for your answers
Thomas