6. And optionally you can specify the calling convention, this defaults to '__stdcall', alternatively you can specify '_cdecl' or '__cdecl' (API > v0.68) or (API > v0.70_02) 'WINAPI', 'NTAPI', 'CALLBACK' (__stdcall), 'WINAPIV' (__cdecl) . False is __stdcall. Vararg functions are always cdecl. MS DLLs are typically stdcall. Non-MS DLLs are typically cdecl.
from
http://search.cpan.org/~bulkdd/Win32-API-0.75/API.pm#CALLING_AN_IMPORTED_FUNCTION.
You didn't post any code, but I will assume what is happening from "No crash calling a function without any input parameter. ". Win32::API did less error checking against wrong C prototypes in the past. By chance, (actually depending on what version/build number of Visual C or Mingw/GCC the Win32::API XS DLL was compiled with_, certain severe prototype mistakes (wrong number of params or __stdcall vs __cdecl mistake) in the past worked silently (but the C function might have been passed uninitialized memory). Under the hood, a 32 bit function that takes NO parameters (it may or may not have a return value) meets the definition of being __stdcall and __cdecl at the same time, so that will "magically work". ActiveState uses Visual C 6 for all 32 bit XS modules available through AS PPM, if you compile it yourself with "MSVc++ express" (version number??), that is a different compiler. I think your 0.65 came from ActiveState, and your 0.75 was compiled with a 21st century Visual C. On 64 bit Windows, __stdcall and __cdecl in Win32::API have no effect, so you can mess those 2 up in 64 bit Perl, and it will "magically work". Of course 32 bit portable is then gone because it will crash.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.