How add resource.res in RDMD

2020-02-01 Thread Marcone via Digitalmars-d-learn
I like use rdmd when I am programming. But I need that the program use resource file becouse I am creating program with gui win32api. How can I add resource when use rdmd?

Re: Is it possible to use DMD as a library to compile strings at runtime?

2020-02-01 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Feb 02, 2020 at 03:16:46AM +, Saurabh Das via Digitalmars-d-learn wrote: > On Saturday, 1 February 2020 at 20:37:03 UTC, H. S. Teoh wrote: [...] > > I've actually done this before in an equation grapher program: the > > user inputs an equation, the program generates D code to compute t

Re: Is it possible to use DMD as a library to compile strings at runtime?

2020-02-01 Thread Saurabh Das via Digitalmars-d-learn
On Saturday, 1 February 2020 at 20:37:03 UTC, H. S. Teoh wrote: On Sat, Feb 01, 2020 at 08:01:34PM +, Andre Pany via Digitalmars-d-learn wrote: [...] Another approach: - include the dmd compiler package with your application - within your app call the compiler executable and compile the sou

Re: More vibe.d : Receiving Post params

2020-02-01 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/1/20 7:55 PM, seany wrote: How do I intercept POST params? Thank you Look at req.form for POST parameters. They are not unified with queryString. https://vibed.org/api/vibe.http.server/HTTPServerRequest.form -Steve

More vibe.d : Receiving Post params

