Re: Calling a cpp function from d

2015-06-17 Thread John Chapman via Digitalmars-d-learn
On Tuesday, 16 June 2015 at 12:42:16 UTC, C2D wrote: On Tuesday, 16 June 2015 at 12:31:23 UTC, John Chapman wrote: On Tuesday, 16 June 2015 at 12:26:45 UTC, C2D wrote: BOOL result = SHGetFolderPath(null, 0x23, null, 0, cache.ptr); That should be: BOOL result = SHGetFolderPath(null, 0x23, nul

Re: Calling a cpp function from d

2015-06-17 Thread John Chapman via Digitalmars-d-learn
On Tuesday, 16 June 2015 at 12:42:16 UTC, C2D wrote: On Tuesday, 16 June 2015 at 12:31:23 UTC, John Chapman wrote: On Tuesday, 16 June 2015 at 12:26:45 UTC, C2D wrote: BOOL result = SHGetFolderPath(null, 0x23, null, 0, cache.ptr); That should be: BOOL result = SHGetFolderPath(null, 0x23, nul

Re: Calling a cpp function from d

2015-06-16 Thread FreeSlave via Digitalmars-d-learn
On Tuesday, 16 June 2015 at 13:31:47 UTC, FreeSlave wrote: Also you may want to take a look at my library [1] where I use SHGetSpecialFolderPath (I know, it's deprecated, but it still works, so why not. I don't really need to bother with access tokens here). Note that I load shell32 dynamical

Re: Calling a cpp function from d

2015-06-16 Thread FreeSlave via Digitalmars-d-learn
On Tuesday, 16 June 2015 at 12:26:45 UTC, C2D wrote: Hi, I encountered the following error: Error: function files.SHGetFolderPath (void* hwndOwner, int nFolder, void* hToken, uint dwFlags, char* pszPath) is not callable using argument types (typeof(null), int, typeof(null), int, immutable(cha

Re: Calling a cpp function from d

2015-06-16 Thread Daniel Kozák via Digitalmars-d-learn
On Tue, 16 Jun 2015 13:01:09 + via Digitalmars-d-learn wrote: > On Tuesday, 16 June 2015 at 12:42:16 UTC, C2D wrote: > > On Tuesday, 16 June 2015 at 12:31:23 UTC, John Chapman wrote: > >> On Tuesday, 16 June 2015 at 12:26:45 UTC, C2D wrote: > >>> BOOL result = SHGetFolderPath(null, 0x23, nul

Re: Calling a cpp function from d

2015-06-16 Thread Daniel Kozák via Digitalmars-d-learn
On Tue, 16 Jun 2015 12:26:45 + C2D via Digitalmars-d-learn wrote: > Hi, > I encountered the following error: > > Error: function files.SHGetFolderPath (void* hwndOwner, int > nFolder, void* hToken, uint dwFlags, char* pszPath) is not > callable using argument types (typeof(null), int, typ

Re: Calling a cpp function from d

2015-06-16 Thread via Digitalmars-d-learn
On Tuesday, 16 June 2015 at 12:42:16 UTC, C2D wrote: On Tuesday, 16 June 2015 at 12:31:23 UTC, John Chapman wrote: On Tuesday, 16 June 2015 at 12:26:45 UTC, C2D wrote: BOOL result = SHGetFolderPath(null, 0x23, null, 0, cache.ptr); That should be: BOOL result = SHGetFolderPath(null, 0x23, nul

Re: Calling a cpp function from d

2015-06-16 Thread C2D via Digitalmars-d-learn
On Tuesday, 16 June 2015 at 12:31:23 UTC, John Chapman wrote: On Tuesday, 16 June 2015 at 12:26:45 UTC, C2D wrote: BOOL result = SHGetFolderPath(null, 0x23, null, 0, cache.ptr); That should be: BOOL result = SHGetFolderPath(null, 0x23, null, 0, buf.ptr); Thanks, but I'm still getting the sa

Re: Calling a cpp function from d

2015-06-16 Thread John Chapman via Digitalmars-d-learn
On Tuesday, 16 June 2015 at 12:26:45 UTC, C2D wrote: BOOL result = SHGetFolderPath(null, 0x23, null, 0, cache.ptr); That should be: BOOL result = SHGetFolderPath(null, 0x23, null, 0, buf.ptr);

Calling a cpp function from d

2015-06-16 Thread C2D via Digitalmars-d-learn
Hi, I encountered the following error: Error: function files.SHGetFolderPath (void* hwndOwner, int nFolder, void* hToken, uint dwFlags, char* pszPath) is not callable using argument types (typeof(null), int, typeof(null), int, immutable(char)*) When I'm try to run this code: ... { import std