On Tue, 08 Feb 2011 09:10:02 +0200, Andrew Wiley <[email protected]> wrote:

I'm trying to use the Windows file change notification API from D, and
I'm having trouble translating Microsoft's macro-laden signatures into
D. I thought I had it figured out, but optlink says otherwise:
The original function is this:

HANDLE WINAPI FindFirstChangeNotification(
  __in  LPCTSTR lpPathName,
  __in  BOOL bWatchSubtree,
  __in  DWORD dwNotifyFilter
);

I translated it into:

extern(Windows) {
uint FindFirstChangeNotification(
        const(char)* lpPathName,
        bool bWatchSubtree,
        uint dwNotifyFilter
);
}

Optlink is giving me undefined symbol errors, but I can't seem to
figure out what I have wrong. Any help would be appreciated.

Are you linking with the appropriate import library?

You may also want to have a look at the Win32 bindings project (which also has this function among many others):
http://dsource.org/projects/bindings/wiki/WindowsApi

--
Best regards,
 Vladimir                            mailto:[email protected]

Reply via email to