Multi-file project problem with Visual D

Mike via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 1 18:01:21 PDT 2014


I've created a small Windows based program using a win32 library 
I found online.   That part is working just fine.

I've also created a second file (called util.d) and within it 
defined a class called MyData (with a member function called 
Read()).

Within my main program I instantiate and try to call the Read() 
method.  No errors are generated but nothing gets called.   Right 
now the Read() method just does a throw so I know something is 
going on.

What am I missing here?   I would think the compiler would 
generate an error if something was missing.

winmain.d:
---------------------------------
extern(Windows)
LRESULT WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM 
lParam)
{

     switch (message)
     {
         case WM_CREATE:
	    f.Read() ;
             return 0 ;

  /* ... */

} // WndProc



util.d:
----------------------------------

class MyData {
public:
     void Read() {
         throw new Exception("No!", __FILE__, __LINE__) ;
     } // void Read()
} // class Data



More information about the Digitalmars-d-learn mailing list