How to disable the DOS window at the start of my program on D

2013-07-24 Thread MGW
I work with Qt from D and I do not need the DOS window. How to turn it off.

Re: How to disable the DOS window at the start of my program on D

2013-07-24 Thread MGW
On Wednesday, 24 July 2013 at 08:08:19 UTC, Rikki Cattermole wrote: version(Windows) { import core.sys.windows.windows : FreeConsole; FreeConsole(); } DOS window flashes at the start, and that's bad.

Re: Auto keyword with const variable

2013-07-24 Thread MGW
On Wednesday, 24 July 2013 at 08:07:55 UTC, Alex H wrote: This code: void test(const int n) { auto j = n; j++; } Gives this error: cannot modify const expression j Is this considered a feature or a bug? I would assume most people wouldn't want new variables inheriting const.

Re: How to disable the DOS window at the start of my program on D

2013-07-24 Thread MGW
Thank you all. All ok!

A small and simple library for working with Qt.

2013-09-09 Thread MGW
I am D since the spring. Without a simple GUI to work hard. I tried to deal with QtD quick disconnects, but I failed. I had to develop its small and very simple library to work with Qt. The working title of QtE. Works in Windows 32 and Linux 32. A very simple idea. Instances of classes get thro

Re: A small and simple library for working with Qt.

2013-09-09 Thread MGW
On Monday, 9 September 2013 at 09:39:51 UTC, Chris wrote: On Monday, 9 September 2013 at 08:06:17 UTC, MGW wrote: I am D since the spring. Without a simple GUI to work hard. I tried to deal with QtD quick disconnects, but I failed. I had to develop its small and very simple library to work

Re: WeakRefs for a CPP->D wrapper

2014-01-12 Thread MGW
Maybe this will be useful in the work: Compile Windows: dmd st1.d Linux: dmd st1.d -L-ldl // --- // MGW 05.01.14 // Model in D a C++ object QByteArray of Qt. // import core.runtime; // Load DLL for

Re: WeakRefs for a CPP->D wrapper

2014-01-13 Thread MGW
Hi yes I think noticed in another thread that you were wrapping Qt with dynamic loading of the qt libs, interesting idea - does your code allow subclassing of the Qt classes and overriding the virtual methods? I'm taking a much more traditional approach, but there is method in my madness :-)

Re: Any library with string encoding/decoding support?

2014-01-20 Thread MGW
On Monday, 20 January 2014 at 08:33:09 UTC, ilya-stromberg wrote: Do you know any library with string encoding/decoding support? I need more encodings than provides `std.encoding`. Library to work with Qt. https://github.com/MGWL/QtE-Qt_for_Dlang_and_Forth Working with Qt and its QTextCodec c

Re: unicode console output

2014-04-02 Thread MGW
On Wednesday, 2 April 2014 at 12:47:06 UTC, Denis Mezhov wrote: I'm trying out to windows console unicode latin string writeln("aaabbb"); console out: aaabbb trying out to console unicode cyrillic string writeln("бббггг"); console out: ╨│╨│╨│╨▒╨▒╨▒ How to out unicode cyrillic string to console

Re: C style callbacks fix for member callbacks

2018-05-20 Thread MGW via Digitalmars-d-learn
On Saturday, 19 May 2018 at 23:52:58 UTC, IntegratedDimensions wrote: I have a member callback that I want to use as a C callback. http://www.agner.org/optimize/calling_conventions.pdf https://www.youtube.com/watch?v=xhDS377mAc4

Re: Is DWT busted?

2018-06-09 Thread MGW via Digitalmars-d-learn
On Friday, 8 June 2018 at 05:00:57 UTC, TheGag96 wrote: I'm sorry about bringing this into here instead of DWT's subforum, but it's somewhat dead and hasn't been getting a lot of attention. I decided to finally play around with DWT today and tried to build the example. I got this: Performing

Re: Why is it hard to make Qt bindings?

2018-07-07 Thread MGW via Digitalmars-d-learn
On Thursday, 5 July 2018 at 08:42:39 UTC, drug wrote: There were several attempts to make Qt binding for dlang ... QtE 5 works great on Win32/64, Linux 32/64 and Mac OS x 64. The main difference is that Qt5 uses a set of pre-defined slots and signals rather than creating them using a MOC or c

Re: QWebView requesting QtE5WebEng32.so on windows

2018-07-23 Thread MGW via Digitalmars-d-learn
On Saturday, 21 July 2018 at 19:11:08 UTC, Dr.No wrote: So I went to try out QWebView on Windows from this wrapper: https://github.com/MGWL/QtE5 all the examples went fine until I tried QWebView: Prior to version Qt-5.5 WebKit was used, and for later versions of chromium-based WebEngine. You

