Welcome to the Project Developers' Table

Moderator: Rathinagiri

User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Welcome to the Project Developers' Table

Post by Rathinagiri »

mrduck wrote:Please reapply the code of clipboard, so that we can more easily understand which is the error...

METHOD Clipboard( cValue ) CLASS WINDOW
IF ::oClipboard == NIL <<<<<< this code may be moved to window.prg ???
::oClipboard := ::s_qApp:clipboard()
ENDIF
IF PCount() == 0
RETURN ::oClipboard:text( 0 )
ELSE
::oClipboard:setText( cValue, 0 )
ENDIF
RETURN NIL

oClipboard must be defined in class application, since it is a singleton anyway
Hi, I have changed clipboard functionality to dialogs.prg since clipboard is system specific and not window specific. Please see this code in /samples/misc/demo_1.prg

This is the function. Even now it gives the same GPF error.

Code: Select all

FUNCTION SetClipboardValue( cValue )
   LOCAL qClip
   qClip := QClipboard()
   qClip:clear()
   qClip:setText( cValue )
   RETURN NIL
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
bedipritpal
Posts: 122
Joined: Thu Sep 02, 2010 10:47 pm

Re: Welcome to the Project Developers' Table

Post by bedipritpal »

Roberto Lopez wrote:
Roberto Lopez wrote:
Roberto Lopez wrote:Can this be caused because I'm using QT 4.7?
Using exactly the same environment, I've switched to QT 4.5.3 and HBIDE was successfully built.
And it could be a problem with MingW.

I'll try QT 4.7 again switching to a newer MingW version.
Yes, MinGW.
Read INSTALL.
enjoy hbIDEing... Pritpal Bedi
User avatar
bedipritpal
Posts: 122
Joined: Thu Sep 02, 2010 10:47 pm

Re: Welcome to the Project Developers' Table

Post by bedipritpal »

rathinagiri wrote: This is the function. Even now it gives the same GPF error.

Code: Select all

FUNCTION SetClipboardValue( cValue )
   LOCAL qClip
   qClip := QClipboard()
   qClip:clear()
   qClip:setText( cValue )
   RETURN NIL
Look into contrib/hbide/ideedit.prg
where this function is used. You must be doing something wrong
somewhere in class hirarchy. Try to put trace for cValue before/after :setText()
is called. Error is buried somewhere not visible.
enjoy hbIDEing... Pritpal Bedi
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Welcome to the Project Developers' Table

Post by Rathinagiri »

Ok Pritpal. I will try and let you know about the results. Thanks.

Also I noted the following:

When a clipboard value is copied from other applications and used demo_1 to set clipboard value, the program is not crashed and exits normally.

However, when we use again demo_1 to set clipboard value, it crashes.

So, whenever we re-set the clipboard value from QT, the program crashes.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Welcome to the Project Developers' Table

Post by Rathinagiri »

Hi Pritpal,

I have verified. HBIDE is also giving the same error. :(

Will it be anyway related to Windows 7 UIPermission for Clipboard activities? But, I have run the program as administrator too.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: Welcome to the Project Developers' Table

Post by mrduck »

This is the function. Even now it gives the same GPF error.

Code: Select all

FUNCTION SetClipboardValue( cValue )
   LOCAL qClip
   qClip := QClipboard()
   qClip:clear()
   qClip:setText( cValue )
   RETURN NIL
I believe this code is wrong, since, according to docs, "There is a single QClipboard object in a application, accessible as QApplication::clipboard()"

so the method

Code: Select all

METHOD Clipboard( cValue ) CLASS WINDOW
IF ::oClipboard == NIL <<<<<< this code may be moved to window.prg ???
   ::oClipboard := ::s_qApp:clipboard()
ENDIF
IF PCount() == 0
   RETURN ::oClipboard:text( 0 )
ELSE
   ::oClipboard:setText( cValue, 0 )
ENDIF
RETURN NIL 
should be better suited...

Using QClipboard() constructor is not present in Qt documentation !

Next, we can study the reason of the error.
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Welcome to the Project Developers' Table

Post by Rathinagiri »

I believe this code is wrong, since, according to docs, "There is a single QClipboard object in a application, accessible as QApplication::clipboard()"
Only after reading the docs and examples in the net, I had used QClipboard as ::s_qApp:QClipbaord()

Since Pritpal advised to use QClipboard() constructor, I have used that. Now, both the implementations give the same error. Even the error occurs in HBIDE editor too.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
bedipritpal
Posts: 122
Joined: Thu Sep 02, 2010 10:47 pm

Re: Welcome to the Project Developers' Table

Post by bedipritpal »

rathinagiri wrote:Since Pritpal advised to use QClipboard() constructor, I have used that. Now, both the implementations give the same error. Even the error occurs in HBIDE editor too.
I never got such error.
Can you give me steps to reproduce ?
Chances are it will be fixed.
enjoy hbIDEing... Pritpal Bedi
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Welcome to the Project Developers' Table

Post by Rathinagiri »

My systems are Windows 7 and Vista Home edition. It happens from the first time itself in the case of Win 7 and from the second time onwards in the case of Vista.

Open HBIDE editor. Type something. Select the text. Right Click. Select Copy. Close HBIDE. The error appears.

Here is the screenshot.
hbide_crash.gif
hbide_crash.gif (265.79 KiB) Viewed 4006 times
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Welcome to the Project Developers' Table

Post by Roberto Lopez »

bedipritpal wrote:
Roberto Lopez wrote:
Roberto Lopez wrote:I'll try QT 4.7 again switching to a newer MingW version.
Yes, MinGW.
Read INSTALL.
Yes, it is.

I'll create new binaries including HBIDE ASAP.

Thanks.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Post Reply