Ciao a tutti,
posso sapere come è possibile creare un programma che funzioni in background scrivendolo in linguaggio C?
Vi ringrazio anticipatamente per la risposta.
Ciao a tutti,
posso sapere come è possibile creare un programma che funzioni in background scrivendolo in linguaggio C?
Vi ringrazio anticipatamente per la risposta.
Che compilatore Usi ???
Devi compilare il tuo programma senza console...
invece di scrivere int main()
scrivi int winMain()
PoWered by:
Gentoo 1.5.3 - Kernel 2.6.7
Debian Sid - Kernel 2.6.7 - Bash 3.0
Slackware current - Kernel 2.6.7
Uso Borland C++ 5.02. Allora basta solo mette int winMain e nient'altro?
ho provato ma mi restituisce errore...
forse sono io che ho saltato qualcosa.
Se usi il borland devi creare un progetto...
e nelle imposatzioni :
Platform (Win32)
Target Model (GUI)
PoWered by:
Gentoo 1.5.3 - Kernel 2.6.7
Debian Sid - Kernel 2.6.7 - Bash 3.0
Slackware current - Kernel 2.6.7
Se non funziona...
Prova questo al posto di int main()
Comunque devi sempre compilarlo come GUI...codice:int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil)
PoWered by:
Gentoo 1.5.3 - Kernel 2.6.7
Debian Sid - Kernel 2.6.7 - Bash 3.0
Slackware current - Kernel 2.6.7
La compilazione funziona correttamente e non restituisce alcun errore, ma al momento dell'apertura dell'eseguibile il programma restituisce una finestra d'errore "You have accidently used the dummy version of OwlMain."
Che vuorrdì 'sta roba?
Aiuto, non vorrei aver combinato un bel casino!
mm Non saprei non mi e' mai capitato...
Mi puoi dare il sorgente del pgm ??
PoWered by:
Gentoo 1.5.3 - Kernel 2.6.7
Debian Sid - Kernel 2.6.7 - Bash 3.0
Slackware current - Kernel 2.6.7
E' un programma di esempio:
#include <stdio.h>
int WinMain()
{
int len, j;
long i;
char fl[] = "prova.txt";
char scrivi[] = "Scruttura testo";
FILE *fp;
fp = fopen(fileatt, "a");
fprintf(fp, "%s", scrivi);
fclose(fp);
return 0;
}
Devi includere windows.h
poi se non funziona prova a mettere al posto di winMain
questo
codice:int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil)
PoWered by:
Gentoo 1.5.3 - Kernel 2.6.7
Debian Sid - Kernel 2.6.7 - Bash 3.0
Slackware current - Kernel 2.6.7