Re: What is wrong with this function that I can not get resource content?

2020-02-05 Thread novice2 via Digitalmars-d-learn
On Wednesday, 5 February 2020 at 20:01:19 UTC, Marcone wrote: Sorry! Solved. Just need add # in this line: get_resource("#300", "BMP", "melancia.bmp"); the mistake, very imho, is not check windows API functions results. you can use wenforce:

Re: module ... conflicts with package name ...

2020-02-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/5/20 6:50 PM, Steven Schveighoffer wrote: HOWEVER, I will file a bug on this. If you have two packages claiming to be the same module package, it would be helpful if it showed the previously declared filename/location. https://issues.dlang.org/show_bug.cgi?id=20563 -Steve

Re: module ... conflicts with package name ...

2020-02-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/3/20 2:18 PM, Boris Carvajal wrote: On Monday, 3 February 2020 at 16:35:06 UTC, Steven Schveighoffer wrote: I can't reproduce with a small example. Before I try and go through the process to reduce this, just wanted to see if anyone knows about this. I've made a few changes to the

Re: What is wrong with this function that I can not get resource content?

2020-02-05 Thread Marcone via Digitalmars-d-learn
Sorry! Solved. Just need add # in this line: get_resource("#300", "BMP", "melancia.bmp");

Re: What is wrong with this function that I can not get resource content?

2020-02-05 Thread Marcone via Digitalmars-d-learn
I get resource "melancia.bmp" but the file is corrupted.

What is wrong with this function that I can not get resource content?

2020-02-05 Thread Marcone via Digitalmars-d-learn
// Function get_resource() void get_resource(const(wchar)* id, const(wchar)* tipo, const(wchar)* path_name){ HRSRC file = FindResource(null, id, tipo); DWORD size = SizeofResource(NULL, file); HGLOBAL load = LoadResource(NULL, file); HANDLE new_file =

Re: Abstract override behaviour

2020-02-05 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 5 February 2020 at 17:11:28 UTC, Claudiu wrote: Thanks a lot, I'll need to keep this errata close for future "surprises". I'm trying to learn idiomatic D. I think that this book is still relevant, but are there other recommended books?

Re: Abstract override behaviour

2020-02-05 Thread Claudiu via Digitalmars-d-learn
On Wednesday, 5 February 2020 at 16:55:42 UTC, Ali Çehreli wrote: On 2/5/20 8:49 AM, Claudiu wrote: In class "Min" definition I am receiving this error: "cannot implicitly override base class method `IncrementalStat.accumulate` with `Min.accumulate`; add `override` attribute" Andrei's

Re: Abstract override behaviour

2020-02-05 Thread Ali Çehreli via Digitalmars-d-learn
On 2/5/20 8:49 AM, Claudiu wrote: In class "Min" definition I am receiving this error: "cannot implicitly override base class method `IncrementalStat.accumulate` with `Min.accumulate`; add `override` attribute" Andrei's book is a little dated. Here is the errata:

Abstract override behaviour

2020-02-05 Thread Claudiu via Digitalmars-d-learn
Hi dlang community, Just started to learn D using Visual Studio 2007, latest VisualD (VisualD-v0.51.0-dmd-2.090.0-ldc2-1.19.0) and "The D Programming Language" by Andrei Alexandrescu. I am trying to run most of the examples and had a surprise at chapter 1.6.1 "More Statistics. Inheritance"

Re: D create many thread

2020-02-05 Thread Gregor Mückl via Digitalmars-d-learn
On Wednesday, 5 February 2020 at 15:54:23 UTC, Steven Schveighoffer wrote: I think we should be more selective about when we make parallel threads to scan (maybe above a certain size of used memory?). -Steve That threshold would have to adapt to each system. How about delaying thread

Re: D create many thread

2020-02-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/5/20 8:05 AM, Eko Wahyudin wrote: Hi all, I'm create a small (hallo world) application, with DMD. But my program create 7 annoying threads when create an empty class. What is this thread for? and is it normal in D? Thank you in advance. I didn't know about this feature. I was going

Re: D create many thread

2020-02-05 Thread MoonlightSentinel via Digitalmars-d-learn
On Wednesday, 5 February 2020 at 13:05:59 UTC, Eko Wahyudin wrote: What is this thread for? and is it normal in D? According to the stack trace your applications triggered a GC cycle. The marking is done in parallel to minimize pause times, see https://dlang.org/spec/garbage.html

D create many thread

2020-02-05 Thread Eko Wahyudin via Digitalmars-d-learn
Hi all, I'm create a small (hallo world) application, with DMD. But my program create 7 annoying threads when create an empty class. What is this thread for? and is it normal in D? Below the stack trace of thread creation. #0 0x77f637a0 in pthread_create@@GLIBC_2.2.5 () from