anupama.anuna...@gmail.com wrote: > I'm trying to use the Win32::API module to call a simple test case > DLL > (call it "Test.dll"). > > Test.cpp file > extern "C" __declspec(dllexport) int test(int x) > { > x *= 2; > return x; > } > > Test.h file > > extern "C" __declspec(dllexport) int test(int); > #note compling the above Cpp code using VC++ complier(Visual studio > 2005) > > Perl File > Test.pl > #!/usr/bin/perl > > use strict; > use warnings; > > use Win32::API; > use Win32::API::Callback; > use Win32::API::Test; > > my $fun = Win32::API->new('Test.dll', 'int test(int a)') or die $^E; > > my $Result = $fun->call($num1); > print "$Result\n"; > > while executing the above perl file Test.pl throws error out saying > "The specified procedure could not be found at Test.pl line 17." > please comment on the above error n let me know wat the problem is....
I can't see anything obviously wrong, but I suggest you check that the symbol is being exported correctly with dumpbin /exports Test.dll (dumpbin should be installed as part of Visual Studio.) HTH, Rob -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/