FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC

Développement d'applications avec le langage Panoramic
 
AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  MembresMembres  Connexion  
Derniers sujets
» demande explication KGF pour imprimer en mm
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Emptypar JL35 Aujourd'hui à 17:28

» Petit passage furtif
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Emptypar Froggy One Hier à 14:26

» SPIN et aide langage (résolu)
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Emptypar leclode Sam 23 Mar 2024 - 15:20

» Aide-mémoire des mots-clés Panoramic
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Emptypar papydall Mer 20 Mar 2024 - 21:23

» Je ne comprend pas pourquoi la largeur de la scene 3d change
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Emptypar Marc Mar 12 Mar 2024 - 20:06

» Comment télécharger panoramic?
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Emptypar lepetitmarocain Sam 9 Mar 2024 - 13:31

» @lepetitmarocain <==> KGFGrid
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Emptypar Klaus Dim 3 Mar 2024 - 9:59

» Tangram-Toukaré
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Emptypar jjn4 Mer 28 Fév 2024 - 18:12

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Emptypar jjn4 Mer 28 Fév 2024 - 18:09

» KGF_dll - nouvelles versions
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Emptypar Klaus Mer 28 Fév 2024 - 17:01

» Mes souhaits d'amélioration de Panoramic.
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Emptypar Pedro Lun 26 Fév 2024 - 18:12

» Testez-votre-QI
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Emptypar jjn4 Dim 25 Fév 2024 - 17:12

» Utilisation d'Élip
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Emptypar jjn4 Sam 24 Fév 2024 - 18:33

» Récapitulatif ludothèque panoramic jjn4
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Emptypar jjn4 Sam 24 Fév 2024 - 18:11

» Générateur de mots de passe
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Emptypar mindstorm Mar 20 Fév 2024 - 20:09

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Mars 2024
LunMarMerJeuVenSamDim
    123
45678910
11121314151617
18192021222324
25262728293031
CalendrierCalendrier
-20%
Le deal à ne pas rater :
Pack Gigabyte Ecran PC Gamer 27″ LED M27Q (rev2.0) + Radeon RX 6950 ...
749 € 939 €
Voir le deal

 

 Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7

Aller en bas 
+8
Francis-mr
Pedro
Minibug
papydall
Jean Claude
JL35
Marc
Jack
12 participants
Aller à la page : Précédent  1, 2
AuteurMessage
Minibug

Minibug


Nombre de messages : 4566
Age : 57
Localisation : Vienne (86)
Date d'inscription : 09/02/2012

Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Empty
MessageSujet: Re: Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7   Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 EmptySam 23 Avr 2016 - 18:42

Pour ma part, je remercie grandement Jack pour cette version !

Je suis en pleine correction de bugs dans GPP et je peux vous dire que le code erreur avec la ligne de retour est un pur régal ! Un gain de temps incontestable. cheers

Je n'utilisé pas la version précédente pour les problèmes sur la fonction POSITION mais là tout semble correct !

Il n'en reste pas moins que cette erreur avec TERMINATE fait couler beaucoup d'encre et pour cause...
J'espère que Jack trouvera une issue a ce problème car c'est quand même assez génant. Wink
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Empty
MessageSujet: Re: Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7   Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 EmptySam 23 Avr 2016 - 18:45

D'autant que la solution sous forme de code Delphi ou similaire a été posté sur le forum, dans plusieurs versions !
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
silverman

silverman


Nombre de messages : 968
Age : 51
Localisation : Picardie
Date d'inscription : 18/03/2015

Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Empty
MessageSujet: Re: Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7   Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 EmptySam 23 Avr 2016 - 22:25

@papydall
Ta sub est incomplète, il faut libérer les ressources(DestroyWindow) avant d'envoyer une requète terminate(PostQuitMessage). Essaye ça:
Code:

   dll_on "user32" : dim null%
   null%=dll_call1("DestroyWindow",handle(0))
   null%=dll_call1("PostQuitMessage",0)
   dll_off

https://msdn.microsoft.com/fr-fr/library/windows/desktop/ms632598%28v=vs.85%29.aspx#destroying_win
Revenir en haut Aller en bas
jjn4

jjn4


Nombre de messages : 2677
Date d'inscription : 13/09/2009

Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Empty
MessageSujet: +++   Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 EmptyJeu 12 Mai 2016 - 17:25

Je ne comprenais pas pourquoi vous vous plaigniez tant de TERMINATE
qui chez moi fonctionnait très bien, mais comme vous faites souvent
dans le « très pointu », je n'intervenais pas.
Et maintenant, j'ai compris !
king alien king
En effet, jusqu'à présent, je n'utilisais jamais de dll,
et dans ce cas-là, le TERMINATE marche très bien.
Et aujourd'hui, je travaille sur un programme avec un dll,
et effectivement, ça me fait ce que vous dites.
Eh oui, ça y est, je suis atteint de déèlèlomanie !
le KGF devient tellement incontournable...
Mad Mad alien Mad Mad
En tout cas, cela montre que TERMINATE est incompatible avec les dll,
car si je mets le « dll_on "KGF.dll" » en rose, le TERMINATE refonctionne bien
(à part qu'il fait toujours un bruit de protestation, mais bon...)
Ca fournira peut-être un indice à Jack pour corriger le problème...
jocolor alien jocolor
Revenir en haut Aller en bas
http://jjn4.e-monsite.com
Jean Claude

Jean Claude


Nombre de messages : 5948
Age : 69
Localisation : 83 Var
Date d'inscription : 07/05/2009

Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Empty
MessageSujet: Re: Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7   Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 EmptyJeu 12 Mai 2016 - 18:09

Bravo JJN4,
Tu viens de nous trouver une des raisons du bug avec TERMINATE.
Je confirme ce que tu dis. J'ai vérifié avec la version v09-26 de Panoramic qui ne bug pas avec TERMINATE pour les codes sans dll.
Je précise que je n'ai pas oublié dll_off avant de sortir.

J'aimerai bien savoir ce qu'en pense Klaus.

A+
Revenir en haut Aller en bas
Jack
Admin
Jack


Nombre de messages : 2381
Date d'inscription : 28/05/2007

Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Empty
MessageSujet: Re: Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7   Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 EmptyMer 18 Mai 2016 - 20:41

SPRITE_GAMMA, SPRITE_CONTRAST et SPRITE_BRIGHTNESS sont codés et testés.
Ces nouvelles commandes feront partie de la prochaine version instantanée.

@papydall : ton exemple de problème sur TERMINATE a été résolu. Avant de s'arrêter, PANORAMIC libère tous les objets utilisés et dans ton cas, il s'agissait d'un objet (MAIN_MENU) possédant des sous-objets (SUB_MENU). La libération de cet objet à liens arborescents se faisait mal.

@Klaus : je ne suis pas sûr que ta solution "radicale" pour TERMINATE ne laisse pas des objets orphelins en mémoire et donc provoque des fuites de mémoire. C'est une éventualité que je n'ai pas testé. Les problèmes constatés avec TERMINATE sont dus au fait que je libère un par un tous les objets, toutes les listes internes, tous les tableaux dynamiques internes et que cela provoque des conflits lors des suppressions.

Je m'attaque en effet aux problèmes vus sur la commande TERMINATE et je suis loin d'avoir résolu tous les problèmes.

_________________
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Webdav username : panoramic@jack-panoramic password : panoramic123
Revenir en haut Aller en bas
https://panoramic.1fr1.net
Pedro

Pedro


Nombre de messages : 1547
Date d'inscription : 19/01/2014

Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Empty
MessageSujet: Version instantanée.   Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 EmptyMer 18 Mai 2016 - 20:54

Bonsoir.

@Jack.

La prochaine version contiendra-t-elle la fonction demandée 'lastinstr', stp ?
Merci de la suite.
Revenir en haut Aller en bas
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Empty
MessageSujet: Re: Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7   Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 EmptyMer 18 Mai 2016 - 23:58

@Jack:
Je comprends tes doutes. Voici le code de ma fonction:
Code:
function KillProcessByHandle(hWindowHandle: HWND):integer; stdcall; export;      // KGF64
var
  hprocessID: INTEGER;
  processHandle: THandle;
  DWResult: DWORD;
begin
  try
    SendMessageTimeout(hWindowHandle, WM_CLOSE, 0, 0, SMTO_ABORTIFHUNG or SMTO_NORMAL, 5000, DWResult);
    if isWindow(hWindowHandle) then begin
        { Get the process identifier for the window}
        GetWindowThreadProcessID(hWindowHandle, @hprocessID);
        if hprocessID <> 0 then begin
            { Get the process handle }
            processHandle := OpenProcess(PROCESS_TERMINATE or PROCESS_QUERY_INFORMATION, False, hprocessID);
            if processHandle <> 0 then begin
                { Terminate the process }
                TerminateProcess(processHandle, 0);
                CloseHandle(ProcessHandle);
            end;
        end;
    end;
  finally
  end;
  result := 0;
end;

Comme tu vois, je commence par envoyer le message WM_CLOSE au handle ciblé, avec un timeout de 5 secondes. Faudra peut-être voir si c'est suffisant, mais c'est une question de réglage, pas de principe.

Si Wndows n'arrive pas à tuer le processus dans le temps imparti (et donc si le handle est toujours valide, et seulement dans ce cas), je vais chercher l'ID du process à partir du handle de la form.

Si le process a été identifié (et pas encore supprimé par Windows, donc), je vais chercher le handle du process.

Si ce handle du process est toujours valide (et pas encore supprimé par Windows, donc), je vais tuer le processus par l'API TerminateProcess et libérer le handle. Voici ce que dit MSDN sur cette API:
Citation :
This function stops execution of all threads within the process and requests cancellation of all pending I/O. The terminated process cannot exit until all pending I/O has been completed or canceled. When a process terminates, its kernel object is not destroyed until all processes that have open handles to the process have released those handles.

Le code de cette fonction correspond à celui posté ici: http://www.swissdelphicenter.ch/torry/showcode.php?id=266
Je pense que ce sont des gens sérieux.

Un autre site (http://winapi.freetechsecrets.com/win32/WIN32TerminateProcess.htm) donne les informations suivantes:
Citation :
Remarks

The TerminateProcess function is used to unconditionally cause a process to exit. Use it only in extreme circumstances. The state of global data maintained by dynamic-link libraries (DLLs) may be compromised if TerminateProcess is used rather than ExitProcess.

TerminateProcess causes all threads within a process to terminate, and causes a process to exit, but DLLs attached to the process are not notified that the process is terminating.

Terminating a process causes the following:

All of the object handles opened by the process are closed.

All of the threads in the process terminate their execution.

The state of the process object becomes signaled, satisfying any threads that had been waiting for the process to terminate.

The states of all threads of the process become signaled, satisfying any threads that had been waiting for the threads to terminate.

The termination status of the process changes from STILL_ACTIVE to the exit value of the process.

Terminating a process does not cause child processes to be terminated.

Terminating a process does not necessarily remove the process object from the system. A process object is deleted when the last handle to the process is closed.
Donc, je sais qu'il y a un problème de DLL restant chargée, ce qui n'a jamais causé de problème dans mon installation. Par contre, tous les threads sont terminés proprement, tous les handles sont fermés proprement, et donc tous les objets "owned" par le processus sont libérés.

Mais bien entendu, je te laisse juge pour trancher si c'est suffisant. En tout cas, j'ai pris un code posté sur swissdelphicenter, et je n'ai trouvé aucune appréciation négative pour ce code.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Jean Claude

Jean Claude


Nombre de messages : 5948
Age : 69
Localisation : 83 Var
Date d'inscription : 07/05/2009

Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Empty
MessageSujet: Re: Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7   Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 EmptyVen 20 Mai 2016 - 17:31

Merci, Jack pour les 3 commandes SPRITE_GAMMA, SPRITE_CONTRAST et SPRITE_BRIGHTNESS.

A+
Revenir en haut Aller en bas
Contenu sponsorisé





Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Empty
MessageSujet: Re: Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7   Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7 - Page 2 Empty

Revenir en haut Aller en bas
 
Version instantanée du 22 avril 2016 : PANORAMIC V 0.9.27i7
Revenir en haut 
Page 2 sur 2Aller à la page : Précédent  1, 2
 Sujets similaires
-
» Version instantanée du 30/12/2016 : PANORAMIC V 0.9.27i9
» Version instantanée du 2 juin 2016 : PANORAMIC V 0.9.27i8
» Version instantanée du 20 mars 2016 : PANORAMIC V 0.9.27i6
» Version instantanée du 26 avril 2013 : PANORAMIC V 0.9.25i2
» Version instantanée du 20 avril 2013 : PANORAMIC V 0.9.25i1

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: Ce qui est en cours ...-
Sauter vers: