| 
		
			| C# dll in Forms [message #355870] | Tue, 28 October 2008 04:06  |  
			| 
				
				
					| DarkProjekt Messages: 4
 Registered: October 2008
 | Junior Member |  |  |  
	| Hello, 
 i have to use a C# dll in Oracle Forms. I use ORA_FFI to register my dll, but i get a error Message that my function can't be found in my dll (PDE-DFF004).
 
 This is the C# dll code:
 
 
 
public class wae_auslesen
    { 
        public static String wae_huf(Int16 v_mon, Int16 v_year)
        {
             ...
 And the code in forms, where I want to register the function:
 
 
fhandle := ORA_FFI.REGISTER_FUNCTION(get_huf_lhandle, 'wae_auslesen.wae_huf', ORA_FFI.C_STD);
 Can anybody help me?
 
 (Sorry for my bad english)
 |  
	|  |  | 
	|  | 
	| 
		
			| Re: C# dll in Forms [message #356391 is a reply to message #355870] | Thu, 30 October 2008 10:43   |  
			| 
				
				
					| DarkProjekt Messages: 4
 Registered: October 2008
 | Junior Member |  |  |  
	| Yes, its in the same directory. 
 Here is the complete code:
 
 
 PACKAGE BODY GET_HUF IS
  get_huf_lhandle ORA_FFI.LIBHANDLETYPE;
  to_power_fhandle ORA_FFI.FUNCHANDLETYPE;
  
  test NUMBER;
  
  FUNCTION FF_TO_POWER(fhandle ORA_FFI.FUNCHANDLETYPE, v_month NUMBER, v_year NUMBER) RETURN VARCHAR2;
  PRAGMA interface(C, ff_to_power, 11265);
  
  FUNCTION GET(v_month NUMBER, v_year NUMBER) RETURN VARCHAR2 IS
  BEGIN
  	RETURN(FF_TO_POWER(to_power_fhandle, v_month, v_year));
  END GET;
    
BEGIN
	get_huf_lhandle := ORA_FFI.LOAD_LIBRARY('','gethuf.dll');
	test := 1;
	
	to_power_fhandle := ORA_FFI.REGISTER_FUNCTION(get_huf_lhandle, 'wae_auslesen.wae_huf', ORA_FFI.C_STD);
	test := 2;
	ORA_FFI.REGISTER_PARAMETER(to_power_fhandle, ORA_FFI.C_DOUBLE);
	test := 3;
	ORA_FFI.REGISTER_PARAMETER(to_power_fhandle, ORA_FFI.C_DOUBLE);
	test := 4;
	
	ORA_FFI.REGISTER_RETURN (to_power_fhandle, ORA_FFI.C_CHAR_PTR);
	test := 5;
EXCEPTION
	WHEN Ora_FFI.FFI_ERROR THEN
		DEV_MSG(tool_err.message,1);
		tool_err.pop;
	WHEN others THEN
		DEV_MSG('PRZ: GET_HUF.GET - ' || test || '#' ||SQLERRM,1);  	
END;[Updated on: Thu, 30 October 2008 10:46] Report message to a moderator |  
	|  |  | 
	|  | 
	|  | 
	|  | 
	|  | 
	|  | 
	|  |