Re: How to get rid of "nothrow" ?
On 5/18/20 11:47 PM, Vinod K Chandran wrote: 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 inside a single try catch is better Thanks a lot. :) Frankly speaking in some cases separate try catch blocks will be more suitable but while you do not see the difference in your case then use the single block for everything
Re: How to get rid of "nothrow" ?
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 inside a single try catch is better Thanks a lot. :)
Re: How to get rid of "nothrow" ?
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 inside a single try catch is better
Re: How to get rid of "nothrow" ?
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 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 without "nothorw" in that WndProc. How to solve this problem ? Hi, You need to catch any exceptions inside of your WndProc so they don't propagate: LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) nothrow { try { // your code logic here may call throwing functions } catch (Exception e) { // You should log exceptions here } } Hi, Thanks a lot. Let me try. 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 ?
Re: How to get rid of "nothrow" ?
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 something like message crackers in c++. But since, my WndProc function is a "nothrow" function, i cannot use any function without "nothorw" in that WndProc. How to solve this problem ? Hi, You need to catch any exceptions inside of your WndProc so they don't propagate: LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) nothrow { try { // your code logic here may call throwing functions } catch (Exception e) { // You should log exceptions here } } Hi, Thanks a lot. Let me try.
Re: How to get rid of "nothrow" ?
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 something like message crackers in c++. But since, my WndProc function is a "nothrow" function, i cannot use any function without "nothorw" in that WndProc. How to solve this problem ? Hi, You need to catch any exceptions inside of your WndProc so they don't propagate: LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) nothrow { try { // your code logic here may call throwing functions } catch (Exception e) { // You should log exceptions here } }
How to get rid of "nothrow" ?
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 without "nothorw" in that WndProc. How to solve this problem ?