Re: Possible to get Class of Interface at runtime

2016-01-24 Thread Josh Phillips via Digitalmars-d-learn
On Saturday, 23 January 2016 at 21:06:32 UTC, Adam D. Ruppe wrote: Are you sure you correctly casted first? Nope sorry. Thanks for the help!!

Re: Possible to get Class of Interface at runtime

2016-01-23 Thread Josh Phillips via Digitalmars-d-learn
On Friday, 22 January 2016 at 23:44:34 UTC, Adam D. Ruppe wrote: There's a .classinfo property that works on Objects. If you have an interface, cast to Object first, and check for null, then get .classinfo off that. I tried this but it will return A not B

Possible to get Class of Interface at runtime

2016-01-22 Thread Josh Phillips via Digitalmars-d-learn
If I have: interface A {} class B : A {} void printClass(A obj){ // Code here } Is there any way that I can find out what class obj is inside of printClass? I know I can cast and check if(cast(B)obj) but I want to just be able to do something along the lines of obj.class. I can think of

Re: DUB & Win-10 SDK / link lib not found

2016-01-15 Thread Josh Phillips via Digitalmars-d-learn
I also ran into this issue because I upgraded VS and removed the old version. A quick re-install with the dmd .exe fixed it.

Re: Glad and WGL

2016-01-15 Thread Josh Phillips via Digitalmars-d-learn
On Friday, 15 January 2016 at 07:37:27 UTC, Josh Phillips wrote: However I (of course) ran into new errors. Gl functions like glGetString and glGetIntegerv cause the program to crash. It appears that an opengl context is being created so I'm not sure whats causing the problem For anyone else

Re: Glad and WGL

2016-01-14 Thread Josh Phillips via Digitalmars-d-learn
On Thursday, 14 January 2016 at 09:42:50 UTC, Dav1d wrote: On Thursday, 14 January 2016 at 09:25:50 UTC, Dav1d wrote: On Thursday, 14 January 2016 at 02:35:28 UTC, Josh Phillips wrote: Welcome to D and Windows. You can use GDC or LDC or try

Glad and WGL

2016-01-13 Thread Josh Phillips via Digitalmars-d-learn
So I started using Glad but I can't get WGL to work with it, though I think this is more of a Win32 issue than WGL. wndclass.lpfnWndProc = Gives me an error no matter what: Error: cannot implicitly convert expression (& WndProc) of type int function(void* hWnd, uint message, uint wParam,

Re: Glad and WGL

2016-01-13 Thread Josh Phillips via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 18:37:09 UTC, Adam D. Ruppe wrote: You just need to explicitly mark it nothrow in the signature. Add `nothrow` to the end of the param list: extern(Windows) LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) nothrow and then you'll be

Re: Glad and WGL

2016-01-13 Thread Josh Phillips via Digitalmars-d-learn
On Thursday, 14 January 2016 at 02:16:40 UTC, userABCabc123 wrote: On Wednesday, 13 January 2016 at 19:05:30 UTC, Josh Phillips wrote: Oh wow that's easy. They should really make that more clear in the dlang reference. They way it sounds there made me think that if a function doesn't throw any

Re: Glad and WGL

2016-01-13 Thread Josh Phillips via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 20:08:55 UTC, Dav1d wrote: Link with opengl32.lib How? Everywhere I looked it says this cannot be done due to conflicting formats between the dmd compiler and the windows one.

USB Controller

2015-04-02 Thread Josh Phillips via Digitalmars-d-learn
Hey Guys! I've started using Arduino, specifically with Processing. I'm using it essentially as a usb controller. Is there a good way to translate this to D? There doesn't seem to be any standard library for usb usage. Are there pre-built libraries or is there C libraries I should use?