Re: How can I create a Standalone Bundle Portable file application using Dlang?

2021-01-24 Thread Marcone via Digitalmars-d-learn
On Saturday, 23 January 2021 at 21:26:28 UTC, James Blachly wrote: On 1/20/21 6:50 AM, Marcone wrote: On Tuesday, 19 January 2021 at 14:20:06 UTC, Imperatorn wrote: On Tuesday, 19 January 2021 at 11:10:25 UTC, Marcone wrote: On Tuesday, 19 January 2021 at 06:25:31 UTC, Imperatorn wrote: On

Re: How can I create a Standalone Bundle Portable file application using Dlang?

2021-01-24 Thread Marcone via Digitalmars-d-learn
On Sunday, 24 January 2021 at 02:34:15 UTC, Jack wrote: On Monday, 18 January 2021 at 19:42:22 UTC, Marcone wrote: How can I create a Standalone Bundle Portable file application using Dlang? What are the dependencies that you would like to merge into executable? dlls? resources? Qt5 Dll's

Re: How can I create a Standalone Bundle Portable file application using Dlang?

2021-01-20 Thread Marcone via Digitalmars-d-learn
On Tuesday, 19 January 2021 at 14:20:06 UTC, Imperatorn wrote: On Tuesday, 19 January 2021 at 11:10:25 UTC, Marcone wrote: On Tuesday, 19 January 2021 at 06:25:31 UTC, Imperatorn wrote: On Monday, 18 January 2021 at 19:42:22 UTC, Marcone wrote: How can I create a Standalone Bundle Portable

Re: How can I create a Standalone Bundle Portable file application using Dlang?

2021-01-19 Thread Marcone via Digitalmars-d-learn
On Tuesday, 19 January 2021 at 06:25:31 UTC, Imperatorn wrote: On Monday, 18 January 2021 at 19:42:22 UTC, Marcone wrote: How can I create a Standalone Bundle Portable file application using Dlang? Could you describe what you mean with "Bundle portable file application"? All dependencies

How can I create a Standalone Bundle Portable file application using Dlang?

2021-01-18 Thread Marcone via Digitalmars-d-learn
How can I create a Standalone Bundle Portable file application using Dlang?

How define accepted types in a template parameter?

2021-01-16 Thread Marcone via Digitalmars-d-learn
For example, I want my function template to only accept integer or string;

Why many programmers don't like GC?

2021-01-13 Thread Marcone via Digitalmars-d-learn
I've always heard programmers complain about Garbage Collector GC. But I never understood why they complain. What's bad about GC?

Why D functions paramter can not implicit infer type of Variant?

2021-01-13 Thread Marcone via Digitalmars-d-learn
import std; void a(int b){ } void main() { Variant c = 10; a(c); // Error } Need more sugar.

How build DCD on Windows?

2021-01-11 Thread Marcone via Digitalmars-d-learn
Hi, Someone can Help me build exe dcd server and client on WIndows? Step by step? Becouse the informations disponible is very hard to undestand.

Re: How can I directly reffer literal element itself inside [] slice?

2021-01-11 Thread Marcone via Digitalmars-d-learn
On Monday, 11 January 2021 at 21:01:57 UTC, Paul Backus wrote: On Monday, 11 January 2021 at 15:45:51 UTC, Marcone wrote: I can reffer length of literal string using $. "Hello World"[0..$] But I want make like it witout use variable name. "Hello World"[0..?.indexOf("o")] The exact syntax

Re: How can I directly reffer literal element itself inside [] slice?

2021-01-11 Thread Marcone via Digitalmars-d-learn
On Monday, 11 January 2021 at 16:41:03 UTC, oddp wrote: On 11.01.21 16:45, Marcone via Digitalmars-d-learn wrote: "Hello World"[0..?.indexOf("o")] Does until [1] do the trick? "Hello World".until("o") // => "Hell" [1] https://dlang.or

How can I directly reffer literal element itself inside [] slice?

2021-01-11 Thread Marcone via Digitalmars-d-learn
I can reffer length of literal string using $. "Hello World"[0..$] But I want make like it witout use variable name. "Hello World"[0..?.indexOf("o")]

Re: How can I directly reffer literal element itself inside [] slice?

2021-01-11 Thread Marcone via Digitalmars-d-learn
I am using it: // Tipo Nulo. class None {} // Função slice() auto slice(T1, T2, T3 = None)(T1 conteudo, T2 inicio, T3 fim = T3.init) { int start, end, startlen; static if (is(T2 == int)) {inicio = inicio < 0 ? conteudo.length + inicio : inicio;} static if (is(T3 == int)) {fim =

How can I use file from resource .res without copy it to hard disc?

2021-01-11 Thread Marcone via Digitalmars-d-learn
I want use file direct from resource .res without copy it to hard disc. How can I make it?

Parameter with indetermined tuple elements type?

2021-01-11 Thread Marcone via Digitalmars-d-learn
I want to create a function that receive a tuple (need be a tuple) with indetermined length and indetermined elements type without template. The argument need be a tuple, but length and elements types indetermineds. How can I make it?

Re: Can alias compose! receive more than one argument?

2021-01-07 Thread Marcone via Digitalmars-d-learn
My mistake: alias a = compose!((x,y) => x*y);

Can alias compose! receive more than one argument?

2021-01-07 Thread Marcone via Digitalmars-d-learn
I get this eror: Example: alias a = compose!(x,y => x*y); writeln(a(2,5)); // Error: onlineapp.d(4): Error: undefined identifier x

Re: DConf talk : Exceptions will disappear in the future?

2021-01-05 Thread Marcone via Digitalmars-d-learn
Bye bye nothrow functions in Dlang.

What is the difference between "delegate()" and "lazy delegate()" ?

2021-01-02 Thread Marcone via Digitalmars-d-learn
Why "lazy delegate()" need two parentheses to execute function?

Why there is no support for Dlang to convert Qt Creator .ui file to Dlang .d for use with QtE5?

2021-01-01 Thread Marcone via Digitalmars-d-learn
I have a GUI created using Qt Creator and save it to .ui file. I can convert .ui file to .cpp or .py (C++ or Python), but I can not convert .ui to .d for use with Dlang and QtE5.

Re: UFCS functions with both pointers and refs

2020-12-18 Thread Marcone via Digitalmars-d-learn
Two differents types; Foo type and pointer type. Need function overload foe each or just use ref and avoid pointer.

CMD && comand not work

2020-12-10 Thread Marcone via Digitalmars-d-learn
In this very generic example && not work to finalize the instruct and start a new instruct. Yes, I know dmd can build and run without it, but this is only a example. execute(["cmd", "/c", "dmd test.d", "&&", "start test.exe"]); How can I substitute && ?

Re: My first application in Dlang

2020-12-02 Thread Marcone via Digitalmars-d-learn
On Thursday, 3 December 2020 at 02:44:40 UTC, Ali Çehreli wrote: On 12/2/20 5:46 PM, Marcone wrote: Hello, my name is Marcone, I live in Brazil, and I have been studying Dlang for a year. I finished my first application in Dlang with a graphical interface in Win32api and made it available on

My first application in Dlang

2020-12-02 Thread Marcone via Digitalmars-d-learn
Hello, my name is Marcone, I live in Brazil, and I have been studying Dlang for a year. I finished my first application in Dlang with a graphical interface in Win32api and made it available on the internet for anyone who wants to download it. Here is the program link. As a beginner in the D

Re: How make Optional pre determined parameter type without overload function?

2020-12-02 Thread Marcone via Digitalmars-d-learn
Now my slice works fine. // Tipo Nulo. class None {} // Função slice() auto slice(T1, T2, T3 = None)(T1 conteudo, T2 inicio, T3 fim = T3.init) { int start, end, startlen; static if (is(T2 == int)) {inicio = inicio < 0 ? conteudo.length + inicio : inicio;} static if (is(T3 == int))

Re: How make Optional pre determined parameter type without overload function?

2020-11-28 Thread Marcone via Digitalmars-d-learn
On Sunday, 29 November 2020 at 02:55:02 UTC, Ali Çehreli wrote: On 11/28/20 6:40 PM, Marcone wrote: void a(T1, T2)(T1 b, T2 c){ // I need parameter "c" optional, but only (String or int). How can I make it without overload function? } Since it's optional, T2 must have a default type. I

How make Optional pre determined parameter type without overload function?

2020-11-28 Thread Marcone via Digitalmars-d-learn
void a(T1, T2)(T1 b, T2 c){ // I need parameter "c" optional, but only (String or int). How can I make it without overload function? }

Re: How can I convert Hexadecimal to RGB Color and vice-versa?

2020-11-23 Thread Marcone via Digitalmars-d-learn
// Função hex2rgb() uint hex2rgb(string hexcolor) nothrow { try { uint value; hexcolor.stripLeft("#").formattedRead!"%x"(value); return value; } catch(Throwable){return 0;} } // Função rgb2hex() string rgb2hex(uint rgbcolor)

How Performance down slow it is using UFCS friendly function?

2020-11-20 Thread Marcone via Digitalmars-d-learn
// Função receive() char[] receive(Socket socket, int size = 8192) nothrow { try { char[] buffer; buffer.length = size; int rq = socket.receive(buffer); return buffer[0..rq]; } catch(Throwable){return null;} } s =

Re: Function Pointer Not Working

2020-11-19 Thread Marcone via Digitalmars-d-learn
I will wait with this code. WaitForSingleObject(threading, INFINITE);

Re: Function Pointer Not Working

2020-11-19 Thread Marcone via Digitalmars-d-learn
On Thursday, 19 November 2020 at 15:51:09 UTC, Kagamin wrote: The delegate is stored on the stack of the calling thread, the created thread loads it from there, but the calling thread doesn't wait for that and clobbers the stack right away. If you were lucky your code would crash. The thread

Re: Function Pointer Not Working

2020-11-19 Thread Marcone via Digitalmars-d-learn
Solved replacing this line: CreateThread(null, 0, &_fun, , 0, null); to this code: task!({CreateThread(null, 0, &_fun, , 0, null);}).executeInNewThread();

Function Pointer Not Working

2020-11-18 Thread Marcone via Digitalmars-d-learn
// Function threadingw() void threadingw(HWND hwn, void delegate() fun) nothrow { try { // Function _fun() extern(Windows) uint _fun(void * arg){ (*(cast(void delegate()*) arg))(); // Do not show "Hello World!" :(

Why can not use tray/catch inside finally block?

2020-11-16 Thread Marcone via Digitalmars-d-learn
Some operations in finally block may throw and can not be used inside nothrow functon. Why can not use tray/catch inside finally block?

How can I wrap SSL on Dlang Socket?

2020-11-15 Thread Marcone via Digitalmars-d-learn
How can I wrap SSL on Dlang Socket like I wrap in Python?

Re: How format UnixTime to "%Hh:%Mm:%Ss" ?

2020-11-14 Thread Marcone via Digitalmars-d-learn
On Sunday, 15 November 2020 at 03:15:29 UTC, Anonymouse wrote: On Sunday, 15 November 2020 at 03:08:48 UTC, Marcone wrote: On Sunday, 15 November 2020 at 02:29:20 UTC, Anonymouse wrote: On Sunday, 15 November 2020 at 01:04:41 UTC, Marcone wrote: auto mytime = Clock.currTime().toUnixTime()

Re: How format UnixTime to "%Hh:%Mm:%Ss" ?

2020-11-14 Thread Marcone via Digitalmars-d-learn
On Sunday, 15 November 2020 at 03:15:29 UTC, Anonymouse wrote: On Sunday, 15 November 2020 at 03:08:48 UTC, Marcone wrote: On Sunday, 15 November 2020 at 02:29:20 UTC, Anonymouse wrote: On Sunday, 15 November 2020 at 01:04:41 UTC, Marcone wrote: auto mytime = Clock.currTime().toUnixTime()

Re: How format UnixTime to "%Hh:%Mm:%Ss" ?

2020-11-14 Thread Marcone via Digitalmars-d-learn
On Sunday, 15 November 2020 at 02:29:20 UTC, Anonymouse wrote: On Sunday, 15 November 2020 at 01:04:41 UTC, Marcone wrote: auto mytime = Clock.currTime().toUnixTime() writeln(strftime("%Hh:%Mm:%Ss", mytime)); How can I make some like this in D? auto mytime = Clock.currTime;

Re: How format UnixTime to "%Hh:%Mm:%Ss" ?

2020-11-14 Thread Marcone via Digitalmars-d-learn
On Sunday, 15 November 2020 at 02:29:20 UTC, Anonymouse wrote: On Sunday, 15 November 2020 at 01:04:41 UTC, Marcone wrote: auto mytime = Clock.currTime().toUnixTime() writeln(strftime("%Hh:%Mm:%Ss", mytime)); How can I make some like this in D? auto mytime = Clock.currTime;

How format UnixTime to "%Hh:%Mm:%Ss" ?

2020-11-14 Thread Marcone via Digitalmars-d-learn
auto mytime = Clock.currTime().toUnixTime() writeln(strftime("%Hh:%Mm:%Ss", mytime)); How can I make some like this in D?

How can I set Timeout of Socket?

2020-11-14 Thread Marcone via Digitalmars-d-learn
Socket s = new Socket(AddressFamily.INET, SocketType.STREAM); s.connect(new InternetAddress("domain.com", 80)); I want that program raise an error if reach for example 30 seconds of timeout.

How can execute method in new Thread?

2020-11-14 Thread Marcone via Digitalmars-d-learn
My simple example code: import std; struct Fruit { string name; this(string name){ this.name = name; } void printmyname(){ writeln(this.name); } void showname(){ task!this.printmyname().executeInNewThread(); //

How add class or struct member after construction?

2020-11-05 Thread Marcone via Digitalmars-d-learn
How add class or struct member after construction? Is it possible in D? How?

I need a most simple and easy example to understand UDA.

2020-11-01 Thread Marcone via Digitalmars-d-learn
I need a most simple and easy example to understand UDA.

Re: Getting Qte5 to work

2020-10-28 Thread Marcone via Digitalmars-d-learn
Look this video https://www.youtube.com/watch?v=Es9Qs9_1ipk

How kill executables started with spawnShell or executeShell when program finish?

2020-10-27 Thread Marcone via Digitalmars-d-learn
Becouse my program use plink.exe running with spawnShell or executeShell. But when my program finish with some crash, or killed with windows task manager by user, Plink still running. How can I stop all process initialized with spawnShell or executeShell when program finish? I another works,

Re: How Stop Worker Thread if Owner Thread is Finished?

2020-10-27 Thread Marcone via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 12:16:01 UTC, Rene Zwanenburg wrote: On Tuesday, 27 October 2020 at 11:36:42 UTC, Marcone wrote: I want to use isDaemon to automatic stop worker thread if ownner thread is finished Terminating threads without properly unwinding the stack is generally a very bad

Re: How Stop Worker Thread if Owner Thread is Finished?

2020-10-27 Thread Marcone via Digitalmars-d-learn
I want to use isDaemon to automatic stop worker thread if ownner thread is finished

How Stop Worker Thread if Owner Thread is Finished?

2020-10-26 Thread Marcone via Digitalmars-d-learn
Because when the main thread is completed the worker thread continues to run.

How convert String to Fixed wchar Array?

2020-10-16 Thread Marcone via Digitalmars-d-learn
How convert String to Fixed wchar Array? import std; void main(){ string name = "Marvin"; wchar[255] wtext = name.to!(wchar[]); // Can not convert. writeln(wtext); }

How can I convert Hexadecimal to RGB Color and vice-versa?

2020-10-16 Thread Marcone via Digitalmars-d-learn
How can I convert Hexadecimal to RGB Color and vice-versa?

Re: Win32api: How to send a Struct in DialogBox?

2020-10-13 Thread Marcone via Digitalmars-d-learn
Solved: Teste * params = cast(Teste*) lParam; writeln(params.nome); writeln(params.idade); But here, how can send struct? DialogBoxParam(null, MAKEINTRESOURCE(IDD_DIALOG1), null, , cast(int) ); // Error, need "int" but I am sending Test*

Re: Win32api: How to send a Struct in DialogBox?

2020-10-13 Thread Marcone via Digitalmars-d-learn
DialogBoxParam receive need "int". How convert struct object reference to int and cast to struct type after? I will cast using: Teste * params = cast(Teste*) LOWORD(lParam); writeln(params.nome); writeln(params.idade); But here, how can send struct? DialogBoxParam(null,

Re: Win32api: How to send a Struct in DialogBox?

2020-10-13 Thread Marcone via Digitalmars-d-learn
On Tuesday, 13 October 2020 at 22:46:36 UTC, starcanopy wrote: On Tuesday, 13 October 2020 at 22:26:35 UTC, Marcone wrote: [...] Instead of calling DialogBox, you might try DialogBoxParam[A|W]. [...] - https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-dialogboxparamw

Win32api: How to send a Struct in DialogBox?

2020-10-13 Thread Marcone via Digitalmars-d-learn
struct Teste { string nome = "Paul"; int idade = 33; } extern(Windows): BOOL DlgMain(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) nothrow { // I want to be able to use the struct object here. // writeln(test.nome); return false; } void chamaJanela(){ Test

How to specify which parameters a function that is received as an argument should receive?

2020-10-13 Thread Marcone via Digitalmars-d-learn
How to specify which parameters a function that is received as an argument should receive? Example: import std; void myfun(int n){ writeln(n); } void test(lazy void delegate() fun) // how specify that "fun" may receive int ? { fun(int); } test({myfun;});

Re: Win32Api GetDlgItemText How make buffer with no fixed size?

2020-10-12 Thread Marcone via Digitalmars-d-learn
On Saturday, 10 October 2020 at 12:31:14 UTC, Adam D. Ruppe wrote: On Saturday, 10 October 2020 at 10:15:03 UTC, Marcone wrote: wchar[100] buffer; // I don't want fixed size :( wchar[] buffer; // no fixed size buffer.length = GetWindowTextLength(hwn); // set it to the text length of the

Win32Api GetDlgItemText How make buffer with no fixed size?

2020-10-10 Thread Marcone via Digitalmars-d-learn
wchar[100] buffer; // I don't want fixed size :( GetDlgItemText(hwn, widget, buffer.ptr, buffer.sizeof);

How auto convert Variant to required function arguments?

2020-10-08 Thread Marcone via Digitalmars-d-learn
How auto convert Variant to required function arguments?

How create Win32api Thread in Dlang?

2020-09-25 Thread Marcone via Digitalmars-d-learn
This is C++ code: #include WINAPI DWORD threadFunc(LPVOID x) { while (true) { try { throw 1; } catch (...) { } } return 0; } int main(int argc, char *argv[]) { CreateThread(NULL, 0, threadFunc, NULL, 0, NULL); CreateThread(NULL, 0, threadFunc, NULL, 0, NULL);

Re: I need "windowsx.d" Someone can send It to me?

2020-09-25 Thread Marcone via Digitalmars-d-learn
On Saturday, 26 September 2020 at 01:43:00 UTC, Denis Feklushkin wrote: On Saturday, 26 September 2020 at 00:40:21 UTC, Marcone wrote: On Friday, 25 September 2020 at 17:00:04 UTC, Denis Feklushkin wrote: On Friday, 25 September 2020 at 15:03:56 UTC, Marcone wrote: I need windowsx.d but for I

Re: I need "windowsx.d" Someone can send It to me?

2020-09-25 Thread Marcone via Digitalmars-d-learn
On Friday, 25 September 2020 at 17:00:04 UTC, Denis Feklushkin wrote: On Friday, 25 September 2020 at 15:03:56 UTC, Marcone wrote: I need windowsx.d but for I don't know the reason is not in dmd. Someone that have it can send to me? I don't know convert windowsx.h to windowsx.d Try to

I need "windowsx.d" Someone can send It to me?

2020-09-25 Thread Marcone via Digitalmars-d-learn
I need windowsx.d but for I don't know the reason is not in dmd. Someone that have it can send to me? I don't know convert windowsx.h to windowsx.d

How package Dlang in a standalone portable executable?

2020-08-31 Thread Marcone via Digitalmars-d-learn
I need package Dlang in a standalone portable executable. I need packcages all dependencies, dlls, files, etc in one executable file.

Re: Since DMD 2.089.0 and later, compiled .exe showing SFX zip and opening with winRar when use resource.

2020-08-30 Thread Marcone via Digitalmars-d-learn
On Wednesday, 19 August 2020 at 08:27:34 UTC, Kagamin wrote: On Tuesday, 18 August 2020 at 19:01:17 UTC, Marcone wrote: SFX zip in it is properties: https://i.imgur.com/dH7jl5n.png Opening with winRar: https://i.imgur.com/s7C9mZn.png Probably winrar messing with your file manager. Try to

Since DMD 2.089.0 and later, compiled .exe showing SFX zip and opening with winRar when use resource.

2020-08-18 Thread Marcone via Digitalmars-d-learn
When I compile the source .d code to .exe adding an icon using resource .res file in dmd 2.089.0 and later, the .exe file show SFX zip in it is properties and open with winRar. This ir normal or is a Bug? See images below. Se image in this links: SFX zip in it is properties:

How Install and Configure DCD (D Completion Daemon) on Sublime Text?

2020-07-20 Thread Marcone via Digitalmars-d-learn
How Install and Configure DCD (D Completion Daemon) on Sublime Text? I need auto complete for the Dlang in Sublime Text.

Re: How spand array for use with functions arguments like tuple?

2020-07-20 Thread Marcone via Digitalmars-d-learn
On Sunday, 19 July 2020 at 23:05:45 UTC, Marcone wrote: How spand array for use with functions arguments like tuple? expand*

How spand array for use with functions arguments like tuple?

2020-07-19 Thread Marcone via Digitalmars-d-learn
How spand array for use with functions arguments like tuple?

How can I get Phobos Runtime Library docummentation in PDF?

2020-07-17 Thread Marcone via Digitalmars-d-learn
I need full Phobos Runtime Library docummentation in only one PDF file.

Re: How import DUB packcages directly and compile with DMD without use dub.exe?

2020-07-16 Thread Marcone via Digitalmars-d-learn
On Thursday, 16 July 2020 at 11:52:39 UTC, Andre Pany wrote: On Thursday, 16 July 2020 at 11:06:01 UTC, Marcone wrote: I just want import in file and run with dmd. Execute dub build with verbose output. You will find the info how dub is calling dmd. Kind regards Andre dub is calling dmd

How import DUB packcages directly and compile with DMD without use dub.exe?

2020-07-16 Thread Marcone via Digitalmars-d-learn
I just want import in file and run with dmd.

Error: `std.uni.isUpper` conflicts with `std.ascii.isUpper`

2020-07-14 Thread Marcone via Digitalmars-d-learn
import std: isUpper, writeln; void main(){ writeln(isUpper('A')); } Why I get this error? How can I use isUpper()?

Re: How can I make executeShell ask for Admin Elevation?

2020-07-13 Thread Marcone via Digitalmars-d-learn
On Monday, 13 July 2020 at 12:28:24 UTC, aberba wrote: On Monday, 13 July 2020 at 00:57:02 UTC, Marcone wrote: On Sunday, 12 July 2020 at 02:10:11 UTC, Marcone wrote: I don't want start program with admin elevation, but ask user for admin permission when some function is called. alias runas

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Marcone via Digitalmars-d-learn
On Sunday, 12 July 2020 at 02:10:11 UTC, Marcone wrote: I don't want start program with admin elevation, but ask user for admin permission when some function is called. alias runas = compose!(x => to!bool((cast(int) x) > 32), x => ShellExecute(null, "runas", "cmd", cast(wchar*) "/c \"cd /d %s

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Marcone via Digitalmars-d-learn
On Sunday, 12 July 2020 at 21:50:06 UTC, Ali Çehreli wrote: On 7/11/20 7:10 PM, Marcone wrote: [...] Here is a hacky solution that attempts the command and fails back to asking the password. It should work on POSIX systems. (Tested on Linux.) [...] I need for Windows, it not work on

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Marcone via Digitalmars-d-learn
On Sunday, 12 July 2020 at 17:28:01 UTC, Kagamin wrote: I mean runas your own program. I need a function that ask for admin at runtime only for one function

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Marcone via Digitalmars-d-learn
On Sunday, 12 July 2020 at 17:19:08 UTC, Kagamin wrote: Well, you can elevate your own program and tell it to run that command, collect the result and send it back through e.g. shared memory. I don't want start with elevation, becouse program must be avaliable even user is not admin. Only

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Marcone via Digitalmars-d-learn
On Sunday, 12 July 2020 at 02:10:11 UTC, Marcone wrote: I don't want start program with admin elevation, but ask user for admin permission when some function is called. How can I get return code ans stdout of this code: ShellExecute(null, "runas", "cmd", "/c netsh winhttp set proxy

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Marcone via Digitalmars-d-learn
On Sunday, 12 July 2020 at 12:31:17 UTC, Kagamin wrote: You call ShellExecute with "runas" verb: https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutea I need return code and stdout.

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Marcone via Digitalmars-d-learn
On Sunday, 12 July 2020 at 12:31:17 UTC, Kagamin wrote: You call ShellExecute with "runas" verb: https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutea Please give me a litle simple example ruining this command: "netsh winhttp set proxy 127.0.0.1:"

How can I make executeShell ask for Admin Elevation?

2020-07-11 Thread Marcone via Digitalmars-d-learn
I don't want start program with admin elevation, but ask user for admin permission when some function is called.

How can I make DMD stop on the first fatal error? (-Wfatal-errors)

2020-07-07 Thread Marcone via Digitalmars-d-learn
How can I make DMD stop on the first fatal error like -Wfatal-errors on C++?

Re: I need an Easy example to understand Alias This

2020-07-06 Thread Marcone via Digitalmars-d-learn
On Tuesday, 7 July 2020 at 00:42:40 UTC, Ali Çehreli wrote: On 7/6/20 5:35 PM, Marcone wrote: Hi, I study Dlang for one year, and I can't understand alias this. I need an Easy example to understand Alias This. Is the following example useful? http://ddili.org/ders/d.en/alias_this.html Ali

I need an Easy example to understand Alias This

2020-07-06 Thread Marcone via Digitalmars-d-learn
Hi, I study Dlang for one year, and I can't understand alias this. I need an Easy example to understand Alias This.

Re: How can I check if an element is iterable?

2020-05-04 Thread Marcone via Digitalmars-d-learn
On Monday, 4 May 2020 at 01:49:28 UTC, Ali Çehreli wrote: On 5/3/20 1:44 PM, Marcone wrote: [...] Still, the type of a variable would determine whether whether it's iterable. As an improvement, the following program can be changed to call use() recursively to visit all members of e.g.

How can I do dmd omite error when if compare two different data types ? (-fpermissive)

2020-05-03 Thread Marcone via Digitalmars-d-learn
In C++ I just use -fpermissive foreach(i; tuple(10, "lemon", false, "John", 1.6, 'c')) { writeln(i); if(i == "John") break; // Error }

Re: How can I check if an element is iterable?

2020-05-03 Thread Marcone via Digitalmars-d-learn
On Sunday, 3 May 2020 at 20:46:30 UTC, Adam D. Ruppe wrote: On Sunday, 3 May 2020 at 20:21:24 UTC, Marcone wrote: How can I check if a variable is iterable? Every variable has a type. You can get it with typeof(varaiable) I need in runtime.

Re: How can I check if an element is iterable?

2020-05-03 Thread Marcone via Digitalmars-d-learn
On Sunday, 3 May 2020 at 20:11:58 UTC, Adam D. Ruppe wrote: On Sunday, 3 May 2020 at 20:02:09 UTC, Marcone wrote: How can I check if an element is iterable in Dlang? http://dpldocs.info/experimental-docs/std.traits.isIterable.html I don't want to check if type is iterable, but if variable

Re: How can I check if an element is iterable?

2020-05-03 Thread Marcone via Digitalmars-d-learn
On Sunday, 3 May 2020 at 20:11:58 UTC, Adam D. Ruppe wrote: On Sunday, 3 May 2020 at 20:02:09 UTC, Marcone wrote: How can I check if an element is iterable in Dlang? http://dpldocs.info/experimental-docs/std.traits.isIterable.html Not working. How can I check if a variable is iterable?

How can I check if an element is iterable?

2020-05-03 Thread Marcone via Digitalmars-d-learn
How can I check if an element is iterable in Dlang?

Re: GUI library for DMD 2.090 or DMD 2.091

2020-04-25 Thread Marcone via Digitalmars-d-learn
On Friday, 24 April 2020 at 13:45:22 UTC, Phrozen wrote: I'm too new to DLang and I have a lot to learn. Probably that's why I have a lot of difficulties. Has anyone tried using a GUI library to the latest DMD 2.090 or DMD 2.091? I plan to use this language for a specific Thermal calculator

Re: What is the best way to refer to itself when obtaining Substring of a literal?

2020-04-25 Thread Marcone via Digitalmars-d-learn
On Saturday, 25 April 2020 at 01:32:54 UTC, 9il wrote: On Friday, 24 April 2020 at 22:24:34 UTC, Marcone wrote: I don't want to use lambda. I don't want create variable. What is the best way to refer to itself when obtaining Substring withou using lambda and without create variable?

Re: What is the best way to refer to itself when obtaining Substring of a literal?

2020-04-25 Thread Marcone via Digitalmars-d-learn
On Saturday, 25 April 2020 at 03:47:33 UTC, SrMordred wrote: On Friday, 24 April 2020 at 22:24:34 UTC, Marcone wrote: I don't want to use lambda. I don't want create variable. What is the best way to refer to itself when obtaining Substring withou using lambda and without create variable?

What is the best way to refer to itself when obtaining Substring of a literal?

2020-04-24 Thread Marcone via Digitalmars-d-learn
I don't want to use lambda. I don't want create variable. What is the best way to refer to itself when obtaining Substring withou using lambda and without create variable? example: writeln("Hello Word!"[x.indexOf(" "), $]);

How make DMD auto link imported modules?

2020-04-21 Thread Marcone via Digitalmars-d-learn
When I create a module, for exemple mymodule.d and import im my main program using "import mymodule" I need add mymodule.d in DMD command line manually. How can make it automatic?

How convert String to Hex?

2020-04-18 Thread Marcone via Digitalmars-d-learn
How convert String to Hex? Example: string text = "Hello World"; // Converted to Hex = 48656c6c6f20576f726c64

Re: How user dub packages in dmd without dub.exe ?

2020-04-12 Thread Marcone via Digitalmars-d-learn
On Sunday, 5 April 2020 at 14:19:40 UTC, WebFreak001 wrote: On Sunday, 5 April 2020 at 14:02:19 UTC, Baby Beaker wrote: On Saturday, 4 April 2020 at 21:54:34 UTC, Andre Pany wrote: On Saturday, 4 April 2020 at 20:21:03 UTC, Marcone wrote: [...] [...] If you can copy the D packages from the

Re: How user dub packages in dmd without dub.exe ?

2020-04-05 Thread Marcone via Digitalmars-d-learn
On Sunday, 5 April 2020 at 14:02:19 UTC, Baby Beaker wrote: On Saturday, 4 April 2020 at 21:54:34 UTC, Andre Pany wrote: On Saturday, 4 April 2020 at 20:21:03 UTC, Marcone wrote: [...] Ag the end dub is calling DMD/LDC with some arguments. You can run dub with verbose output and check the

How user dub packages in dmd without dub.exe ?

2020-04-04 Thread Marcone via Digitalmars-d-learn
I want import modules from dub packages in my program.d and run using dmd.exe without dub.exe. How can I make it? Becouse when I try to import it says that can not found.

  1   2   >