Re: A tutorial on D templates

2012-01-14 Thread DNewbie
On Sat, Jan 14, 2012, at 09:07 AM, Philippe Sigaud wrote: On 13/01/12 10:48 PM, DNewbie wrote: I can't understand it. Why would someone need template programming. What problem does template solve? Well read on and see :-) Peter: Suppose you want to write a function to get

Re: import std.c.windows.windows;

2012-01-14 Thread DNewbie
On Wed, Jan 11, 2012, at 01:16 PM, Mike Parker wrote: On 1/10/2012 10:57 PM, DNewbie wrote: On Tue, Jan 10, 2012, at 10:37 PM, Mike Parker wrote: Those samples use a binding to the Win32 API[1] that does not ship with DMD. So in your case, std.c.windows.windows is probably what you want

Re: A tutorial on D templates

2012-01-13 Thread DNewbie
I can't understand it. Why would someone need template programming. What problem does template solve? -- D

Re: A tutorial on D templates

2012-01-13 Thread DNewbie
On Fri, Jan 13, 2012, at 11:28 PM, Peter Alexander wrote: On 13/01/12 10:48 PM, DNewbie wrote: I can't understand it. Why would someone need template programming. What problem does template solve? Suppose you want to write a function to get the minimum of two integers. It's easy: Oh

function pointer from DLL

2012-01-13 Thread DNewbie
I've been trying to translate the following from http://www.scintilla.org/Steps.html int (*fn)(void*,int,int,int); void * ptr; int canundo; fn = (int (__cdecl *)(void *,int,int,int))SendMessage( hwndScintilla,SCI_GETDIRECTFUNCTION,0,0); ptr = (void

Re: function pointer from DLL

2012-01-13 Thread DNewbie
On Sat, Jan 14, 2012, at 06:04 AM, Andrej Mitrovic wrote: On 1/14/12, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: You can clone this: g...@github.com:AndrejMitrovic/DSciteWin.git Then just run build.bat. Sorry, I've assumed you run git, the http link is:

import std.c.windows.windows;

2012-01-10 Thread DNewbie
I'm not sure I understand.. The page at http://dlang.org/windows.html says Instead of the: #include windows.h of C, in D there is: import std.c.windows.windows; However, the samples at https://github.com/AndrejMitrovic/DWinProgramming/tree/master/Samples use import win32.windef;

Re: import std.c.windows.windows;

2012-01-10 Thread DNewbie
On Tue, Jan 10, 2012, at 10:37 PM, Mike Parker wrote: Those samples use a binding to the Win32 API[1] that does not ship with DMD. So in your case, std.c.windows.windows is probably what you want for now. [1]http://dsource.org/projects/bindings/wiki/WindowsApi Ok.. I still don't

Re: Mixing D and C - Windows

2012-01-02 Thread DNewbie
Thank you both. I've created a D DLL [http://dlang.org/dll.html], then I've loaded it from a C program [compiled with dmc]. However, I'd want to be able to call it from a C program compiled with MSVC, and I got a link error - unresolved external symbol [link testdll.obj /implib:mydll.lib

Re: Mixing D and C - Windows

2012-01-02 Thread DNewbie
Resolved. Thanks everyone. On Tue, Jan 3, 2012, at 04:49 AM, Andrej Mitrovic wrote: Maybe I'm wrong, but IIRC objconv won't work on import libs. But there are other ways to do it: http://support.microsoft.com/kb/131313 -- D

<    1   2