2020-02-01 Thread seany via Digitalmars-d-learn
Consider this : import vibe.vibe; import std.conv; ushort port = 5502; void main(char[][] args) { auto router = new URLRouter; router.post("/archive", &savedata); router.get("/archive", &savedata); auto settings = new HTTPServerSetting

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 22:25:38 UTC, Danny Arends wrote: On Saturday, 1 February 2020 at 20:06:42 UTC, seany wrote: [...] Hey Seany, A quick follow up post. I think/suspect that something might be broken in your dub installation if the mean import is not found. This is the first im

Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
I solved this by following: sudo wget https://netcologne.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list sudo apt-get update --allow-insecure-repositories sudo apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring sudo apt-get update && s

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread Danny Arends via Digitalmars-d-learn
On Saturday, 1 February 2020 at 20:06:42 UTC, seany wrote: On Saturday, 1 February 2020 at 14:42:58 UTC, Seb wrote: On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote: Hi I want to start a small server, that will be accessible form outside. Not a huge deal right? Not quite. [...] Wh

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread Danny Arends via Digitalmars-d-learn
On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote: Hi I want to start a small server, that will be accessible form outside. Not a huge deal right? Not quite. My machine: 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux DMD : DMD64 D Compile

How to explicitly state the expression in with(...)?

2020-02-01 Thread Robert M. Münch via Digitalmars-d-learn
I have quite often this pattern: with(x.y.z){ xyzFunc(); // = x.y.z.xyzFunc() myFunc(x.y.z, ...); } and it would be cool to write: with(t = x.y.z){ // work like an implicit alias xyzFunc(); // = x.y.z.xyzFunc() myFunc(t, ...); } Is there anything which

Re: Is it possible to use DMD as a library to compile strings at runtime?

2020-02-01 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Feb 01, 2020 at 08:01:34PM +, Andre Pany via Digitalmars-d-learn wrote: [...] > Another approach: > - include the dmd compiler package with your application > - within your app call the compiler executable and compile the source > code to a dll / so > - call the dll / so function [...]

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 14:42:58 UTC, Seb wrote: On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote: Hi I want to start a small server, that will be accessible form outside. Not a huge deal right? Not quite. [...] What version of dub did you install? 1.19 should be the latest

Re: Is it possible to use DMD as a library to compile strings at runtime?

2020-02-01 Thread Andre Pany via Digitalmars-d-learn
On Friday, 31 January 2020 at 11:19:37 UTC, Saurabh Das wrote: I see that DUB has DMD as a library package, but I was not able to understand how to use it. Is it possible to use DMD as a library within a D program to compile a string to machine code and run the compiled code at runtime? Tha

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 14:42:58 UTC, Seb wrote: On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote: Hi I want to start a small server, that will be accessible form outside. Not a huge deal right? Not quite. [...] What version of dub did you install? 1.19 should be the latest

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 14:30:36 UTC, Steven Schveighoffer wrote: How is your network connection to the dub server? Maybe there is a separate problem with network connectivity. This thing works for me (dub upgrade takes about 2.5 seconds and finishes). How long does it take for your

Re: Unexpected issue with std.format

2020-02-01 Thread Saurabh Das via Digitalmars-d-learn
On Saturday, 1 February 2020 at 15:16:41 UTC, Steven Schveighoffer wrote: On 2/1/20 8:39 AM, Saurabh Das wrote: I faced this issue while working with custom formatting for a struct. I have reduced the error down to this test program: import std.format, std.stdio, std.array; struct Test1 {   

Re: Unexpected issue with std.format

2020-02-01 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/1/20 8:39 AM, Saurabh Das wrote: I faced this issue while working with custom formatting for a struct. I have reduced the error down to this test program: import std.format, std.stdio, std.array; struct Test1 {     void toString(W, C)(ref W w, scope const ref FormatSpec!C fmt)     {   

Re: How to call a extern C++ class constructor ?

2020-02-01 Thread kinke via Digitalmars-d-learn
On Saturday, 1 February 2020 at 14:52:21 UTC, kinke wrote: Trivial cases like yours should actually work wrt. using C++ ctor implementations from D IIRC. Ah, you need at least one virtual function in the C++ class (because D always reserves a vptr, the pointer to the class vtable).

Re: How to call a extern C++ class constructor ?

2020-02-01 Thread kinke via Digitalmars-d-learn
On Saturday, 1 February 2020 at 08:15:20 UTC, Luhrel wrote: But somehow I got a segfault on dcpp.getNumber(true). That's because you declare it as virtual in D (default for classes, use `final`), but non-virtual in C++. You also forgot to add the class field to the D declaration (yes, D needs

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread Seb via Digitalmars-d-learn
On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote: Hi I want to start a small server, that will be accessible form outside. Not a huge deal right? Not quite. [...] What version of dub did you install? 1.19 should be the latest.

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/1/20 6:15 AM, seany wrote: $ dub init server -t vibe.d Package recipe format (sdl/json) [json]: Name [server]: Description [A simple vibe.d server application.]: Author name [root]: License [proprietary]: Copyright string [Copyright © 2020, root]: Add dependency (leave empty to skip) []: S

Re: Unexpected issue with std.format

2020-02-01 Thread Saurabh Das via Digitalmars-d-learn
On Saturday, 1 February 2020 at 13:39:34 UTC, Saurabh Das wrote: I faced this issue while working with custom formatting for a struct. I have reduced the error down to this test program: [...] PS: Currently using DMD64 D Compiler v2.090.0

Unexpected issue with std.format

2020-02-01 Thread Saurabh Das via Digitalmars-d-learn
I faced this issue while working with custom formatting for a struct. I have reduced the error down to this test program: import std.format, std.stdio, std.array; struct Test1 { void toString(W, C)(ref W w, scope const ref FormatSpec!C fmt) { pragma(msg, "Test1 function compiled

GtkDcoding Featured Coder Program

2020-02-01 Thread Ron Tarrant via Digitalmars-d-learn
Everybody knows what I’ve been doing with GtkD for the last year—writing blog posts. But what about all of you? What projects are you working on using GtkD? What finished applications do you have that use GtkD? Or maybe you’re still in the planning stages. I’d like to start a new series of pos

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 11:15:49 UTC, seany wrote: On Saturday, 1 February 2020 at 11:08:46 UTC, Ferhat Kurtulmuş wrote: [...] I even tried: $ dub fetch dub Fetching dub 1.19.0... Please note that you need to use `dub run ` or add it to dependencies of your package to actually use/ru

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 11:08:46 UTC, Ferhat Kurtulmuş wrote: Have you tried dub upgrade $ dub init server -t vibe.d Package recipe format (sdl/json) [json]: Name [server]: Description [A simple vibe.d server application.]: Author name [root]: License [proprietary]: Copyright string

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 1 February 2020 at 11:02:45 UTC, seany wrote: On Saturday, 1 February 2020 at 10:58:14 UTC, Ferhat Kurtulmuş wrote: On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote: As suggested, i try to build dub from github, following: https://github.com/dlang/dub/releases I don't

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 10:58:14 UTC, Ferhat Kurtulmuş wrote: On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote: As suggested, i try to build dub from github, following: https://github.com/dlang/dub/releases I don't know if it is a solution. But you can try using ~master bra

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote: As suggested, i try to build dub from github, following: https://github.com/dlang/dub/releases I don't know if it is a solution. But you can try using ~master branch, not a release on GitHub. You can also try my vibed app skeleton

Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
Hi I want to start a small server, that will be accessible form outside. Not a huge deal right? Not quite. My machine: 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux DMD : DMD64 D Compiler v2.090.0 Copyright (C) 1999-2019 by The D Language Foundat

Re: How to call a extern C++ class constructor ?

2020-02-01 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 1 February 2020 at 10:21:54 UTC, norm wrote: On Saturday, 1 February 2020 at 08:38:22 UTC, Luhrel wrote: On Saturday, 1 February 2020 at 08:32:51 UTC, Ferhat Kurtulmuş wrote: On Saturday, 1 February 2020 at 08:27:07 UTC, Luhrel wrote: On Saturday, 1 February 2020 at 08:21:29 UTC, F

Re: How to call a extern C++ class constructor ?

2020-02-01 Thread norm via Digitalmars-d-learn
On Saturday, 1 February 2020 at 08:38:22 UTC, Luhrel wrote: On Saturday, 1 February 2020 at 08:32:51 UTC, Ferhat Kurtulmuş wrote: On Saturday, 1 February 2020 at 08:27:07 UTC, Luhrel wrote: On Saturday, 1 February 2020 at 08:21:29 UTC, Ferhat Kurtulmuş wrote: You cannot. https://dlang.org/sp

Re: Question about alias and getOverloads

2020-02-01 Thread uranuz via Digitalmars-d-learn
OK. Thanks. Created two reports related to these questions: https://issues.dlang.org/show_bug.cgi?id=20553 https://issues.dlang.org/show_bug.cgi?id=20555

Re: How to call a extern C++ class constructor ?

2020-02-01 Thread Luhrel via Digitalmars-d-learn
On Saturday, 1 February 2020 at 08:32:51 UTC, Ferhat Kurtulmuş wrote: On Saturday, 1 February 2020 at 08:27:07 UTC, Luhrel wrote: On Saturday, 1 February 2020 at 08:21:29 UTC, Ferhat Kurtulmuş wrote: You cannot. https://dlang.org/spec/cpp_interface.html#using_cpp_classes_from_d You must use

Re: How to call a extern C++ class constructor ?

2020-02-01 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 1 February 2020 at 08:27:07 UTC, Luhrel wrote: On Saturday, 1 February 2020 at 08:21:29 UTC, Ferhat Kurtulmuş wrote: You cannot. https://dlang.org/spec/cpp_interface.html#using_cpp_classes_from_d You must use a factory method like createInstance. Oh I see, so there's definitiv

Re: How to call a extern C++ class constructor ?

2020-02-01 Thread Luhrel via Digitalmars-d-learn
On Saturday, 1 February 2020 at 08:21:29 UTC, Ferhat Kurtulmuş wrote: You cannot. https://dlang.org/spec/cpp_interface.html#using_cpp_classes_from_d You must use a factory method like createInstance. Oh I see, so there's definitively no way to call a c++ ctor without modifying the c++ code

Re: How to call a extern C++ class constructor ?

2020-02-01 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 1 February 2020 at 08:15:20 UTC, Luhrel wrote: Hello there, I would like to know how can I call a C++ ctor. [...] You cannot. https://dlang.org/spec/cpp_interface.html#using_cpp_classes_from_d You must use a factory method like createInstance.

How to call a extern C++ class constructor ?

2020-02-01 Thread Luhrel via Digitalmars-d-learn
Hello there, I would like to know how can I call a C++ ctor. Actually, I have this: C++: CppClass.cpp #include "CppClass.h" AmazingCppClass::AmazingCppClass() { number = 124; } int AmazingCppClass::getNumber(bool show) { if (show) printf("Numb

Re: How make Executable Dlang EXE ask for "Run as Administrator"?

2020-02-01 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 1 February 2020 at 06:26:04 UTC, Marcone wrote: I created a program in Dlang and compiled to exe using dmd. But my program need administrator privileges. How can I make executable dlang program ask for administrator privileges on start up program? Disclaimer: did not tried. You m