Re: How to work Get & Set text in clipboard in Windows ?

2020-06-22 Thread Vinod K Chandran via Digitalmars-d-learn
On Monday, 22 June 2020 at 10:26:12 UTC, aberba wrote: It would be a one-liner if it was an api. Such utility APIs are quite missing in D. Um, You are right. How about putting them together into a package? Well, this is an inspiration to me. Let me try. :)

Re: How to work Get & Set text in clipboard in Windows ?

2020-06-20 Thread Vinod K Chandran via Digitalmars-d-learn
On Saturday, 20 June 2020 at 13:46:05 UTC, Dennis wrote: Thanks a lot. Well, i thought it should be a one liner like- Clipboard.SetText(sText) But after reading your reply, i realized that this is D, not a scripting language. :)

How to work Get & Set text in clipboard in Windows ?

2020-06-20 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I would like to know how to get & set text in clipboard. I am using windows machine. Thanks in advance. --Vinod Chandran

Re: What is the current stage of @property ?

2020-06-10 Thread Vinod K Chandran via Digitalmars-d-learn
On Wednesday, 10 June 2020 at 22:15:25 UTC, 12345swordy wrote: It can't do binary operations and unary operations. @12345swordy, You mean we can't do such ops inside the property ?

Re: What is the current stage of @property ?

2020-06-10 Thread Vinod K Chandran via Digitalmars-d-learn
On Wednesday, 10 June 2020 at 21:40:44 UTC, Paul Backus wrote: The current state of @property is that it doesn't really do anything. D allows you to call functions without parentheses, and to use assignment syntax to call a single-argument function, so you can write getters and setters that

Re: What is the current stage of @property ?

2020-06-10 Thread Vinod K Chandran via Digitalmars-d-learn
On Wednesday, 10 June 2020 at 21:41:54 UTC, H. S. Teoh wrote: It's stuck in limbo, like many things that people just cannot agree on. There are a few places where it's needed (like satisfying the range API, which implicitly checks for it), but for the most part, you can just ignore it, it

What is the current stage of @property ?

2020-06-10 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I read in an old thread that authors of D wants to eliminate @property. I just roughly read the big thread bu couldn't find a conclusion. After all that thread is a 48 page longer jumbo thread. So out of curiosity, i am asking this. What is the current state of @property ? Is it

Re: How to parse enum from a string ?

2020-05-27 Thread Vinod K Chandran via Digitalmars-d-learn
On Wednesday, 27 May 2020 at 17:36:35 UTC, Dennis wrote: On Wednesday, 27 May 2020 at 17:33:33 UTC, Vinod K Chandran wrote: I am saving this enum values as string in database. So, when i retrieve them from the database, how can i parse the string into TestEnum ? Use `to` from `std.conv`.

How to parse enum from a string ?

