CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
How to access an array from win32 dll using perl script

 



kaviarasan
New User

May 30, 2016, 6:32 AM

Post #1 of 3 (1621 views)
How to access an array from win32 dll using perl script Can't Post

can anybody write an program with following requirements please its urgent.

1> write a simple dll program which returns the contents of array.

2> write a perl script where i can display the values of array from win32 dll, in short i want to access the contents of aray from dll


Laurent_R
Veteran / Moderator

May 30, 2016, 10:03 AM

Post #2 of 3 (1616 views)
Re: [kaviarasan] How to access an array from win32 dll using perl script [In reply to] Can't Post

There seems to be a deep misunderstanding here.

This forum is a place for mutual assistance, it is not a "code-o-matic" or a free coding service.

Please, show the code that you have tried, explain in which way if doesn't satisfy your needs, and we will be very happy to help you. But we are not going to do your work (or homework) for you. That would be a bad service anyway.


kaviarasan
New User

May 30, 2016, 11:06 PM

Post #3 of 3 (1608 views)
Re: [Laurent_R] How to access an array from win32 dll using perl script [In reply to] Can't Post

DLLTutorial.h

#ifndef _DLL_TUTORIAL_H_
#define _DLL_TUTORIAL_H_
#include <iostream>

#if defined DLL_EXPORT
#define DECLDIR __declspec(dllexport)
#else
#define DECLDIR __declspec(dllimport)
#endif

extern "C"
{

DECLDIR int* getRandom( );
}

#endif


DLLTutorial.cpp

#include <iostream>
#include "DLLTutorial.h"

#define DLL_EXPORT

extern "C"
{
int * getRandom( )
{

int r[10]={1,2,3,4,5,6,7,8,9,10};
return (int*)&r;
}
}

Perl.pl

use strict;
use warnings;
use Win32::API;
use Win32;

Win32::LoadLibrary('DLLforperltrial2.dll') or die "errorg";
my $function = Win32::API->Import("DLLforperltrial2.dll",'int * getRandom()') or die "error";

1) now from here how access the array from dll and to print it??

2) how to catch pointers from dll in perl scripting??

note: i want to access integer array

thanks in advance

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives