I'm new to MR shader writing and I'm trying to write a lens shader that reads in an exr file from maya.

I've had multiple attempts on this (seemingly the same code every time, but various issues every time)
At one point I was reading the image, then it would crash MR with unknown tag error, then it would complain about db entry missing.
Now I get no error what so ever, and no return value from the image, always gives me a black render... To test just the image read portion I've simplified the shader to read and return the image colors.

Here's my "simplified" code at the moment (again the result from this is a black image and ZERO errors from output window or script editor - code is based on the domeAFL shader)
Can anyone tell me what I'm doing wrong? (I'm not finding the MR documentation very useful at all - with complete lack of examples and any meaningful context for function parameters).

My setup is..
Windows 7x64
VisualStudio Express 2013 (desktop)
Maya 2014x64

Thanks

MI file.
Code:
declare shader
	color "tDomeLens" (
		scalar	"FOV_Angle",	
				#: default 180.0
				#: min 0.0
				#: max 360.0

		color texture "Ray_Image",
				
		vector "Cam_Center",
		
		boolean	"Flip_Ray_X",
				#: default 0 

		boolean	"Flip_Ray_Y",
				#: default 0 
	)
	#: nodeid	0518	# Node ID for Maya binary
	version 1
	apply lens
	scanline off
	trace on
end declare
CPP file
Code:
struct ds {
	miScalar	FOV_Angle;		// Fisheye FOV angle in degrees
	miImg_image	Ray_Image;
	miVector	Cam_Center;		// new origin for camera rays
	miBoolean	Flip_Ray_X;		// Flag for flipping image about the x-axis
	miBoolean	Flip_Ray_Y;		// Flag for flipping image about the y-axis
	
};

extern "C" DLLEXPORT miBoolean tDomeLens(miColor *result, miState *state, struct ds *params)
{
        // To simplify for the forum I'm only dealing with the image read here
	miColor *sampleColor = new miColor();
	miTag tex = *mi_eval_tag(&params->Ray_Image);

	miVector *uv = new miVector();
	uv->x = state->raster_x / state->camera->x_resolution;
	uv->y = state->raster_y / state->camera->y_resolution;

	mi_lookup_color_texture(sampleColor, state, tex, uv);
        
        // Quick way to test image read vs manual color assignment to result...
        // Note when set to false and assigning the colors below the shader works fine.
	if (true){
		result->r = sampleColor->r;
		result->g = sampleColor->g;
		result->b = sampleColor->b;
		result->a = sampleColor->a;
	}
	else {
		result->r = .2;
		result->g = .4;
		result->b = .6;
		result->a = .8;
	}
	return(miTRUE);
}