View mode: basic / threaded / horizontal-split · Log in · Help
June 02, 2012
SetTimer function not found?
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
June 02, 2012
Re: SetTimer function not found?
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
June 02, 2012
Re: SetTimer function not found?
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.
June 02, 2012
Re: SetTimer function not found?
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);
}
June 02, 2012
Re: SetTimer function not found?
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
lpTimerFunc);
>
> BOOL KillTimer(HWND hWnd, uint uIDEvent);
> }

Better yet, put them into std.windows and submit a pull request :P
June 02, 2012
Re: SetTimer function not found?
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
June 02, 2012
Re: SetTimer function not found?
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
>> 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).

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

>
>> >
>> > 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
June 02, 2012
Re: SetTimer function not found?
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
> lpTimerFunc);
>>
>> BOOL KillTimer(HWND hWnd, uint uIDEvent);
>> }
>
> Better yet, put them into std.windows and submit a pull request 
> :P

Done.
June 02, 2012
Re: SetTimer function not found?
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
>>> 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).
>
> 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
June 02, 2012
Re: SetTimer function not found?
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
>>>> 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).
>>
>> 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.
>
Ah bleh. I've failed to spot  extern(Windows){ ...}, carry on.


-- 
Dmitry Olshansky
Top | Discussion index | About this forum | D home