[DllImport("Final1_dll.dll", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.StdCall)]
public static extern IntPtr PtrReturnAPI02(char[] abc);
I need some suggestions ASAP. Thanks in advance. public string DemosData(Stream data1) {
// convert Stream Data to StreamReader
StreamReader reader = new StreamReader(data1);
// Read StreamReader data as string
string xmlString = reader.ReadToEnd();
if (IsJson(xmlString))
{
IntPtr pStr = PtrReturnAPI02(xmlString.ToCharArray());
string str = Marshal.PtrToStringAnsi(pStr);
Marshal.FreeHGlobal(pStr);
pStr = IntPtr.Zero;
return str;
}
else
{ return "Input was not in a correct format."; }
// PtrReturnAPI02(xmlString.ToCharArray());
}
public static bool IsJson(string input)
{
input = input.Trim();
return input.StartsWith("{") && input.EndsWith("}")
|| input.StartsWith("[") && input.EndsWith("]");
}
[ServiceContract]
interface IManagedCodeService
{
[OperationContract(Name="DemoData")]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "DemoData")]
string DemosData(Stream data1);
}
}
Software HousePosted Apr 10, 2014, 10:07 AM
VulpesPosted Apr 10, 2014, 9:24 AM
Dependency Walker has a column which will tell you which CPU the dll was compiled for.
Software HousePosted Apr 10, 2014, 9:11 AM
yes I run the dependencywalker on the server and resolve all the dll required for this dll add it to the system32 and SysWOW64 folder but the same error is returning
VulpesPosted Apr 10, 2014, 9:02 AM
If you're not sure what dependencies the dll has, you can check them with the free tool Dependency Walker:
http://www.dependencywalker.com/