Great idea.
When I use Win32::GetLastError I receive error value 1784 which means ERROR_INVALID_USER_BUFFER: The supplied user buffer is not valid for the requested operation
I guess that means that I did not define my structures correctly.
Can someone guide me? (all help is much appreciated).
The structures I found on MSDN are:
typedef struct _SP_CLASSIMAGE_DATA {
DWORD cbSize;
HIMAGELIST ImageList;
DWORD Reserved;
} SP_CLASSIMAGE_DATA, *PSP_CLASSIMAGE_DATA;
The once I found in CommCtrl.h are:
#ifndef HIMAGELIST
struct _IMAGELIST;
typedef struct _IMAGELIST* HIMAGELIST;
#endif
Update:
I think I found the sollution to my problem.
The structures should be defined as:
Win32::API::Struct->typedef(ULONG_PTR => qw{
ULONG Value
});
Win32::API::Struct->typedef(HIMAGELIST => qw{
LONG ImageList
});
Win32::API::Struct->typedef(SP_CLASSIMAGE_DATA => qw{
DWORD cbSize;
HIMAGELIST ImageList;
DWORD Reserved;
});
Win32::API::Struct->typedef(SP_CLASSIMAGELIST_DATA => qw{
DWORD cbSize;
HIMAGELIST ImageList;
ULONG_PTR Reserved;
});
And the sizes of the of the structures should not be defined with length() but with sizeof():
$ClassImageListData->{cbSize} = $ClassImageListData->sizeof();
$ClassImageData->{cbSize} = $ClassImageData->sizeof();
I do get some warnings about uninitialized values, but that can be sorted out.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.