2020-05-27 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, Assume that i have an enum like this. enum TestEnum { Received = 1, Started , Finished , Sent } I am saving this enum values as string in database. So, when i retrieve them from the database, how can i parse the string into TestEnum ? In vb. net, i can use

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 14:42:04 UTC, Steven Schveighoffer wrote: On Tuesday, 26 May 2020 at 14:42:04 UTC, Steven Schveighoffer wrote: Hm... According to run.dlang.io, this behavior changed in 2.072 (prior to that it worked). In 2.067.1 to 2.071.2, changing the this reference was

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 13:48:52 UTC, ag0aep6g wrote: On 26.05.20 15:43, Vinod K Chandran wrote: So far now, two solutions are very clear for this problem. 1. As per John Chapman's suggestion - use cast(DWORD_PTR)cast(void*)this). 2. Use another varibale to use as an lvalue. - Button

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 13:44:24 UTC, Adam D. Ruppe wrote: On Tuesday, 26 May 2020 at 11:35:23 UTC, Vinod K Chandran wrote: Okay, but uint is working perfectly. It won't if you use -m64. Okay. I got it.

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 13:37:22 UTC, Vinod K Chandran wrote: On Tuesday, 26 May 2020 at 12:41:20 UTC, John Chapman wrote: On Monday, 25 May 2020 at 16:26:31 UTC, Vinod K Chandran wrote: Here is my full code. Please take a look. https://pastebin.com/av3nrvtT Change line 124 to:

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 12:08:29 UTC, Johannes Loher wrote: On Tuesday, 26 May 2020 at 11:44:58 UTC, Vinod K Chandran wrote: [...] [...] It doesn't compile, the line string mt [...] Hi, Sorry for the typos in my code.

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 12:41:20 UTC, John Chapman wrote: On Monday, 25 May 2020 at 16:26:31 UTC, Vinod K Chandran wrote: Here is my full code. Please take a look. https://pastebin.com/av3nrvtT Change line 124 to: SetWindowSubclass(this.mHandle, SUBCLASSPROC(), UINT_PTR(subClsID),

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Monday, 25 May 2020 at 16:39:30 UTC, Mike Parker wrote: On Monday, 25 May 2020 at 08:39:23 UTC, John Burton wrote: I believe that in D *this* is a reference to the object and not a pointer like in C++. So I think that writing might be what you need? No. A class reference is a pointer

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Monday, 25 May 2020 at 18:42:33 UTC, bauss wrote: On Monday, 25 May 2020 at 17:14:13 UTC, Vinod K Chandran wrote: On Monday, 25 May 2020 at 16:54:11 UTC, Mike Parker wrote: [...] Hi @Mike Parker, Thank you for your valuable suggestions. I will sure follow them. Well, the exact line

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Monday, 25 May 2020 at 22:54:32 UTC, Adam D. Ruppe wrote: On Monday, 25 May 2020 at 22:31:00 UTC, Vinod K Chandran wrote: A dword is an unsigned, 32-bit unit of data. We can use uint in D. I have tried that too, but no luck. A DWORD_PTR is *not* the same as a uint. It is more like a

Re: How to get the pointer of "this" ?

2020-05-25 Thread Vinod K Chandran via Digitalmars-d-learn
On Monday, 25 May 2020 at 22:04:28 UTC, Adam D. Ruppe wrote: On Monday, 25 May 2020 at 21:45:39 UTC, welkam wrote: Where is DWORD_PTR defined? it is a win32 thing. should be able to directly cast to it most the time if there is opCast on the class it needs another layer of helper function

Re: How to get the pointer of "this" ?

2020-05-25 Thread Vinod K Chandran via Digitalmars-d-learn
On Monday, 25 May 2020 at 21:45:39 UTC, welkam wrote: On Sunday, 24 May 2020 at 17:05:16 UTC, Vinod K Chandran wrote: cast(DWORD_PTR) this); Where is DWORD_PTR defined? I cant find it in docs. If its an alias of long then you have to cast to a pointer like this cast(long*) this; you need to

Re: How to get the pointer of "this" ?

2020-05-25 Thread Vinod K Chandran via Digitalmars-d-learn
On Monday, 25 May 2020 at 18:42:33 UTC, bauss wrote: On Monday, 25 May 2020 at 17:14:13 UTC, Vinod K Chandran wrote: On Monday, 25 May 2020 at 16:54:11 UTC, Mike Parker wrote: [...] Hi @Mike Parker, Thank you for your valuable suggestions. I will sure follow them. Well, the exact line

Re: How to get the pointer of "this" ?

2020-05-25 Thread Vinod K Chandran via Digitalmars-d-learn
On Monday, 25 May 2020 at 16:54:11 UTC, Mike Parker wrote: On Monday, 25 May 2020 at 16:26:31 UTC, Vinod K Chandran wrote: [...] The error has nothing to do with taking a pointer to `this`. It's suggesting that somewhere in your code you're attempting to use the `this` reference like an

Re: How to get the pointer of "this" ?

2020-05-25 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 24 May 2020 at 17:40:10 UTC, bauss wrote: On Sunday, 24 May 2020 at 17:05:16 UTC, Vinod K Chandran wrote: [...] I think your issue might be elsewhere because casting this should be fine and it should not complain about that in your given code. At least you should be able to

How to get the pointer of "this" ?

