Jump to content

ResourcesEx.au3 errors


hcI
 Share

Recommended Posts

Hello everyone ! Hello @Guiness if you take a look to this thread ;)

I recently gave a try to this excellent and useful UDF named "ResourcesEx.au3" that is allowing to use DLL resources in a script : ResourcesEx Topic                

 

While using it, I had some problems with.. Every times I try to display a picture, it works but the return value is set to false and @error is set to non-zero..

So for a simple picture it works, with an error. But ! That's why I'm here, when I try to display a bitmap, I still have an error but it do not display anything..

 

When I try to display a picture JPEG :

Spoiler
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include "ResourcesEx.au3"
$Form1 = GUICreate("Form1", 615, 438, 192, 124)
$Pic1 = GUICtrlCreatePic("", 8, 8, 198, 70)
GUISetState(@SW_SHOW)

Dim $a = _Resource_SetToCtrlID($Pic1, "LOGOJ", Default, "cmpadd.dll", True)
MsgBox(0,"", $a & @CRLF & @error & @CRLF & @extended)

And, in the MsgBox i get :

Quote

False

13

15068

NB: when displaying a PNG, 15068 become 693

When I try to display a bitmap :

Spoiler
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include "ResourcesEx.au3"
$Form1 = GUICreate("Form1", 615, 438, 192, 124)
$Pic1 = GUICtrlCreatePic("", 8, 8, 198, 70)
GUISetState(@SW_SHOW)

Dim $a = _Resource_SetBitmapToCtrlID($Pic1, _Resource_GetAsBitmap("ON", "RT_BITMAP", "cmpadd.dll"), True)

And, in the MsgBox i get :

Quote

False

13

0

 

 

As you can guess the DLL name is "cmpadd" and the .rc (before compiling) contains :

ON  BITMAP  y.bmp
OFF BITMAP  n.bmp
MID BITMAP  m.bmp
LOGOJ   RCDATA  logo.jpg
LOGOP   RCDATA  logo.png

So, displaying LOGOJ and LOGOP works but not ON, OFF or MID as they are bitmap..

If someone understand how the UDF works and could told me why is theses errors are happening ?

Or maybe if it exist like a help file of the functions that I didn't got so I can solve them by myself ?

Edited by hcI
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...