Dear Friends,

I have a windows dll, in my perl script, i am able to load the dll using the Win32::LoadLibrary function and also i a getting the function pointer of the function in the dll, I am using Win32::GetProcAddress function to get the function pointer of the functions in dll. Now How should I call the function using the function pointer which i got from Win32::GetProcAddress?

Thanks in advance.

Not 100% sure on this one, but to dereference a pointer to other data types you can use the syntax as follows:
For arrays @{$arrayRef}
For hashes %{$hashRef}
So perhaps the same thing will work with a pointer to a fuction: &{$functionRef}

its like this:

$pointer->()

but I don't think thats his question.

Not 100% sure on this one, but to dereference a pointer to other data types you can use the syntax as follows:
For arrays @{$arrayRef}
For hashes %{$hashRef}
So perhaps the same thing will work with a pointer to a fuction: &{$functionRef}

Thanks for the reply. using &{$functionRef} using how should i give the call to the function. i mean how can i call the function.

How to use $pointer->() to call the function.

That does call the function. But as I said, I don't think it applies to your question. Your function is not a perl function.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.