Undefined structures and functions from WinInet import

99 Views Asked by At

I'm making my first steps with D, and as a trial I am trying to access a SOAP API via the Internet. I have a working C++ app (Visual Studio 2019, Windows 10) which uses the wininet library. I am using Visual D within Visual Studio.

Unfortunately I am falling at the very first hurdle.

module Win32D;

import std.stdio;
import core.sys.windows.windows;
import core.sys.windows.wininet;

int main()
{
    HINTERNET hNet = InternetOpenA("XYZ", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);

    return 0;
}

The compiler (DMD) fails to recognize the wininet types (eg HINTERNET) or functions (eg InternetOpenA). If I go to the definitions in wininet.d I can see all the prototypes.

The D tutorial suggests: "The import statement makes all public functions and types from the given module available."

I am guessing the answer is a one-liner, so I'd appreciate any help!

0

There are 0 best solutions below