environment["PATH"] ~= r";D:\folder\"; // Error
On Friday, 6 March 2020 at 05:31:57 UTC, Mathias Lang wrote:
On Friday, 6 March 2020 at 04:56:28 UTC, Marcone wrote:
Is it possible change compile time errors to runtime errors in
Dlang?
If yes, how can I make it?
No it's not possible, D is a statically typed language.
Why would you want erro
Is it possible change compile time errors to runtime errors in
Dlang?
If yes, how can I make it?
On Monday, 24 February 2020 at 19:28:43 UTC, Adam D. Ruppe wrote:
On Monday, 24 February 2020 at 19:27:04 UTC, Marcone wrote:
I live in Brazil and speak português brasileiro and need make
programs that is good with words like ã, á, ç, ê, etc.
Regular string works with those just fine too.
I live in Brazil and speak português brasileiro and need make
programs that is good with words like ã, á, ç, ê, etc. How can I
make wstring or dstring default for string and literals? I don't
want to explicit this every time.
Programming in D - Tutorial and Reference 1st Edition
Free PDF Book.
Download: http://ddili.org/ders/d.en/index.html
On Friday, 7 February 2020 at 06:20:09 UTC, novice2 wrote:
import std.conv: to;
string str = "test1";
wstring[] wstr = [to!wstring(str)];
Thank you!
You don't need an IDE for run Dlang. I Use "Sublime Text". Very
good for Dlang.
Solved adding this code in resource.rc, converted to resource.res
and linked to .d source.
This code add the file "manifest.manifest" to resource.
1 24 "manifest.manifest"
How to converte "string" to wstring[] in Dlang?
Sorry! Solved. Just need add # in this line:
get_resource("#300", "BMP", "melancia.bmp");
I get resource "melancia.bmp" but the file is corrupted.
// 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 = CreateFile(path_nam
On Saturday, 1 February 2020 at 08:14:19 UTC, Ferhat Kurtulmuş
wrote:
On Saturday, 1 February 2020 at 06:26:04 UTC, Marcone wrote:
[...]
Disclaimer: did not tried. You must somehow embed this manifest
file into your exe using some linker parameter. Or put this
manifest next to your exe by n
On Monday, 3 February 2020 at 05:11:30 UTC, Boris Carvajal wrote:
On Monday, 3 February 2020 at 03:03:20 UTC, Marcone wrote:
On Sunday, 2 February 2020 at 06:03:06 UTC, Marcone wrote:
I like use rdmd when I am programming. But I need that the
program use resource file becouse I am creating prog
On Sunday, 2 February 2020 at 06:03:06 UTC, Marcone wrote:
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?
No one knows how add resource .res file in rdmd?
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?
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?
On Thursday, 30 January 2020 at 04:29:42 UTC, bauss wrote:
On Thursday, 30 January 2020 at 03:49:29 UTC, Marcone wrote:
I created a GUI using "ResEdit Resource Editor" and embeded to
Dlang using this code above. Now I want to change the window
Backgound Color when press a Button. How can I make
I created a GUI using "ResEdit Resource Editor" and embeded to
Dlang using this code above. Now I want to change the window
Backgound Color when press a Button. How can I make it?
import core.sys.windows.windows;
import core.sys.windows.commctrl;
import std.stdio;
pragma(lib, "gdi32.lib");
pra
How to convert "string" to const(wchar)* ?
The code bellow is making confuse strange characters.
cast(wchar*) str
On Monday, 27 January 2020 at 13:41:13 UTC, Ferhat Kurtulmuş
wrote:
On Monday, 27 January 2020 at 13:24:03 UTC, Marcone wrote:
On Monday, 27 January 2020 at 13:07:20 UTC, rumbu wrote:
[...]
Thank you very much! But I have this error when I try to
compile:
Error 42: Symbol Undefined _InitCo
On Monday, 27 January 2020 at 13:07:20 UTC, rumbu wrote:
On Monday, 27 January 2020 at 11:34:47 UTC, Marcone wrote:
[...]
Translated (including errors & comments):
import core.sys.windows.windows;
import core.sys.windows.commctrl;
import std.stdio;
HINSTANCE hInst;
extern(Windows):
BOOL D
#include
#include
#include
#include "resource.h"
#include
HINSTANCE hInst;
BOOL CALLBACK DlgMain(HWND hwndDlg, UINT uMsg, WPARAM wParam,
LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
{
}
return TRUE;
case WM_CLOSE:
{
EndDialog(hwndDlg, 0);
On Thursday, 16 January 2020 at 13:36:10 UTC, Namal wrote:
Hello, what is the way to remove whitespace from a string (not
only at the beginning and end)..
import std;
void main(){
string name = " Marvin Will ";
writeln(name.replace(" ", "")); // MarvinWill
}
On Saturday, 11 January 2020 at 14:21:25 UTC, Adam D. Ruppe wrote:
On Saturday, 11 January 2020 at 12:22:25 UTC, Marcone wrote:
wchar[1024] szFileName = 0;
ofn.lpstrFile = cast(LPWSTR) szFileName;
You shouldn't cast there, just use `szFileName.ptr` instead.
ofn.nMaxFile = MAX_PAT
On Friday, 10 January 2020 at 14:48:49 UTC, Marcone wrote:
How create "Open" and "Save as" Dialog using "Win32 Api" and
Dlang? Please send me a simple example code in Dlang. Thank you
very much.
Solution:
import std;
import core.sys.windows.windows;
pragma(lib, "comdlg32");
// Function askop
On Friday, 10 January 2020 at 14:48:49 UTC, Marcone wrote:
How create "Open" and "Save as" Dialog using "Win32 Api" and
Dlang? Please send me a simple example code in Dlang. Thank you
very much.
This code works, but I can't get file Path. Someone can help me?
import std;
import core.sys.windo
On Saturday, 11 January 2020 at 00:12:03 UTC, René Heldmaier
wrote:
On Friday, 10 January 2020 at 14:48:49 UTC, Marcone wrote:
How create "Open" and "Save as" Dialog using "Win32 Api" and
Dlang? Please send me a simple example code in Dlang. Thank
you very much.
Have a look at this website:
On Friday, 10 January 2020 at 15:44:53 UTC, Mike Parker wrote:
On Friday, 10 January 2020 at 15:06:07 UTC, Marcone wrote:
Very complicated. Can you send me the simple clear code?
https://docs.microsoft.com/en-us/windows/win32/dlgbox/using-common-dialog-boxes
Not compile in Dlang.
On Friday, 10 January 2020 at 14:52:36 UTC, Adam D. Ruppe wrote:
On Friday, 10 January 2020 at 14:48:49 UTC, Marcone wrote:
How create "Open" and "Save as" Dialog using "Win32 Api" and
Dlang? Please send me a simple example code in Dlang. Thank
you very much.
You just call GetOpenFileName or
How create "Open" and "Save as" Dialog using "Win32 Api" and
Dlang? Please send me a simple example code in Dlang. Thank you
very much.
On Thursday, 9 January 2020 at 21:55:26 UTC, Dennis wrote:
On Thursday, 9 January 2020 at 13:04:33 UTC, Marcone wrote:
[...]
Windows has the 'common dialog' module with a ChooseColor
function you can use.
[...]
Very Good! Working very well!
I am creating a GUI using winsamp.d as model.
See the window here: https://i.ibb.co/ZJ4v2KD/Sem-t-tulo.png
I want to ask a user for choose a color when click
Configuration/Color, and then change backgroud color of GUI. But
how can I create a Color Dialog? There's dlang example in the web
and I
On Sunday, 5 January 2020 at 15:13:17 UTC, Rumbu wrote:
On Sunday, 5 January 2020 at 13:33:35 UTC, Marcone wrote:
I am using this code to load icon from local directory, but I
want to load icon from resource.res file:
wndclass.hIcon = LoadImage( NULL, "icon.ico", IMAGE_ICON, 0,
0, LR_LOADFRO
I am using this code to load icon from local directory, but I
want to load icon from resource.res file:
wndclass.hIcon = LoadImage( NULL, "icon.ico", IMAGE_ICON, 0, 0,
LR_LOADFROMFILE| LR_SHARED | LR_LOADTRANSPARENT);
On Friday, 3 January 2020 at 05:12:21 UTC, Marcone wrote:
Using dmd run compile very whell:
dmd Program.obj cpp.obj
But with rdmd not work.
extern(C++) void teste();
void main(){
teste();
}
OPTLINK (R) for Win32 Release 8.00.17
Copyright (C) Digital Mars 1989-2013 All rights rese
Using dmd run compile very whell:
dmd Program.obj cpp.obj
But with rdmd not work.
On Wednesday, 25 December 2019 at 12:39:08 UTC, BoQsc wrote:
Are there any other ways to join two strings without Tilde ~
character?
I can't seems to find anything about Tilde character
concatenation easily, nor the alternatives to it. Can someone
share some knowledge on this or at least point
On Wednesday, 25 December 2019 at 12:39:08 UTC, BoQsc wrote:
Are there any other ways to join two strings without Tilde ~
character?
I can't seems to find anything about Tilde character
concatenation easily, nor the alternatives to it. Can someone
share some knowledge on this or at least point
On Monday, 30 December 2019 at 14:56:59 UTC, mipri wrote:
On Monday, 30 December 2019 at 10:23:14 UTC, Marcone wrote:
On Monday, 30 December 2019 at 09:41:55 UTC, mipri wrote:
This leaks too much.
writeln("Helo {} {}".format("xx", "name")); // Helo xx name
writeln("Helo {} {}".format("{}
On Monday, 30 December 2019 at 14:56:59 UTC, mipri wrote:
On Monday, 30 December 2019 at 10:23:14 UTC, Marcone wrote:
On Monday, 30 December 2019 at 09:41:55 UTC, mipri wrote:
This leaks too much.
writeln("Helo {} {}".format("xx", "name")); // Helo xx name
writeln("Helo {} {}".format("{}
On Monday, 30 December 2019 at 09:41:55 UTC, mipri wrote:
On Monday, 30 December 2019 at 06:47:37 UTC, Marcone wrote:
Use Python format() style:
import std;
import std: Format = format;
// format()
string format(T...)(T text){
string texto = text[0];
foreach(count, i; text[1..$
On Wednesday, 25 December 2019 at 13:07:44 UTC, mipri wrote:
On Wednesday, 25 December 2019 at 12:39:08 UTC, BoQsc wrote:
Are there any other ways to join two strings without Tilde ~
character?
I can't seems to find anything about Tilde character
concatenation easily, nor the alternatives to it
I created a file called "resource.rc" with this content:
1 ICON icon.ico
2 EXE app.exe
And compiled with this command:
windres.exe resource.rc resource.res
And I binf it to my program with this command:
dmd Program.d resource.res
Now I have a Program.exe with "app.exe" inside.
Now the file
On Friday, 27 December 2019 at 07:06:52 UTC, mipri wrote:
On Friday, 27 December 2019 at 06:08:16 UTC, Marcone wrote:
import std;
import core.thread;
auto threading(lazy void fun){ return
task!fun().executeInNewThread(); }
void main(){
threading(writeln("Hello World!"));
}
I want t
import std;
import core.thread;
auto threading(lazy void fun){ return
task!fun().executeInNewThread(); }
void main(){
threading(writeln("Hello World!"));
}
I want to create a function threading() to run some function in
other threading, but I get this error bellow. How can I get
su
On Sunday, 22 December 2019 at 17:20:51 UTC, BoQsc wrote:
There are lots of editors/IDE's that support D language:
https://wiki.dlang.org/Editors
What kind of editor/IDE are you using and which one do you like
the most?
I am using "Sublime Text" for code Dlang.
On Sunday, 15 December 2019 at 13:19:21 UTC, JN wrote:
On Sunday, 15 December 2019 at 04:00:14 UTC, Marcone wrote:
There's a way to create simple GUI for Dlang using Resedit?
How?
Do you know how to do it with C++? It should work the same in
D, just use the WinApi bindings for calls.
No. I
There's a way to create simple GUI for Dlang using Resedit? How?
On Sunday, 8 December 2019 at 20:50:05 UTC, Marcone wrote:
I want to add version to my program.
I have configurated my version file "version.txt", but I dont
know how link this file to my program. If Need spec file,
please send the exemple code of spec. Or is is possible add
version file by d
On Tuesday, 10 December 2019 at 09:48:11 UTC, ShadoLight wrote:
On Tuesday, 10 December 2019 at 07:23:00 UTC, rumbu wrote:
[...]
To add to Rumbo's comment: to compile a *.rc to *.res file you
will need a resource compiler.
[...]
Hi, I compile resource using windres.exe of MinGW, Can you s
On Tuesday, 10 December 2019 at 07:23:00 UTC, rumbu wrote:
On Sunday, 8 December 2019 at 20:50:05 UTC, Marcone wrote:
I want to add version to my program.
I have configurated my version file "version.txt", but I dont
know how link this file to my program. If Need spec file,
please send the ex
I have added files inside resource.res. The icon.ico is automated
used for exe program icon. But I don't know how use others files
inside resource res. How Use/Load/Recovery Files in resource.res
files?
On Sunday, 8 December 2019 at 20:56:05 UTC, mipri wrote:
On Sunday, 8 December 2019 at 20:50:05 UTC, Marcone wrote:
I want to add version to my program.
I have configurated my version file "version.txt", but I dont
know how link this file to my program. If Need spec file,
please send the exem
I want to add version to my program.
I have configurated my version file "version.txt", but I dont
know how link this file to my program. If Need spec file, please
send the exemple code of spec. Or is is possible add version file
by dmd command line or resources. Thank you.
On Saturday, 7 December 2019 at 04:05:23 UTC, mipri wrote:
On Saturday, 7 December 2019 at 04:00:53 UTC, Marcone wrote:
import std;
alias cmd = compose!(to!bool, wait, spawnShell, to!string);
void main(){
writeln(cmd("where notepad.exe"));
}
Result:
C:\Windows\System32\notepad.exe
C
import std;
alias cmd = compose!(to!bool, wait, spawnShell, to!string);
void main(){
writeln(cmd("where notepad.exe"));
}
Result:
C:\Windows\System32\notepad.exe
C:\Windows\notepad.exe
false
The result show "false" because good spawnshell command return 0
and 0 to bool is false. Bu
Simple example:
writeln("Hi\nHow are
you?\nGood".splitLines()[0][0..?lastIndexOf(r"\")]);
How to refer to this string in lastIndexOf() without create a
variable?
Thank you.
My program have Qt5 GUI that use dlls, icons, pictures, etc.
How bundles a Dlang application and all its dependencies into a
single .exe package?
Hi,
I use Dlang with QtE5 to make my programs with GUI.
I want to design my program with "Qt Designer" and convert .ui
file to .d file for use with Dlang + QtE5.
In Python, Ruby, C++ you can designe GUI using "Qt Designer" and
convert to respective language using uic.exe.
I found this duic
On Tuesday, 12 November 2019 at 22:26:48 UTC, Daniel Kozak wrote:
On Tuesday, 12 November 2019 at 21:24:54 UTC, Marcone wrote:
I am using this function to sleep, but I want a simple Alias.
How can I alias this?
// Function sleep(int)
void sleep(int seconds){
Thread.sleep(dur!("seconds"
On Tuesday, 12 November 2019 at 22:26:48 UTC, Daniel Kozak wrote:
On Tuesday, 12 November 2019 at 21:24:54 UTC, Marcone wrote:
I am using this function to sleep, but I want a simple Alias.
How can I alias this?
// Function sleep(int)
void sleep(int seconds){
Thread.sleep(dur!("seconds"
I am using this function to sleep, but I want a simple Alias. How
can I alias this?
// Function sleep(int)
void sleep(int seconds){
Thread.sleep(dur!("seconds")( seconds ));
}
sleep(1); // Using function.
Hi, I'm at the beginning of Dlang studies. I want to create a
graphical interface for my program. I use Qt Designer to draw the
GUI and save to .ui file. Could someone send me the file
"duic.exe" which converts .ui files into .d for Dlang? I need the
"duic.cpp" already compiled for .exe. I alre
On Friday, 8 November 2019 at 12:36:37 UTC, Aldo wrote:
On Friday, 8 November 2019 at 11:46:44 UTC, Marcone wrote:
I can encode "Helo World!" to Base64 and get "TWFyY29uZQ==",
but if I try to decode "TWFyY29uZQ==" I can not recovery "Helo
World!" but [77, 97, 114, 99, 111, 110, 101]. How can I
I can encode "Helo World!" to Base64 and get "TWFyY29uZQ==", but
if I try to decode "TWFyY29uZQ==" I can not recovery "Helo
World!" but [77, 97, 114, 99, 111, 110, 101]. How can I recover
"Helo World!" when decode? Thank you.
import std;
void main(){
string text = "Helo World!";
201 - 267 of 267 matches
Mail list logo