2020-05-24 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I have a class like this. class Button : Control { ... HWND createButton(){ ... SetWindowSubclass(this.mHandle, SUBCLASSPROC(), UINT_PTR(subClsID), cast(DWORD_PTR) this); } } But compiler says that - "Error: 'this' is not an lvalue and cannot

Re: How to use base class & child class as parameter in one function ?

2020-05-23 Thread Vinod K Chandran via Digitalmars-d-learn
On Friday, 22 May 2020 at 22:44:17 UTC, H. S. Teoh wrote: On Fri, May 22, 2020 at 09:39:16PM +, Vinod K Chandran via Digitalmars-d-learn wrote: [...] So in the same manner, i want void function(Base) = fnPtr wiil work with void function(Child) You cannot, because that's type unsafe

Re: How to use base class & child class as parameter in one function ?

2020-05-23 Thread Vinod K Chandran via Digitalmars-d-learn
On Friday, 22 May 2020 at 22:40:50 UTC, Steven Schveighoffer wrote: On 5/22/20 5:39 PM, Vinod K Chandran wrote: [...] That is the opposite of what you are thinking. A function pointer has to be valid based on its parameter types. Covariant functions are allowed. This is OK: void

Re: How to use base class & child class as parameter in one function ?

2020-05-22 Thread Vinod K Chandran via Digitalmars-d-learn
On Friday, 22 May 2020 at 20:51:20 UTC, Steven Schveighoffer wrote: On 5/22/20 4:04 PM, Vinod K Chandran wrote: [...] Yes. What you cannot do is this (which I hope doesn't compile in VB.net, but I wouldn't be surprised): Dim sampleList As New List(Of Child) sampleList.Add(New Base(10))

Re: How to use base class & child class as parameter in one function ?

2020-05-22 Thread Vinod K Chandran via Digitalmars-d-learn
On Friday, 22 May 2020 at 20:06:20 UTC, Adam D. Ruppe wrote: On Friday, 22 May 2020 at 20:04:24 UTC, Vinod K Chandran wrote: sampleList.Add(New Child(10.5)) Is this possible in D without casting ? Direct translation of this code works just fine in D. Yeah, my bad. I just checked in D. But

Re: How to use base class & child class as parameter in one function ?

2020-05-22 Thread Vinod K Chandran via Digitalmars-d-learn
On Friday, 22 May 2020 at 16:12:12 UTC, Steven Schveighoffer wrote: On 5/22/20 9:10 AM, Vinod K Chandran wrote: On Friday, 22 May 2020 at 12:21:25 UTC, rikki cattermole wrote: if (Child child = cast(Child)parent) { assert(child !is null); } Actually, problem occurs in addHandler

Re: How to use base class & child class as parameter in one function ?

2020-05-22 Thread Vinod K Chandran via Digitalmars-d-learn
On Friday, 22 May 2020 at 12:21:25 UTC, rikki cattermole wrote: if (Child child = cast(Child)parent) { assert(child !is null); } Actually, problem occurs in addHandler function. It expects an argument of type "EventArgs", not MouseEventArgs.

How to use base class & child class as parameter in one function ?