dmd for Haiku OS

2019-02-28 Thread MGW via Digitalmars-d-learn
I have recently looked through Haiku OS and got surprised to find there dmd 2.072. There was only running file but Phobos and DrinTime were missing. Are there any plans to port dmd to Haiku OS nowadays? Is there a manual (example) on dmd porting on Haiku OS?

Error with associative array initializer DMD32 D Compiler v2.070.0

2016-03-03 Thread MGW via Digitalmars-d-learn
immutable long[string] aa = [ "foo": 5, "bar": 10, "baz": 2000 ]; ... Error: non-constant expression ["foo":5L, "bar":10L, "baz":2000L]

Re: Error with associative array initializer DMD32 D Compiler v2.070.0

2016-03-03 Thread MGW via Digitalmars-d-learn
The citation from https://dlang.org/spec/hash-map.html Static Initialization of AAs immutable long[string] aa = [ "foo": 5, "bar": 10, "baz": 2000 ]; unittest { assert(aa["foo"] == 5); assert(aa["bar"] == 10); assert(aa["baz"] == 2000); } Judging

Get address of object in constructor.

2016-03-13 Thread MGW via Digitalmars-d-learn
I want to get address of object Cfoo in constructor. Whether it is possible? now: - class Cfoo { void* adrThis; void saveThis(void* adr) { adrThis = adr; } } ... Cfoo foo = new Cfoo(); foo.saveThis(&foo); shall be -- class Cfoo { void* adrThi

Re: Get address of object in constructor.

2016-03-13 Thread MGW via Digitalmars-d-learn
On Sunday, 13 March 2016 at 15:49:20 UTC, WebFreak001 wrote: On Sunday, 13 March 2016 at 15:43:02 UTC, MGW wrote: I want to get address of object Cfoo in constructor. Whether it is possible? class Cfoo { void* adrThis; this() { adrThis = cast(void*) this

Re: Get address of object in constructor.

2016-03-13 Thread MGW via Digitalmars-d-learn
On Sunday, 13 March 2016 at 16:02:07 UTC, WebFreak001 wrote: However note that this is not the same as that function. cast(void*)this and &this are 2 different things. So if you want to do the same as saveThis just do void* thisAddr = cast(void*) &this; instead void* thisAddr = cast(void*) &t

D --> C++ --> D

2016-03-31 Thread MGW via Digitalmars-d-learn
I for myself write Qt-5 wrapper. I use calls from Qt (C ++) as extern (C) calls. Prompt how to write this code well and with use of abilities to integrate D and C ++ -- // ex4.d - Concepts of QAction.QtE5 // compile - // dmd ex4 qte5 import core.runtime; import

Re: D --> C++ --> D

2016-03-31 Thread MGW via Digitalmars-d-learn
On Thursday, 31 March 2016 at 11:47:34 UTC, MGW wrote: -- Help me to optimize this source code. How to apply here delegates and generally whether possibly to make it here

Is it bug compiler?

2016-05-12 Thread MGW via Digitalmars-d-learn
Windows 7 32bit --- import std.stdio; import std.conv; class CFormaMain { ~this() { char[] zz = [ 'A', 'B', 'C' ]; writeln(to!string(zz)); } } int main(string[] args) { CFormaMain formaMain; formaMain = new CForm

Re: D, GTK, Qt, wx,…

2016-05-31 Thread MGW via Digitalmars-d-learn
On Sunday, 29 May 2016 at 11:03:36 UTC, Russel Winder wrote: GKT+ has a reputation for being dreadful on OSX and even worse on Windows. Qt on the other hand has a reputation for being the most portable – though clearly wx is (arguable) the most portable. QtE5 - is my wrapper for Qt-5 https:/

Re: D, GTK, Qt, wx,…

2016-06-01 Thread MGW via Digitalmars-d-learn
How can we build QtE5 and/or the examples? Download qte5.zip from github. Unzip it to qte5-master. If you have Windows 32 then copy qte5-master/windows32/QtE5Widgets32.dll to folder qte5-master. Copy RunTime Qt-5 (all files and folders from qte5-master/windows32/rt_Qt5_windows32.zip) to qte5-m

How to call a method of class D from function of C++ in DLL?

2016-08-26 Thread MGW via Digitalmars-d-learn
Method which I use now: source D: - extern (C) { int on_metFromD(CEditWin* uk, int aa, int bb) { return (*uk).metFromD(int aa, int bb); } } class CEditWin { . . . // Method for to call int metFromD(int a, int b) { return a + b; } } main() { CE

Re: How to call a method of class D from function of C++ in DLL?

2016-08-28 Thread MGW via Digitalmars-d-learn
On Saturday, 27 August 2016 at 07:13:01 UTC, Nicholas Wilson wrote: easiest method would be to mark the D class extern(C++) noting that in C++ a D class reference becomes a pointer to the C++ class. In "the D class extern(C++)" do't work phobos.

dub - load shared library (so) in example

2016-09-11 Thread MGW via Digitalmars-d-learn
I make a packet for dub in Linux. In a packet there is libQt.so which is loaded by an example of D. Usually I execute LD_LIBRARY_PATH='pwd'; export LD_LIBRARY_PATH, but now it is necessary to make it in dub. How to make it?

Configuring of dub for the application reading enviroment variable

2016-09-30 Thread MGW via Digitalmars-d-learn
My STARTING application shall read the enviroment variable. For example MY_VARIABLE= "I'm Gena". The MY_VARIABLE variable needs to be set in dub.json so what she would be visible in case of start of my application. Purpose: to set LD_LIBRARY_PATH having specified a certain directory in dub packet

Re: Configuring of dub for the application reading enviroment variable

2016-09-30 Thread MGW via Digitalmars-d-learn
On Friday, 30 September 2016 at 11:09:37 UTC, rikki cattermole wrote: There is no way to do this. it is necessary to add section to dub: "enviroment": [ { "LD_LIBRARY_PATH", "$PACKAGE_DIR" }, { "MY_VARIABLE", "$PACKAGE_DIR/IMAGES"} ]

Re: Popular embedded language for scripting in D

2016-11-19 Thread MGW via Digitalmars-d-learn
On Saturday, 19 November 2016 at 22:18:39 UTC, Sai wrote: I have seen luad and Walters own JavaScript VM that can be used in D for embedded scripting purpose in an application. I was wondering which is more popular among D applications? Any suggestions? Thanks, sai Look at one more option.

Memory allocation failed. Why?

2016-11-20 Thread MGW via Digitalmars-d-learn
import core.sys.windows.windows: MessageBoxA; void test() { for(int i; i != 10; i++) { ubyte[] buf; for(int j; j != 1; j++) buf ~= 65; MessageBoxA(null, "--on for--".ptr, "".ptr, 0); // delete buf; // if ON - then mem

Re: Memory allocation failed. Why?

2016-11-20 Thread MGW via Digitalmars-d-learn
On Sunday, 20 November 2016 at 18:58:04 UTC, Basile B. wrote: On Sunday, 20 November 2016 at 17:47:50 UTC, MGW wrote: import core.sys.windows.windows: MessageBoxA; void test() { for(int i; i != 10; i++) { ubyte[] buf; for(int j; j != 1; j++) buf

Re: Memory allocation failed. Why?

2016-11-23 Thread MGW via Digitalmars-d-learn
On Tuesday, 22 November 2016 at 15:53:39 UTC, Steven Schveighoffer wrote: On 11/21/16 11:53 AM, ag0aep6g wrote: Thank you very much for explaining such a difficult and slippery situation.

Re: the best language I have ever met(?)

2016-11-24 Thread MGW via Digitalmars-d-learn
On Wednesday, 23 November 2016 at 18:54:35 UTC, Igor Shirkalin wrote: Igor, is the good Russian-speaking forum https://vk.com/vk_dlang. There are articles on GUI and other aspects of dlang.

How to repeat structure C++

2017-01-15 Thread MGW via Digitalmars-d-learn
Hi! I write plugin for 1C:Enterprise 8.3 on dmd now. https://youtu.be/apLppufZulI I try to repeat structure C++ (interface) on dmd. But D no inheritance of structures. What it is possible to replace with the D following code on C ++struct IInterface {}; C++ - struct IMsgBox : public IInter

Re: How to repeat structure C++

2017-01-15 Thread MGW via Digitalmars-d-learn
On Sunday, 15 January 2017 at 19:00:49 UTC, MGW wrote: Hi! struct IInterface {}; struct IMsgBox : public IInterface { virtual bool Confirm(const wchar* queryText, tVariant* retVal) = 0; virtual bool Alert(const wchar* text) = 0; };

Re: How to repeat structure C++

2017-01-15 Thread MGW via Digitalmars-d-learn
On Monday, 16 January 2017 at 00:07:44 UTC, Adam D. Ruppe wrote: That's just interfaces and classes in D, so change struct to those words and go fro there. // --- jd.d: compile: dmd -c jd import std.stdio; extern (C++) interface IHome { int sum(int, int); }; extern (C++) void printIHome(vo

Re: How do I call a C++ struct default constructor from D?

2017-02-07 Thread MGW via Digitalmars-d-learn
On Tuesday, 7 February 2017 at 13:37:01 UTC, Atila Neves wrote: On Tuesday, 7 February 2017 at 10:46:24 UTC, kinke wrote: I've only every done trivial C++ integration before. As soon as I tried something "real" it all broke down incredibly fast. Probably going to have to file some bugs on name

Re: How do I call a C++ struct default constructor from D?

2017-02-07 Thread MGW via Digitalmars-d-learn
On Tuesday, 7 February 2017 at 13:37:01 UTC, Atila Neves wrote: Here still example https://pp.vk.me/c636630/v636630885/46579/neSdIip1ySI.jpg

Re: How to use C code in D

2017-03-24 Thread MGW via Digitalmars-d-learn
On Thursday, 23 March 2017 at 18:10:20 UTC, Dillen Meijboom wrote: Hi there, I'm learning D for a while because it's really easy to use C-code in D. The problem is that I don't really get how to deal with the data structures defined in C in D. Perhaps, it will be interesting to you. I advise

Re: COM Expertise needed: COM Callbacks

2017-04-24 Thread MGW via Digitalmars-d-learn
On Monday, 24 April 2017 at 00:55:45 UTC, Nierjerson wrote: Still trying to get the com automation code working. This is a Please, use ZIP for archive.

Re: How to setup DLL and EXE projects in one VS solution

2017-05-18 Thread MGW via Digitalmars-d-learn
On Wednesday, 17 May 2017 at 19:48:42 UTC, Igor wrote: On Wednesday, 17 May 2017 at 18:03:04 UTC, Igor wrote: What exactly do mean by "binding"? Also I am wondering if using extern(C) as opposed to extern(D) only affects name mangling or am I losing some DLang possibilities since I am only ca

Re: Extern C and Symbol Mangling

2017-05-26 Thread MGW via Digitalmars-d-learn
On Friday, 26 May 2017 at 12:49:27 UTC, Oleksii wrote: Hi, Call methods and property C++ from D. Interface C++ and D and their interaction. https://pp.userapi.com/c636630/v636630885/4657a/07wCn5hbHHo.jpg https://www.youtube.com/watch?v=HTgJaRRfLPk

Help with an algorithm!

2017-06-14 Thread MGW via Digitalmars-d-learn
There are two arrays of string [] mas1, mas2; Size of each about 5M lines. By the size they different, but lines in both match for 95%. It is necessary to find all lines in an array of mas2 which differ from mas1. The principal criterion - speed. There are the 8th core processor and it is good

Re: Help with an algorithm!

2017-06-15 Thread MGW via Digitalmars-d-learn
On Thursday, 15 June 2017 at 13:16:24 UTC, CRAIG DILLABAUGH wrote: The purpose - search of changes in file system. Sorting is a slow operation as well as hashing. Creation of a tree, is equally in sorting. So far the best result: string[] rez; foreach(str; m2) { bool fFind; int j;

Crypto.lib and ssl.lib for Win32

2017-07-25 Thread MGW via Digitalmars-d-learn
I want to make an application with use http2.d from packet arsd. Where can I find the ready made for usage or how to create cryptro.lib and ssl.lib for Windows 32 that are necessary for my project?

Re: Crypto.lib and ssl.lib for Win32

2017-07-26 Thread MGW via Digitalmars-d-learn
On Tuesday, 25 July 2017 at 21:51:39 UTC, Adam D. Ruppe wrote: On Tuesday, 25 July 2017 at 12:11:08 UTC, MGW wrote: Where can I find the ready made for usage or how to create cryptro.lib and ssl.lib for Windows 32 that are necessary for my project? Do you have the crypto.dll and ssl.dll? If

I need library for QR codes generation.

2017-09-06 Thread MGW via Digitalmars-d-learn
I need library for generation of QR codes. Who knows, give the link.

Re: Request Assistance Calling D from C++: weird visibility issue inside struct and namespace

2017-11-08 Thread MGW via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 06:34:27 UTC, Andrew Edwards wrote: I'm having a little bit of problem calling D code from C++ and would appreciate some assistance. First, given the following C++ program wich compiles, links, and runs without any problem: The useful material. https://www.yout

Re: interfacing c++

2017-11-22 Thread MGW via Digitalmars-d-learn
On Tuesday, 21 November 2017 at 23:12:33 UTC, Markus wrote: hi, im trying to interface a cpp class. I'd like to interface a bigger library and I'm trying to figure out the minimum effort. Possibly it will be interesting https://www.youtube.com/watch?v=HTgJaRRfLPk

Re: interfacing c++

2017-11-22 Thread MGW via Digitalmars-d-learn
On Wednesday, 22 November 2017 at 08:29:26 UTC, MGW wrote: Possibly it will be interesting https://pp.userapi.com/c639524/v639524332/60240/uH3jnxrchik.jpg

is dmd a virus?

2022-10-22 Thread MGW via Digitalmars-d-learn
is dmd a virus? https://www.virustotal.com report: Cybereason --> Malicious.779f29 VBA32 --> BScope.Trojan.DShell

strip in stdin

2020-12-03 Thread MGW via Digitalmars-d-learn
string[] m = stdin.byLineCopy.array; How to make strip() for each line in an expression ...

To switch GC from FIFO to LIFO paradigm.

2021-01-15 Thread MGW via Digitalmars-d-learn
GC cleans memory using the FIFO paradigm. Is it possible to switch GC to work using the LIFO paradigm?

Re: QtE56: QFormBuilder: Error: undefined identifier `QFormBuilder`

2022-04-28 Thread MGW via Digitalmars-d-learn
Probably did not compile QtE5-master/build/QtE56/qte56core.pro QtE5-master/build/QtE56/qte56widgets.pro Use QMAKE to build a DLL/SO More details by mail: m...@yandex.ru

Multi-threaded sorting of text file

2020-01-03 Thread MGW via Digitalmars-d-learn
Need help: There' s a large text file (hundreds of thousands of lines). The structure is as follows: 2345|wedwededwedwedwe .. 872625|rfrferwewweww . 23|rergrferfefer It is necessary to sort this file by the first field having received: 23|rergrferfefer... 2345|

Re: Dynamically Loading a D DLL From a C Program in Linux

2014-10-25 Thread MGW via Digitalmars-d-learn
// MGW 05.01.14 // We model in D object C ++ QByteArray from Qt. // // Windows: dmd st1.d // Linux: dmd st1.d -L-ldl import core.runtime; // Load DLL for Win import std.stdio;// writeln version(linux) { import core.sys.posix.dlfcn

Mistake of opening of a file having a name in cp1251.

2015-04-02 Thread MGW via Digitalmars-d-learn
an source code of a file std\stdio.d with changes is presented more low. private FILE* fopen(in char[] name, in char[] mode = "r") @trusted // nothrow @nogc - mgw отключено из-за fromUtf8toAnsiW { import std.internal.cstring : tempCString; version(Windows) {

Re: Mistake of opening of a file having a name in cp1251.

2015-04-03 Thread MGW via Digitalmars-d-learn
The decision, which I have applied using function fromUtf8toAnsiW() already works correctly. I use dmd 2.067.0

Error execute MS function fputc()

2015-06-07 Thread MGW via Digitalmars-d-learn
Hi, everybody! DMD32 D Compiler v2.067.0 I try to cause the fputc function from CrtDLL.DLL and I receive a mistake. Why? import core.runtime; // Загрузка DLL Для Win import std.stdio;// writeln version(Windows) { import std.c.windows.windows; // GetProcAddress для Windows

Re: Error execute MS function fputc()

2015-06-08 Thread MGW via Digitalmars-d-learn
I found the solution. A problem in different structures of FILE for MSVC and DMC. I take the pointer on structure of FILE from CrtDLL.dll Everything works! // MGW 07.05.15 import core.runtime; // Загрузка DLL Для Win import std.stdio;// writeln version(Windows) { import

Exec function D from C++

2015-06-21 Thread MGW via Digitalmars-d-learn
Linux 32, dmd 2.067.0 I want to connect and execute function D from main() C++. d1.d import core.stdc.stdio; extern (C++) void d1() { printf("printf - exec d1()"); } main_c1.cpp #include void d1(void); int main(void) { d1(); return 0; } compile dmd

Problem with dmd 2.068 Win 32

2015-08-11 Thread MGW via Digitalmars-d-learn
Hi! My project has an error link: Error 42: Symbol Undefined _D6object9Exception6__ctorMFNaNbNfAyaAyakC6object9ThrowableZC9Exception On dmd 2.067.* everything gathered without mistakes. Where to look for a mistake?

Re: Problem with dmd 2.068 Win 32

2015-08-11 Thread MGW via Digitalmars-d-learn
Thanks to all! The problem is localized!