www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - SetTimer function not found?

reply "Godlike" <darkandan windowslive.com> writes:
Hi

Im experiencing problems with writing a windows program in D 
language, it's really good language width C++ speed and C# easy 
of use but why there's no critically important for windows 
programmers function SetTimer? Is there a reimplementation or 
something?

Regards
Jun 02 2012
next sibling parent reply "Martin Nowak" <dawg dawgfoto.de> writes:
On Sat, 02 Jun 2012 11:46:39 +0200, Godlike <darkandan windowslive.com>  
wrote:

 Hi

 Im experiencing problems with writing a windows program in D language,  
 it's really good language width C++ speed and C# easy of use but why  
 there's no critically important for windows programmers function  
 SetTimer? Is there a reimplementation or something?

 Regards

The core.sys.windows.* modules are translated by hand. They're not yet complete and would benefit from your contribution. https://github.com/D-Programming-Language/druntime/tree/master/src/core/sys/windows martin
Jun 02 2012
parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On 02.06.2012 14:35, Kevin Cox wrote:
 On Jun 2, 2012 6:33 AM, "John Chapman" <johnch_atms hotmail.com
 <mailto:johnch_atms hotmail.com>> wrote:
  >
  > On Saturday, 2 June 2012 at 10:11:02 UTC, Godlike wrote:
  >>
  >> On Saturday, 2 June 2012 at 10:00:07 UTC, Martin Nowak wrote:
  >
  > Just add these declarations to the appropriate module:
  >
  > extern(Windows) {
  >
  > alias void function(HWND, uint, uint, uint) TIMERPROC;

Better check this callback definition - it might be extern(System) or extern(C).
  >
  > uint SetTimer(HWND hWnd, uint uIDEvent, uint uElapse, TIMERPROC
 lpTimerFunc);
  >
  > BOOL KillTimer(HWND hWnd, uint uIDEvent);
  > }

 Better yet, put them into std.windows and submit a pull request :P

