__declspec(dllimport) myTable myTableCreate();
Are you sure that that is myTable and not myTable *?

void * is a char * in Win32 API because of bad grandfathered design decisions. If you want a C void * in Win32 API use UINT_PTR instead. UINT_PTR is a pointer sized integer, not a pointer to a integer in C and Win32 API.

my $CreateTable = new Win32::API("myDll.dll","myTable myTable Create() +");
I think "myTable myTable" is a typo and "Create()" is a type, you said earlier the function is called myTableCreate. In any case, you can't return a Win32::API::Struct as the return value since its not implemented (see https://github.com/bulk88/perl5-win32-api/blob/master/API.xs#L767 and https://github.com/bulk88/perl5-win32-api/blob/master/API.pm#L287 ), hmm, that fact is not in the pod, I better fix that.
my $LoadTableFromFile = new Win32::API("myDll.dll","int myTableLoadFro +mFile(char const* filename, LPMyTable pointToMyTable)")
Get rid of the const. It wont parse for sure. Try replacing LpMyTable with LPHANDLE, or upgrading to my version of Win32::API if you want a less quirky struct system, https://github.com/bulk88/perl5-win32-api . Reread the pod in my version also.
__declspec(dllimport) enum myStatus myTableLoadFromFile(char const* fi +lename, MyTable* pointToMyTable);
enums won't parse and are not supported by Win32 API. Change "enum myStatus" to an int (I think you already did that), and write some perl code, maybe as a hash, to decode the int to an english identifier. Also get rid of __declspec(dllimport), that won't parse either. As nice as Win32 API's C prototype parsing system sounds https://github.com/bulk88/perl5-win32-api/blob/master/API.pm#L417, it is nowhere near what a real C compiler will parse, improve it if you can ( I couldn't ), the info you need is here http://msdn.microsoft.com/en-us/library/ttt561z3.

I think your fudging/anonymizing your API to the point where I can't understand it. My final question is, why are you using the myTable struct instead of a UINT_PTR */LPHANDLE? is myTable something you invented to emulate void ** or myTable is from your C API's headers? does myTable have other secret members after member opaque? Does "myTable myTableCreate();" really return a "myTable" and not a "myTable *"?

In reply to Re: WIN32::API and void* by bulk88
in thread WIN32::API and void* by sgv_81

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.