Ok, so I was able to load a dll and corresponding external functions for use from my loadrunner script. But when I try to pass a parameter to this external function, the same is not received in the dll. Here is a code snippet:

in my loadrunner script:

and my test DLL is:

#include <stdio.h>

__declspec( dllexport ) int log(int msg)
int temp;
char buff[20];

//char *filename = "d:\aditya\log1";

char* filename = "d:\\aditya\\log1.txt";

FILE* fpointer;

temp = msg;

fpointer = fopen(filename,"w");
sprintf(buff,"Here it %d",temp);
//temp = fprintf(buff,strlen(buff),1,fpointer);
temp = fprintf(fpointer,buff);


I have tried printing to file using both fwrite and fprintf, but in both case I am not able to print the value passed from loadrunner script.

If i pass a character string, it prints:
Here it NULL

and If i pass an int, it prints:
Here it 0