-- Dmitry Olshansky
Jun 02 2012
parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On 02.06.2012 14:55, John Chapman wrote:
 On Saturday, 2 June 2012 at 10:47:37 UTC, Dmitry Olshansky wrote:
 On 02.06.2012 14:35, Kevin Cox wrote:
 On Jun 2, 2012 6:33 AM, "John Chapman" <johnch_atms hotmail.com
 <mailto:johnch_atms hotmail.com>> wrote:
 On Saturday, 2 June 2012 at 10:11:02 UTC, Godlike wrote:
 On Saturday, 2 June 2012 at 10:00:07 UTC, Martin Nowak


 Just add these declarations to the appropriate module:

 extern(Windows) {

 alias void function(HWND, uint, uint, uint) TIMERPROC;


Better check this callback definition - it might be extern(System) or extern(C).

No, it's extern(Windows). And actually it's already defined in core.sys.windows.windows.

Right, which is exactly the same as extern(System) "expands" to on windows platform. -- Dmitry Olshansky
Jun 02 2012
parent Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On 02.06.2012 15:08, Dmitry Olshansky wrote:
 On 02.06.2012 14:55, John Chapman wrote:
 On Saturday, 2 June 2012 at 10:47:37 UTC, Dmitry Olshansky wrote:
 On 02.06.2012 14:35, Kevin Cox wrote:
 On Jun 2, 2012 6:33 AM, "John Chapman" <johnch_atms hotmail.com
 <mailto:johnch_atms hotmail.com>> wrote:
 On Saturday, 2 June 2012 at 10:11:02 UTC, Godlike wrote:
 On Saturday, 2 June 2012 at 10:00:07 UTC, Martin Nowak


 Just add these declarations to the appropriate module:

 extern(Windows) {

 alias void function(HWND, uint, uint, uint) TIMERPROC;


Better check this callback definition - it might be extern(System) or extern(C).

No, it's extern(Windows). And actually it's already defined in core.sys.windows.windows.

Right, which is exactly the same as extern(System) "expands" to on windows platform.

-- Dmitry Olshansky
Jun 02 2012
prev sibling next sibling parent "Godlike" <darkandan windowslive.com> writes:
On Saturday, 2 June 2012 at 10:00:07 UTC, Martin Nowak wrote:
 On Sat, 02 Jun 2012 11:46:39 +0200, Godlike 
 <darkandan windowslive.com> wrote:

 Hi

 Im experiencing problems with writing a windows program in D 
 language, it's really good language width C++ speed and C# 
 easy of use but why there's no critically important for 
 windows programmers function SetTimer? Is there a 
 reimplementation or something?

 Regards

The core.sys.windows.* modules are translated by hand. They're not yet complete and would benefit from your contribution. https://github.com/D-Programming-Language/druntime/tree/master/src/core/sys/windows martin

'Nowak' Are you from Poland? If yes im too. I dont have knowledge about making bindings or other low-level things so i cant help you, im just surprised that there's no that important function but there are others not important if compared to this. How about this? http://www.dsource.org/projects/bindings/browser/trunk/win32 I cant manage it to work, compiled it but conflict errors on import. I really need this function otherwise im cooked.
Jun 02 2012
prev sibling next sibling parent "John Chapman" <johnch_atms hotmail.com> writes:
On Saturday, 2 June 2012 at 10:11:02 UTC, Godlike wrote:
 On Saturday, 2 June 2012 at 10:00:07 UTC, Martin Nowak wrote:
 On Sat, 02 Jun 2012 11:46:39 +0200, Godlike 
 <darkandan windowslive.com> wrote:

 Hi

 Im experiencing problems with writing a windows program in D 
 language, it's really good language width C++ speed and C# 
 easy of use but why there's no critically important for 
 windows programmers function SetTimer? Is there a 
 reimplementation or something?

 Regards



 I cant manage it to work, compiled it but conflict errors on 
 import. I really need this function otherwise im cooked.

Just add these declarations to the appropriate module: extern(Windows) { alias void function(HWND, uint, uint, uint) TIMERPROC; uint SetTimer(HWND hWnd, uint uIDEvent, uint uElapse, TIMERPROC lpTimerFunc); BOOL KillTimer(HWND hWnd, uint uIDEvent); }
Jun 02 2012
prev sibling next sibling parent Kevin Cox <kevincox.ca gmail.com> writes:
--0015175cd9e8c1b4a004c17adadd
Content-Type: text/plain; charset=UTF-8

On Jun 2, 2012 6:33 AM, "John Chapman" <johnch_atms hotmail.com> wrote:
 On Saturday, 2 June 2012 at 10:11:02 UTC, Godlike wrote:
 On Saturday, 2 June 2012 at 10:00:07 UTC, Martin Nowak wrote:

Just add these declarations to the appropriate module: extern(Windows) { alias void function(HWND, uint, uint, uint) TIMERPROC; uint SetTimer(HWND hWnd, uint uIDEvent, uint uElapse, TIMERPROC

 BOOL KillTimer(HWND hWnd, uint uIDEvent);
 }

Better yet, put them into std.windows and submit a pull request :P --0015175cd9e8c1b4a004c17adadd Content-Type: text/html; charset=UTF-8 <p><br> On Jun 2, 2012 6:33 AM, &quot;John Chapman&quot; &lt;<a href="mailto:johnch_atms hotmail.com">johnch_atms hotmail.com</a>&gt; wrote:<br> &gt;<br> &gt; On Saturday, 2 June 2012 at 10:11:02 UTC, Godlike wrote:<br> &gt;&gt;<br> &gt;&gt; On Saturday, 2 June 2012 at 10:00:07 UTC, Martin Nowak wrote:<br> &gt;<br> &gt; Just add these declarations to the appropriate module:<br> &gt;<br> &gt; extern(Windows) {<br> &gt;<br> &gt; alias void function(HWND, uint, uint, uint) TIMERPROC;<br> &gt;<br> &gt; uint SetTimer(HWND hWnd, uint uIDEvent, uint uElapse, TIMERPROC lpTimerFunc);<br> &gt;<br> &gt; BOOL KillTimer(HWND hWnd, uint uIDEvent);<br> &gt; }</p> <p>Better yet, put them into std.windows and submit a pull request :P </p> --0015175cd9e8c1b4a004c17adadd--
Jun 02 2012
prev sibling next sibling parent "John Chapman" <johnch_atms hotmail.com> writes:
On Saturday, 2 June 2012 at 10:47:37 UTC, Dmitry Olshansky wrote:
 On 02.06.2012 14:35, Kevin Cox wrote:
 On Jun 2, 2012 6:33 AM, "John Chapman" <johnch_atms hotmail.com
 <mailto:johnch_atms hotmail.com>> wrote:
 On Saturday, 2 June 2012 at 10:11:02 UTC, Godlike wrote:
 On Saturday, 2 June 2012 at 10:00:07 UTC, Martin Nowak


 Just add these declarations to the appropriate module:

 extern(Windows) {

 alias void function(HWND, uint, uint, uint) TIMERPROC;


Better check this callback definition - it might be extern(System) or extern(C).

No, it's extern(Windows). And actually it's already defined in core.sys.windows.windows.
 uint SetTimer(HWND hWnd, uint uIDEvent, uint uElapse,

lpTimerFunc);
 BOOL KillTimer(HWND hWnd, uint uIDEvent);
 }

Better yet, put them into std.windows and submit a pull request :P


Jun 02 2012
prev sibling parent "John Chapman" <johnch_atms hotmail.com> writes:
On Saturday, 2 June 2012 at 10:35:17 UTC, Kevin Cox wrote:
 On Jun 2, 2012 6:33 AM, "John Chapman" 
 <johnch_atms hotmail.com> wrote:
 On Saturday, 2 June 2012 at 10:11:02 UTC, Godlike wrote:
 On Saturday, 2 June 2012 at 10:00:07 UTC, Martin Nowak wrote:

Just add these declarations to the appropriate module: extern(Windows) { alias void function(HWND, uint, uint, uint) TIMERPROC; uint SetTimer(HWND hWnd, uint uIDEvent, uint uElapse, TIMERPROC

 BOOL KillTimer(HWND hWnd, uint uIDEvent);
 }

Better yet, put them into std.windows and submit a pull request :P

Done.
Jun 02 2012