2020-05-22 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I have a windows gui setup like this; class EventArgs {} \\ Base class for all messages class MouseEventArgs : EventArgs { // child class for handling mouse messages ... int x; int y; this(WPARAM wpm, LPARAM lpm){ this.x = xFromLparam(lpm); this.y =

Re: How to use GET_X_LPARAM in D ?

2020-05-21 Thread Vinod K Chandran via Digitalmars-d-learn
On Thursday, 21 May 2020 at 20:12:13 UTC, Harry Gillanders wrote: On Thursday, 21 May 2020 at 18:42:47 UTC, Vinod K Chandran wrote: Hi all, I need to use the macro GET_X_LPARAM. But compiler says that "undefined identifier GET_X_LPARAM". I cant find any modules with GET_X_LPARAM defined. Do i

Re: How to use GET_X_LPARAM in D ?

2020-05-21 Thread Vinod K Chandran via Digitalmars-d-learn
On Thursday, 21 May 2020 at 18:42:47 UTC, Vinod K Chandran wrote: Hi all, I need to use the macro GET_X_LPARAM. But compiler says that "undefined identifier GET_X_LPARAM". I cant find any modules with GET_X_LPARAM defined. Do i miss something ? I search all modules in "

How to use GET_X_LPARAM in D ?

2020-05-21 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I need to use the macro GET_X_LPARAM. But compiler says that "undefined identifier GET_X_LPARAM". I cant find any modules with GET_X_LPARAM defined. Do i miss something ?

Re: How to use this forum ?

2020-05-21 Thread Vinod K Chandran via Digitalmars-d-learn
On Wednesday, 20 May 2020 at 21:15:25 UTC, Dukc wrote: On Wednesday, 20 May 2020 at 20:49:52 UTC, Vinod K Chandran wrote: [...] No can do :(. Well, moderators can delete posts so you could try to ask them nicely in some cases but the primary way tends to be the same as with email: send a

Re: How to use this forum ?

2020-05-21 Thread Vinod K Chandran via Digitalmars-d-learn
On Wednesday, 20 May 2020 at 21:13:25 UTC, Paul Backus wrote: On Wednesday, 20 May 2020 at 20:49:52 UTC, Vinod K Chandran wrote: [...] You can't. If you need to make a correction, the best you can do is to make a follow-up post. [...] Copy & paste it. [...] You can't embed images

Re: How to use this forum ?

2020-05-20 Thread Vinod K Chandran via Digitalmars-d-learn
On Wednesday, 20 May 2020 at 21:06:35 UTC, welkam wrote: On Wednesday, 20 May 2020 at 20:49:52 UTC, Vinod K Chandran wrote: Hi all, I have some questions about this forum. 1. How to edit a post ? 2. How to edit a reply ? 3. How to add some code(mostly D code) in posts & replies. 4. How to add

How to use this forum ?

2020-05-20 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I have some questions about this forum. 1. How to edit a post ? 2. How to edit a reply ? 3. How to add some code(mostly D code) in posts & replies. 4. How to add an image in posts & replies. 5. Is there a feature to mark my post as "[SOLVED]" ?

Re: Is it possible to write some class members in another module ?

2020-05-20 Thread Vinod K Chandran via Digitalmars-d-learn
On Wednesday, 20 May 2020 at 15:01:36 UTC, welkam wrote: On Wednesday, 20 May 2020 at 09:45:48 UTC, Vinod K Chandran wrote: // Now, we need to use like this auto form= new Window(); form.event.click = bla_bla; // I really want to use like this auto form= new Window(); form.click = bla_bla; ```

Re: Is it possible to write some class members in another module ?

2020-05-20 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 19 May 2020 at 23:51:45 UTC, Boris Carvajal wrote: On Tuesday, 19 May 2020 at 22:01:03 UTC, Vinod K Chandran wrote: Hi all, Is it possible to write some class members in another module ? I have class with a lot of member variables.(probably 50+) I would like to write them (Not

Re: Is it possible to write some class members in another module ?

2020-05-20 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 19 May 2020 at 22:10:25 UTC, Adam D. Ruppe wrote: On Tuesday, 19 May 2020 at 22:01:03 UTC, Vinod K Chandran wrote: Is it possible to write some class members in another module ? You can make some of members be other structs that you aggregate together. That's a good idea but

Is it possible to write some class members in another module ?

2020-05-19 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, Is it possible to write some class members in another module ? I have class with a lot of member variables.(probably 50+) I would like to write them (Not all, but some of them) in a special module for the sake of maintenance.

Re: DScanner warns class is undocumented, how to resolve it ?

2020-05-19 Thread Vinod K Chandran via Digitalmars-d-learn
On Thursday, 14 May 2020 at 08:02:28 UTC, Dennis wrote: On Thursday, 14 May 2020 at 06:08:17 UTC, Vinod K Chandran wrote: On Thursday, 14 May 2020 at 06:05:00 UTC, Vinod K Chandran wrote: Hi all, I wrote a class and in VS Code, DScanner says that the class is undocumented. How can i document

Re: How to get rid of "nothrow" ?

2020-05-18 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 17 May 2020 at 19:37:05 UTC, drug wrote: 17.05.2020 17:35, Vinod K Chandran пишет: It worked. Thanks :) I have one more question. Which is better, to include all the switch cases inside a single try catch or write separate try catch for each switch cases ? all the switch cases

Re: How to get rid of "nothrow" ?

2020-05-17 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 17 May 2020 at 14:21:41 UTC, Vinod K Chandran wrote: On Sunday, 17 May 2020 at 09:50:00 UTC, Olivier Pisano wrote: On Sunday, 17 May 2020 at 09:27:40 UTC, Vinod K Chandran wrote: Hi all, I am trying to create a win32 based gui in dlang. So far so good. I can create and display my

Re: How to get rid of "nothrow" ?

2020-05-17 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 17 May 2020 at 09:50:00 UTC, Olivier Pisano wrote: On Sunday, 17 May 2020 at 09:27:40 UTC, Vinod K Chandran wrote: Hi all, I am trying to create a win32 based gui in dlang. So far so good. I can create and display my window on screen. But for handling messages, i planned to write

How to get rid of "nothrow" ?

2020-05-17 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I am trying to create a win32 based gui in dlang. So far so good. I can create and display my window on screen. But for handling messages, i planned to write something like message crackers in c++. But since, my WndProc function is a "nothrow" function, i cannot use any function

Re: How to run program with "dmd -i" compiler swich ?

2020-05-15 Thread Vinod K Chandran via Digitalmars-d-learn
On Friday, 15 May 2020 at 14:29:38 UTC, Adam D. Ruppe wrote: use the -run switch to dmd. Make sure it and te d file name are the LAST arguments. dmd -i other_dmd_args_you_need -run yourfile.d Thank you for the reply. Let me try. :)

Re: How to run program with "dmd -i" compiler swich ?

2020-05-15 Thread Vinod K Chandran via Digitalmars-d-learn
On Friday, 15 May 2020 at 18:22:47 UTC, Seb wrote: On Friday, 15 May 2020 at 14:09:00 UTC, Vinod K Chandran wrote: Hi, For some unknown reasons, dub is not working for me. But i can build my program with "dmd -i". But i would like to know if there is any code to run my program with "dmd -i".

Re: How to include my own library in my d program with dub ?

2020-05-15 Thread Vinod K Chandran via Digitalmars-d-learn
On Thursday, 14 May 2020 at 12:57:19 UTC, JN wrote: On Thursday, 14 May 2020 at 12:53:43 UTC, Vinod K Chandran wrote: Hi all, I just build a skeleton of a Gui library(win32 based) for my own purpose. How do i use this in my d programs with dub ? Now, all files are located in a folder called

How to run program with "dmd -i" compiler swich ?

2020-05-15 Thread Vinod K Chandran via Digitalmars-d-learn
Hi, For some unknown reasons, dub is not working for me. But i can build my program with "dmd -i". But i would like to know if there is any code to run my program with "dmd -i". Note : "rdmd" is also working but it creates the exe file in temp directory, so my AV is catching it every time. Its

How to include my own library in my d program with dub ?

2020-05-14 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I just build a skeleton of a Gui library(win32 based) for my own purpose. How do i use this in my d programs with dub ? Now, all files are located in a folder called "GuiLib". Side note : Why i started making a gui library instead of learning language ? Answer : By this way, i can

Re: DScanner warns class is undocumented, how to resolve it ?

2020-05-14 Thread Vinod K Chandran via Digitalmars-d-learn
On Thursday, 14 May 2020 at 08:02:28 UTC, Dennis wrote: On Thursday, 14 May 2020 at 06:08:17 UTC, Vinod K Chandran wrote: On Thursday, 14 May 2020 at 06:05:00 UTC, Vinod K Chandran wrote: Hi all, I wrote a class and in VS Code, DScanner says that the class is undocumented. How can i document

Re: DScanner warns class is undocumented, how to resolve it ?

2020-05-14 Thread Vinod K Chandran via Digitalmars-d-learn
On Thursday, 14 May 2020 at 11:25:48 UTC, Cogitri wrote: On Thursday, 14 May 2020 at 06:08:17 UTC, Vinod K Chandran wrote: [...] Also see https://dlang.org/spec/ddoc.html for more info on DDoc. FWIW you can also disable the warning by adding the following to VSCode's settings.json:

Re: DScanner warns class is undocumented, how to resolve it ?

2020-05-14 Thread Vinod K Chandran via Digitalmars-d-learn
On Thursday, 14 May 2020 at 06:05:00 UTC, Vinod K Chandran wrote: Hi all, I wrote a class and in VS Code, DScanner says that the class is undocumented. How can i document a class ? Never mind, i found the answer myself. Just like in dot net, i added triple forward slash comment and problem

DScanner warns class is undocumented, how to resolve it ?

2020-05-14 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I wrote a class and in VS Code, DScanner says that the class is undocumented. How can i document a class ?

Re: How to import modules from another folder ?

2020-05-13 Thread Vinod K Chandran via Digitalmars-d-learn
On Wednesday, 13 May 2020 at 22:10:02 UTC, Vinod K Chandran wrote: Hi all, I am practicing some win32 api coding in D. So far so good. But when i tried to import some d files from another folder, i wonder how do this. This is my folder structure. --> Source Folder --> app.d //This

How to import modules from another folder ?

2020-05-13 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I am practicing some win32 api coding in D. So far so good. But when i tried to import some d files from another folder, i wonder how do this. This is my folder structure. --> Source Folder --> app.d //This is my main file. I am importing guiLib in this main file.

How to import & export modules

2019-11-10 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I am practicing D by writting a win API gui wrapper. I want to use a single module import to use this Gui lib. Say i have 10 modules like-- "App.d, Form.d, Button.d, Label.d, TextBox.d, ComboBox.d, ListBox.d, CheckBox.d, Panel.d, DateTimePicker.d" In Nim, i can import and export all

Re: How to use "*.def" files in order to avoid cmd windows ?

2019-11-09 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 10 November 2019 at 00:00:55 UTC, Adam D. Ruppe wrote: On Saturday, 9 November 2019 at 23:59:20 UTC, Vinod K Chandran wrote: I 'named the the def file "simple.def", since my programs name is also "simple". But no luck. Any help ? you need to pass the .def file on the dmd command

Re: Alternative to C++ macro in D

2019-11-09 Thread Vinod K Chandran via Digitalmars-d-learn
On Monday, 4 November 2019 at 00:20:37 UTC, Ali Çehreli wrote: On 11/03/2019 08:55 AM, Vinod K Chandran wrote: > [...] There is nothing that stops one from using the C++ preprocessor on any text file. For example, you can do the following wherever GCC exists. If there are the following lines

How to use "*.def" files in order to avoid cmd windows ?

2019-11-09 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I am just playing with some win api code in D. Well, so far so good. I've create a simple program which shows a message box. I know i can avoid the cmd window with "dmd -L/SUBSYSTEM:windows". But this https://wiki.dlang.org/D_for_Win32 says that a "*.def" file with these two lines

Re: Which is the active fork in DFL gui library ?

2019-11-04 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 3 November 2019 at 23:25:40 UTC, Jesse Phillips wrote: On Sunday, 3 November 2019 at 16:48:52 UTC, Vinod K Chandran wrote: On Sunday, 3 November 2019 at 14:01:03 UTC, Jesse Phillips https://github.com/Rayerd/dfl @Jesse Phillips, Thank you for the reply. Does DWT is built upon

Re: Which is the active fork in DFL gui library ?

2019-11-04 Thread Vinod K Chandran via Digitalmars-d-learn
On Monday, 4 November 2019 at 19:29:22 UTC, Jacob Carlborg wrote: On 2019-11-03 17:48, Vinod K Chandran wrote: [...] Yes. It's a full translation of the Java code to D. No JNI, JVM or Java or remains. [...] I don't know if that's the case. Also I don't know if that's related to

Re: Alternative to C++ macro in D

2019-11-03 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 3 November 2019 at 16:55:36 UTC, Vinod K Chandran wrote: Hi all, I can do this in C++. #include using namespace std ; #define end }; #define log(x) cout << x << endl #define wait std::cin.get() int main() { log("Trying to avoid the visual clutter aused by closing curly

Alternative to C++ macro in D

2019-11-03 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I can do this in C++. #include using namespace std ; #define end }; #define log(x) cout << x << endl #define wait std::cin.get() int main() { log("Trying to avoid the visual clutter aused by closing curly braces") ; string myStr = "Now, code looks more elegant" ;

Re: Which is the active fork in DFL gui library ?

2019-11-03 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 3 November 2019 at 07:07:42 UTC, Mike Parker wrote: On Sunday, 3 November 2019 at 07:06:12 UTC, Mike Parker wrote: Here's an example, winhello.d, that should work with all of the following command lines: Sorry, here's the example: == winhello.d /+ dub.sdl: name "entry"

Re: Which is the active fork in DFL gui library ?

2019-11-03 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 3 November 2019 at 14:01:03 UTC, Jesse Phillips wrote: On Saturday, 2 November 2019 at 20:01:27 UTC, Vinod K Chandran wrote: Hi all, I just found that DFL gui library very interesting. But after some searching, i can see that DFL is inactive and there is few other forks for it. So

Which is the active fork in DFL gui library ?

2019-11-02 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I just found that DFL gui library very interesting. But after some searching, i can see that DFL is inactive and there is few other forks for it. So this is my question - Which fork is good for a gui development in windows platform. BTW, i just tested the gtkD and successfully compiled

Re: How to use classes from another d files

2019-10-24 Thread Vinod K Chandran via Digitalmars-d-learn
On Thursday, 24 October 2019 at 10:19:23 UTC, Vinod K Chandran wrote: On Tuesday, 22 October 2019 at 18:34:52 UTC, Daniel Kozak wrote: On Tue, Oct 22, 2019 at 8:30 PM Vinod K Chandran via Digitalmars-d-learn wrote: On Tuesday, 22 October 2019 at 17:38:58 UTC, Adam D. Ruppe wrote

Re: How to use classes from another d files

2019-10-24 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 22 October 2019 at 18:34:52 UTC, Daniel Kozak wrote: On Tue, Oct 22, 2019 at 8:30 PM Vinod K Chandran via Digitalmars-d-learn wrote: On Tuesday, 22 October 2019 at 17:38:58 UTC, Adam D. Ruppe wrote: > On Tuesday, 22 October 2019 at 17:34:51 UTC, Vinod K > Chandran

Re: How to use classes from another d files

2019-10-24 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 22 October 2019 at 18:31:17 UTC, Adam D. Ruppe wrote: On Tuesday, 22 October 2019 at 18:21:36 UTC, Vinod K Chandran wrote: But what if there is too many include files ? The dmd -i thing will do that for you dmd -i main.d and it will automatically find the others, assuming they

Re: How to use classes from another d files

2019-10-24 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 22 October 2019 at 18:33:32 UTC, Ali Çehreli wrote: On 10/22/2019 11:25 AM, Vinod K Chandran wrote: > On Tuesday, 22 October 2019 at 17:38:58 UTC, Adam D. Ruppe wrote: >> [...] Chandran wrote: >>> [...] playing >> [...] command line? That: The -i switch is the answer to your

Re: How to use classes from another d files

2019-10-22 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 22 October 2019 at 17:38:58 UTC, Adam D. Ruppe wrote: On Tuesday, 22 October 2019 at 17:34:51 UTC, Vinod K Chandran wrote: Hi all, I am new to D. But some fair experience with vb.net. I was playing with D classes. I wrote a class in a D file. The file name is "classFile.d" did

Re: How to use classes from another d files

2019-10-22 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 22 October 2019 at 17:40:11 UTC, Arun Chandrasekaran wrote: On Tuesday, 22 October 2019 at 17:34:51 UTC, Vinod K Chandran wrote: Hi all, I am new to D. But some fair experience with vb.net. I was playing with D classes. I wrote a class in a D file. The file name is "classFile.d"

How to use classes from another d files

2019-10-22 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I am new to D. But some fair experience with vb.net. I was playing with D classes. I wrote a class in a D file. The file name is "classFile.d" ```D class TestClass { int myIntVar; string myStringVar ; this(int miv, string msv) { this.myIntVar = miv ;

Re: How to convert this function into a template ?

2018-10-02 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 2 October 2018 at 17:37:58 UTC, Ali Çehreli wrote: On 10/02/2018 07:39 AM, Vinod K Chandran wrote: > Thanks a lot. Great help !. I will sure the check the link. :) I find the Index section useful (yes, can be improved). For example, just seach for "append" on this page:

Re: How to convert this function into a template ?

2018-10-02 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 2 October 2018 at 12:23:47 UTC, Jonathan M Davis wrote: The template equivalent would have been something like void arrayAdd(T)(ref T[] x, T value) { auto index = x.length; x.length += 1; x[index] = value; } But if you're new to the language, I'd suggest that you read

Re: How to convert this function into a template ?

2018-10-02 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 2 October 2018 at 11:49:06 UTC, Jonathan M Davis wrote: Why do you have a function for that? All you need to do is use the append operator. e.g. x ~= value; - Jonathan M Davis Thanks for the reply. I did not find that it in documentation. Ofcourse i lost a chance to learn

How to convert this function into a template ?

2018-10-02 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I have a function and i want to convert this into a template so that i can use this function for more than one data type. This is my function. ```D void ArrayAdd( ref int[] x, int value) { int index = x.length ; x.length += 1 ; x[index] = value ; } ```

Re: Does the WInMain function is mandatory ?

2018-10-02 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 30 September 2018 at 15:06:31 UTC, Mike Parker wrote: On Sunday, 30 September 2018 at 14:06:20 UTC, Vinod K Chandran wrote: Thanks. It worked. I would like to compile this as a gui. Now it starts with the cmd. Google search didn't gave me the link i want. Any help ? With the

Re: Does the WInMain function is mandatory ?

2018-09-30 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 30 September 2018 at 13:21:59 UTC, Adam D. Ruppe wrote: On Sunday, 30 September 2018 at 13:17:33 UTC, Vinod K Chandran wrote: Thanks for the reply. But it says "toUTFz" is not defined. do i missing any import statement ? import std.utf; Thanks. It worked. I would like to compile

Re: Does the WInMain function is mandatory ?

2018-09-30 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 30 September 2018 at 13:17:33 UTC, Vinod K Chandran wrote: On Sunday, 30 September 2018 at 12:48:17 UTC, Adam D. Ruppe wrote: so usage is: toUTFz!(wchar*)(your_string_here); If passing string literals to Windows, you can put a w at the end, like: MessageBoxW(null, "Hello"w,

Re: Does the WInMain function is mandatory ?

2018-09-30 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 30 September 2018 at 12:48:17 UTC, Adam D. Ruppe wrote: so usage is: toUTFz!(wchar*)(your_string_here); If passing string literals to Windows, you can put a w at the end, like: MessageBoxW(null, "Hello"w, "World"w, 0); // note the ""w Thanks for the reply. But it says

Re: Does the WInMain function is mandatory ?

2018-09-30 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 30 September 2018 at 06:56:41 UTC, bauss wrote: On Sunday, 30 September 2018 at 06:33:47 UTC, rikki cattermole wrote: null terminated, nothing really special. To elaborate on this. There is function that does it for you called toStringz()

Re: Does the WInMain function is mandatory ?

2018-09-30 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 30 September 2018 at 06:33:47 UTC, rikki cattermole wrote: No. 2. Can we use D strings in win api functions ?, If not, please show me how to convert strings null terminated, nothing really special. Hi, Thanks for the reply. I somehow managed to display a messagebox with

Does the WInMain function is mandatory ?

2018-09-30 Thread Vinod K Chandran via Digitalmars-d-learn
Hi, I would like to do some win api coding in D. I just taste the syntactic sugar but cant do anything more. I have few questions. 1. Does WinMain is needed for a D program in order to use win api ? 2. Can we use D strings in win api functions ?, If not, please show me how to convert strings