in reply to Re^3: [OT - MS Visual Studio] How to build a dll that Win32::API can access
in thread [OT - MS Visual Studio] How to build a dll that Win32::API can access

Ah, so its able to access double.dll, it just can't find my_double

Seems to be the case. Could it be that leading underscore ?

I've just rebuilt the dll without the /Gz switch and dumpbin /exports double.dll then reports that my_double is exported (no leading underscore). When I then run double.pl, my_double is apparently found ok, but the script segfaults.

Cheers,
Rob

Replies are listed 'Best First'.
Re^5: [OT - MS Visual Studio] How to build a dll that Win32::API can access
by Anonymous Monk on May 24, 2008 at 16:21 UTC
      its an Apparent bug in Win32::API if function returns a float or a double

      Heh ... that's the post that started me thinking about this.

      With floats, there may be an issue, but I don't think Win32::API should have any problems with doubles. At least, I don't think earlier versions did.

      But then, when I try to build a dll using Visual Studio, I find that I can't even get the library files to behave in accordance with my expectations. Admittedly I don't use Visual Studio all that often.

      I also don't use Win32::API very much (in fact I avoid it), but little issues like this keep gnawing away at me. Looks like I might have to spend a few hours on this. (My first thoughts were that it must just be a case of me doing something really stupid - which could yet prove to be the case.)

      Thanks for the feedback.

      Cheers,
      Rob
      Update: I'm getting very similar results if I change from doubles to ints - so I don't think it's just a doubles/floats issue. I'll see if anyone on the perl-win32-users list has any advice.