Page 1 of 1

Processmessages causes error

Posted: Tue Jun 26, 2018 5:29 am
by Ingo Junge-Herrmann
Hi all,
my apps built with Xailer 3.20 shows errors on Windows 10 in debug mode when Processmessages() is calling. They cöme from Xailers code because I don't call Processmessages in my Code. The app keeps still running.

Here some error messages shown in the debug-window:

windows\dwm\dwmapi\attribute.cpp(92)\dwmapi.dll!72CA3CF4: (caller: 72CF90ED) ReturnHr(11) tid(1708) 80070006 Das Handle ist ungültig.
internal\onecorecom\inc\combase\comcataloghelpers.hpp(64)\OLE32.DLL!76DA0DC1: (caller: 76E038CB) ReturnHr(1) tid(1708) 80040154 Klasse nicht registriert
com\ole32\ole232\stdimpl\olereg.cpp(750)\OLE32.DLL!76E0399C: (caller: 76DDE35E) ReturnHr(2) tid(1708) 80040154 Klasse nicht registriert

Is there a Workaround or a newer version of this function?

Regards
Ingo

Re: Processmessages causes error

Posted: Tue Jun 26, 2018 7:49 am
by Ingo Junge-Herrmann
Hi Xailer team,
I tested it now with Xailer 5.12 (Demo). The same error Messages on Windows 10 32 bit and 64 bit. See my post before.
On Windows 7 aren't no error Messages.
It seems to be a Windows 10 Problem.

Can you fix it?

Regards

Ingo

Re: Processmessages causes error

Posted: Tue Jun 26, 2018 4:36 pm
by Hurricane
hi Ingo,
1) Are you using OLE*, OCX** or DLL? Describe the purpose and make sure it is compatible with Windows 10 (32 or 64).
2) what is the executed code that generates the error?
3) Run your application, but first:
- close any open application
- Disable antivirus
- Run as administrator
What is the result?

Note: (* What is the string?) (** Is it registered in Windows?)

Ingo Junge-Herrmann wrote:my apps built with Xailer 3.20 shows errors on Windows 10 in debug mode when Processmessages() is calling. They cöme from Xailers code because I don't call Processmessages in my Code. The app keeps still running.

Here some error messages shown in the debug-window:

windows\dwm\dwmapi\attribute.cpp(92)\dwmapi.dll!72CA3CF4: (caller: 72CF90ED) ReturnHr(11) tid(1708) 80070006 Das Handle ist ungültig.
internal\onecorecom\inc\combase\comcataloghelpers.hpp(64)\OLE32.DLL!76DA0DC1: (caller: 76E038CB) ReturnHr(1) tid(1708) 80040154 Klasse nicht registriert
com\ole32\ole232\stdimpl\olereg.cpp(750)\OLE32.DLL!76E0399C: (caller: 76DDE35E) ReturnHr(2) tid(1708) 80040154 Klasse nicht registriert

Re: Processmessages causes error

Posted: Wed Jun 27, 2018 8:47 am
by Ingo Junge-Herrmann
Hurrycane,

yes I'm using Ocx as ActiveX and WORD and Outlook as OleObjects with the functions "CreatObject" or "GetActiveObject" of Xailer's WinOle.prg.
I deactivated the ProcessMessages-Calls in my Code. The errors still exist.
It's curious I have no errors if runnig the App in debug-mode on Windows 7.

Now I'm debugging the code step by step hopeing find all the causes.

Nevertheless thanx for your reply.
Regards
Ingo

Re: Processmessages causes error

Posted: Wed Jun 27, 2018 9:54 am
by Ingo Junge-Herrmann
Hurricane,
I'm using a modified class TForm.

The line RETURN ::Super:Create( oParent ) causes the error

windows\dwm\dwmapi\attribute.cpp(92)\dwmapi.dll!73003CF4: (caller: 73064839) ReturnHr(1) tid(242c) 80070006 Das Handle ist ungültig.

Here the Code of the class

CLASS TForm FROM XForm
DATA cName INIT NIL
METHOD SaveIni()
METHOD RestIni()
METHOD WMKeyDown( nKey, nFlags )
METHOD Create( oParent )
ENDCLASS

//--------------------------------------------------------------------------

METHOD Create( oParent ) CLASS TForm
::nClrPane := 0xFDECE8
::nClrPaneEnd := 0xFFC6C6
::nGradient := grVERTICAL
RETURN ::Super:Create( oParent ) <----- this line causes the error

//------------------------------------------------------------------------------

METHOD SaveIni(lMinimize) CLASS TForm
LOCAL c
DEFAULT ::cName TO ::cText, lMinimize TO .F.
IF !EMPTY(::cName)
c:=::SaveState()
IF lMinimize .OR. !UPPER(RIGHT(c,1))=="M"
SetEntry("WINDOWS33",::cName,c)
ENDIF
ENDIF
RETURN NIL

//------------------------------------------------------------------------------

METHOD RestIni(lNoMinimize) CLASS TForm
local cState:=""
local cLast
local cLeft,cTop,cHW,cR
IF !EMPTY(::cName)
IF !EMPTY(cState:=GetEntry("WINDOWS33",::cName,""))
IF IsLower(cLast := RIGHT(cState,1))
cState := Substr(cState,1,LEN(cState)-1)+UPPER(cLast)
ENDIF
::RestoreState(cState)
ENDIF
ENDIF
RETURN NIL

//--------------------------------------------------------------------------

METHOD WMKeyDown( nKey, nFlags ) CLASS TForm
LOCAL uRet
IF ( uRet := ::OnKeyDown( nKey, nFlags ) ) != Nil
RETURN uRet
ENDIF

IF nKey == VK_F12

WITH OBJECT oCapture := TCaptureBitmap():New(self)
:Capture( )
:Hardcopy( .T.,::cText, .T.)
END
RETURN 0
ENDIF

RETURN ::Super:WMKeyDown( nKey, nFlags )

Any idea?

Regards

Ingo

Re: Processmessages causes error

Posted: Wed Jun 27, 2018 7:35 pm
by Hurricane
hi Ingo,

What is the string to start with OLE?
What version of the application (communicated via OLE) in Windows 7 and Windows 10? Example: Microsoft Word 2007 (Win7) and Microsoft Word 2016 (Win10)

The ideal is to always create a small example simulating the problem.

Re: Processmessages causes error

Posted: Thu Jun 28, 2018 12:37 pm
by Ingo Junge-Herrmann
Hi Hurricane,

Office versions are 32-bit 2007 and 2010
the calls are
CreateObject( "Word.Application" )
CreateObject( "Outlook.Application" )

Both calls doesn't cause any error.

The error messages are only on Windows 10. On Windows 7 no error occures.
Therefore I think this have only to do with Windows 10 and 64-bit machines.

Don't worry I can live with it. The doesn't crash.

Nevertheless many thanks.
Regards
Ingo

Re: Processmessages causes error

Posted: Fri Jun 29, 2018 6:00 pm
by Hurricane
What is the version and edition of your Windows 10? Example 1607 and PRO
Have you tried on another computer with Windows 10 (with different version)? Surely you need to install the Xailer Demo

I found topics from programmers from another programming language, with problem similar to you in Windows 10.

Re: Processmessages causes error

Posted: Sat Jun 30, 2018 4:57 pm
by Ingo Junge-Herrmann
the Windows 10 Version on both machines is 1803 (Build 17134,112).

Hurricane I also read the posts of other developers. It's obviously a Windows 10 problem. Microsoft itself is silent.
Despite the error messages in IDE debug mode my app is still running fine.

Regards
Ingo

Re: Processmessages causes error

Posted: Sun Jul 01, 2018 8:51 pm
by jfgimenez
Ingo,

those messages are not errors nor warnings from Xailer itself. They usually are messages from the windows' developers that have been left there, instead of remove them.

When Xailer executes a program, it is run in debugger mode, therefore it captures every message sent with OutputDebugString() from any piece of software that runs in the same process. Those pieces of software can be any driver (printer, video, ...), any dll attached to the program, and of course... windows itself. And that is the problem. Windows' developers have left many many messages there, along all windows code. The newer windows version, the more messages there are.

It's like if you left a lot of LogDebug() or OutputDebugString() in your program. If the user runs your program alone, all goes fine. But if the user runs your program from a debugger, he will see all those messages. And if you never delete those calls, then the user will see more and more messages in every new release of your program.

However, Xailer 5.1 has a button in the debugger window to filter out those messages. When it's pushed, only messages sent from your program and from Xailer are shown. Every other message is hidden.