Jump to content
Sign in to follow this  
alaa777

_ClipPutFile() @error=9

Recommended Posts

alaa777

Success: True

Failure: False and set @error

@error: 1 - Unable to Open Clipboard

2 - Unable to Empty Cipboard

3 - GlobalAlloc Failed

4 - GlobalLock Failed

5 - Unable to Create H_DROP

6 - Unable to Update Clipboard

7 - Unable to Close Clipboard

8 - GlobalUnlock Failed

there is no information about error =9

post-30827-12734165455643_thumb.jpg

Share this post


Link to post
Share on other sites
somdcomputerguy

Maybe it's 8 and 1?


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
alaa777

what drive me crazy is it was working yesterday today it is not working i restarted my laptop i made it compatible with windows xp sp 2 even runned it in xp mode :S nothing happened any suggestion?

the only thing i done is installing xp mode i don't think installing xp mode is the reason why it doesn't work

Share this post


Link to post
Share on other sites
MHz

9 - GlobalFree Failed.

It returns a value in @extended returned from _WinAPI_GetLastError() in the _ClipPutFile() UDF. That value may have been more useful to get the error message.

:idea:

Share this post


Link to post
Share on other sites
alaa777

so i need help what should i do to fix this? i did trick to do what i want temporary but it's sick trick i put the file i want in directory then open that directory then use send() the first letter to select the file then send ctrl c but really i need help with that error

Share this post


Link to post
Share on other sites
MHz

The question is what needs fixing. Testing tells me that it is a bug by running the code below.

#RequireAdmin
#include <Misc.au3>
#Include <WinAPI.au3>

$file = @ScriptDir & "\img24.jpg"
$fTest = _ClipPutFile($file)
If Not $fTest Then
    MsgBox(0, '@error = ' & @error & ' @extended = ' & @extended, _WinAPI_GetLastErrorMessage())
Else
    MsgBox(0, 'No error condition', '$fTest has a value')
EndIf

I changed the JPG name to suit what I had available at the time. I get an output of:

---------------------------

@error = 9 @extended = 0

---------------------------

The operation completed successfully.

---------------------------

OK

---------------------------

from WinXP SP3 within Virtualbox. @extended tells me 0. I also tried using ClipGet() after _ClipPutFile() which gives me the full path to the file. _ClipBoard_GetData() gives me a empty file if I use FileWrite with the return from it.

Searching the forum for "_ClipPutFile()" may give some hint at why others have not had this issue. It is odd why the error of 9 is undocumented so it may have been added later. :idea:

Share this post


Link to post
Share on other sites
alaa777

the same and working and pressed ctrl v the image pasted i don't know what was wrong

thx any way :idea:

---------------------------

@error = 9 @extended = 0

---------------------------

The operation completed successfully.

---------------------------

OK

---------------------------

Share this post


Link to post
Share on other sites
tip

Hi to all,

I'm experiencing the very same problem. Does anybody has a solution for this?

I'm using this code:

$1 = FileOpenDialog("Title",@MyDocumentsDir, "(*.*)", 1 + 4 )

$2 = _ClipPutFile($1)
MsgBox(64,"",$2 & @CRLF & @error & @CRLF & @extended & @CRLF &  _WinAPI_GetLastErrorMessage() & @CRLF & ClipGet() )

...and having this as result/error:

ClipputFile_Return = False
@error = 9
@extended = 0
Win API Last Error = The operation completed successfully.

//this is the weird part. When I read clipboard with Clipget() I get this:
ocuments and Settings\Administrator\My Documents\Untitled

//But when I read $1 it gives a proper file destionation:
C:\Documents and Settings\Administrator\My Documents\Untitled-1.odt

Note that I added "@error =","ClipPutFile_Return =" etc. to make it easier to understand :idea:...

I'm using version 3.3.6.1 and Windows XP 64-bit with SP2 installed.

Thank in advance

Tip

Edited by tip

[center]MsgBox_Tipped: Eye candy msgboxes/inputboxes/loginboxes. | CreateBlankBox: Semi-transparent layers with borders and rounded corners.[/center]

Share this post


Link to post
Share on other sites
WinkleDoodle

Looks like it was fixed in the beta 3.3.7.x sometime ago.

The 9 error is still undocumented...

Also not documented: the separator must be a single character. @CRLF is no good.

:|

Edited by WinkleDoodle

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.