Windows 7 x64. Prevent appearing of console with GUI application

2018-07-24 Thread ANtlord via Digitalmars-d-learn
Hello! I'm trying run my GUI application getting a console hidden. The application is on top of GTKD, compiled with dmd 2.081.1 in Windows 7 x64. I read a few threads on the forum and StackOverflow and I got that I need to add a module definition file [1] or to add -L/SUBSYSTEM:WINDOWS -L/ENTRY

Re: Windows 7 x64. Prevent appearing of console with GUI application

2018-07-24 Thread Mike Franklin via Digitalmars-d-learn
On Tuesday, 24 July 2018 at 08:09:33 UTC, ANtlord wrote: So... how prevent appearing of console on the startup of the application? Here's my test --- module HelloMsg; import core.runtime; import std.utf; import core.sys.windows.windows; auto toUTF16z(S)(S s) { return toUTFz!(const(wchar)

Re: Windows 7 x64. Prevent appearing of console with GUI application

2018-07-24 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 24 July 2018 at 08:48:54 UTC, Mike Franklin wrote: Here's my test extern (Windows) int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow) When using WinMain, subsystem:windows is the default. The OP wants to use main as the entry point, whe

Re: Windows 7 x64. Prevent appearing of console with GUI application

2018-07-24 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 24 July 2018 at 08:09:33 UTC, ANtlord wrote: Hello! I'm trying run my GUI application getting a console hidden. The application is on top of GTKD, compiled with dmd 2.081.1 in Windows 7 x64. I read a few threads on the forum and StackOverflow and I got that I need to add a module de

Re: How to avoid inout type constructor with Optional type wrapper undoing string type

2018-07-24 Thread Timoses via Digitalmars-d-learn
On Monday, 23 July 2018 at 18:39:59 UTC, aliak wrote: Hi, I'm playing around with an Optional wrapper type. It stores a type T and a bool that defines whether a value is defined or not: struct Optional(T) { T value; bool defined = false; this(U : T)(auto ref inout(U) value) inout {

Re: trait to get the body code of a function?

2018-07-24 Thread Timoses via Digitalmars-d-learn
On Tuesday, 24 July 2018 at 04:43:33 UTC, Guillaume Lathoud wrote: Hello, __traits and std.traits already offer access to function information like input parameters, e.g. in std.traits: ParameterIdentifierTuple ParameterStorageClassTuple Even if that might sound strange, is there a compile t

Re: How to avoid inout type constructor with Optional type wrapper undoing string type

2018-07-24 Thread Ali Çehreli via Digitalmars-d-learn
On 07/24/2018 02:47 AM, Timoses wrote: > Why does this fail while it works when replacing T with U in struct > W(T)?? It's so odd. Both T and U seem to resolve to "string". > > struct W(T) { > const T value; > // Replacing `T value` with `U value` compiles > this(U

Re: trait to get the body code of a function?

2018-07-24 Thread 12345swordy via Digitalmars-d-learn
On Tuesday, 24 July 2018 at 05:27:36 UTC, rikki cattermole wrote: On 24/07/2018 4:43 PM, Guillaume Lathoud wrote: [...] Doesn't exist. Well, IMO it should exist as it can be quite useful for generating metainfo.

extern(C++): Unresolved scalar deleting destructor

2018-07-24 Thread Vladimir Marchevsky via Digitalmars-d-learn
After reading 2.081 patchnotes about improvements with binding to cpp classes, I'm trying to test it - with simple examples and Qt as cpp library. My naive approach is to bind just a couple of used methods of specific classes (omitting others) and try to use it directly in D just with linking

Re: extern(C++): Unresolved scalar deleting destructor

2018-07-24 Thread Stefan Koch via Digitalmars-d-learn
On Tuesday, 24 July 2018 at 15:48:28 UTC, Vladimir Marchevsky wrote: After reading 2.081 patchnotes about improvements with binding to cpp classes, I'm trying to test it - with simple examples and Qt as cpp library. My naive approach is to bind just a couple of used methods of specific classe

Re: extern(C++): Unresolved scalar deleting destructor

2018-07-24 Thread Vladimir Marchevsky via Digitalmars-d-learn
On Tuesday, 24 July 2018 at 16:30:41 UTC, Stefan Koch wrote: Seems like it's virtual destructor could that be? this qt5 binding: https://github.com/MGWL/QtE5/blob/master/source/qte5.d seems to always define the constructor. No, simple virtual (or final) destructor binds just fine with "~thi

Re: Windows 7 x64. Prevent appearing of console with GUI application

2018-07-24 Thread ANtlord via Digitalmars-d-learn
On Tuesday, 24 July 2018 at 09:20:22 UTC, Mike Parker wrote: On Tuesday, 24 July 2018 at 08:09:33 UTC, ANtlord wrote: Anyway, if you are using OPTLINK or the MS Linker, try a test program without gtkD to make sure it works standalone for you. ``` import core.sys.windows.windows; void main()

Re: trait to get the body code of a function?

2018-07-24 Thread Guillaume Lathoud via Digitalmars-d-learn
On Tuesday, 24 July 2018 at 14:26:45 UTC, 12345swordy wrote: On Tuesday, 24 July 2018 at 05:27:36 UTC, rikki cattermole wrote: On 24/07/2018 4:43 PM, Guillaume Lathoud wrote: [...] Doesn't exist. Well, IMO it should exist as it can be quite useful for generating metainfo. Thanks for all

Re: extern(C++): Unresolved scalar deleting destructor

2018-07-24 Thread 12345swordy via Digitalmars-d-learn
On Tuesday, 24 July 2018 at 15:48:28 UTC, Vladimir Marchevsky wrote: After reading 2.081 patchnotes about improvements with binding to cpp classes, I'm trying to test it - with simple examples and Qt as cpp library. [...] Have you tried @disable ~this()? Alexander

Re: extern(C++): Unresolved scalar deleting destructor

2018-07-24 Thread Vladimir Marchevsky via Digitalmars-d-learn
On Tuesday, 24 July 2018 at 19:04:50 UTC, 12345swordy wrote: Have you tried @disable ~this()? Just tried: 1) no changes, still error about unresolved "QObject::`scalar deleting destructor'(unsigned int)". 2) marking destructor as @disable will actually disable it, right? But I want to use to

Re: extern(C++): Unresolved scalar deleting destructor

2018-07-24 Thread 12345swordy via Digitalmars-d-learn
On Tuesday, 24 July 2018 at 19:14:26 UTC, Vladimir Marchevsky wrote: On Tuesday, 24 July 2018 at 19:04:50 UTC, 12345swordy wrote: Have you tried @disable ~this()? Just tried: 1) no changes, still error about unresolved "QObject::`scalar deleting destructor'(unsigned int)". 2) marking destruct

Re: extern(C++): Unresolved scalar deleting destructor

2018-07-24 Thread Vladimir Marchevsky via Digitalmars-d-learn
On Tuesday, 24 July 2018 at 19:30:49 UTC, 12345swordy wrote: I found similar error messages regarding c++: https://stackoverflow.com/questions/42449063/vs-c-dll-scalar-deleteing-destructor Hmm, so looks like it's really because of virtual destructor, like Stefan mentioned before. Implementing

Re: trait to get the body code of a function?

2018-07-24 Thread rikki cattermole via Digitalmars-d-learn
On 25/07/2018 5:32 AM, Guillaume Lathoud wrote: Thanks for all the answers. I've just had a look at an alternative: using dmd as a package. However that's a lot of doc to browse... Maybe someone has experience with dmd as a package? Not a solution. Leaks memory, not reusable and in general not