Hi,

On Thu, 15 Jan 2004 10:27:50 -0600
"Berger, Daniel" <djberge / qwest.com> wrote:

>	OpenEventLog  = Win32API.new("advapi32","OpenEventLog","pp","p")
 ...
> 		def initialize(source,machine=0)
 ...
> 			@h = OpenEventLog.call(source,machine)

It seems that the parameters of the API are passed in wrong order.

MSDN> HANDLE OpenEventLog(
MSDN>   LPCTSTR lpUNCServerName,  // pointer to server name
MSDN>   LPCTSTR lpSourceName   // pointer to source name
MSDN> );

>    e = EventLog.new("Application") # results in "NULL pointer given"

I don't know why this error message is claimed, although it is
certain that the message claims for a return value of zero.
Needless to say, zero means a failure of API call because of
wrong ordered parameters.

The work-around of this problem is to declare 'HANDLE' as "l" or "i"
instead of "p".

But, I think there should be more reasonable solution.

-- 
Shusaku <tsyk / yk.rim.or.jp>