Home » Community » Newbie corner » dll example errors when trying 
	
		
		
			| dll example errors when trying [message #32458] | 
			Wed, 18 May 2011 20:09  | 
		 
		
			
				
				
				
					
						  
						silverx
						 Messages: 62 Registered: March 2011 
						
					 | 
					Member  | 
					 | 
		 
		 
	 | 
 
	
		I am trying to do a dll call. 
 
I am trying to follow the example listed on the web for doing it, and have setup a dli, and putting the code in the for trying to do it.  When I follow the example I get errors. 
 
The winmm.dll is used to play sound, and done as sndPlaySound and you pass a file name, and some flags.  At this point I am not even trying to make the actual call, but just try and get it to compile with the dli, and the .cpp setup for it. 
 
Any help with this? 
 
I have included the code below. 
 
The errors that I am getting are as follows: 
 
C:\MyApps\t2/winmm.dli(2) : error C2061: syntax error : identifier 'sndPlaySound' 
C:\MyApps\t2/winmm.dli(2) : error C2091: function returns function 
C:\MyApps\t2/winmm.dli(2) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
C:\MyApps\t2/winmm.dli(2) : error C2143: syntax error : missing ';' before '*' 
C:\MyApps\t2/winmm.dli(2) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
C:\MyApps\t2/winmm.dli(2) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
C:\MyApps\t2/winmm.dli(2) : error C2065: 'sndPlaySound' : undeclared identifier 
 
I am not even at this point trying to execute the dll, but just get it listed. 
 
Here is the code in the winmm.dli: 
 
FN(STATUS, sndPlaySound, (String lpszSoundName, long uFlags)) 
 
In the t2.cpp I have the following 
 
 
#include "t2.h" 
 
 
 
 
#define DLLFILENAME "winmm.dll" 
 
#define DLIMODULE   winmm 
 
#define DLIHEADER   <t2/winmm.dli> 
 
#define DLLCALL     sndPlaySound 
 
#include <Core/dli.h> 
 
t2::t2() 
{ 
	CtrlLayout(*this, "This plays a file"); 
	 
	 
	 
} 
 
GUI_APP_MAIN 
{ 
	t2().Run(); 
} 
 
 
 
 
 
		
		
		
 |  
	| 
		
	 | 
 
 
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 12:08:35 CET 2025 
 Total time taken to generate the page: 0.08985 seconds 
 |