T
tomar
Hi All,
I Made a win32 dll named with Test.dll in VC++6.0 using following code
/
******************************************************************************
** FUNCTION: ASum
*******************************************************************************/
extern "C" __declspec(dllexport) int ASum(int a, int b)
{
return (a+b);
}
When I Use this Test.dll (Unmanaged code) in WebService(Managed code)
written in C# like
public class AldorWeb : System.Web.Services.WebService
{
[DllImport("Test.dll", SetLastError = false)]
public static extern int ASum(int a,int b);
public AldorWeb()
{
//CODEGEN: This call is required by the ASP.NET Web
Services Designer
InitializeComponent();
}
[WebMethod]
public bool SUM()
{
try
{
int x = ASum(2, 3);
}
catch(Exception e)
{
LogWriter.WriteLog(1, 1, (int)enLogType.eTraceLog,e.ToString());
}
}
}
it gives error like "Unable to load DLL (Test.dll)." if I call SUM
webmethod. while same code in Windows Application is working fine.
I think that Permission might be an issue but don't know how to
implement it. I use Impersonation also but no benefit. even I tried to
use this code using class library written in C# and called this
library in webservice but useless.
Please suggest me some solujtions.
Thanks all.
Dharmendra Singh Tomar
Metadesign Solutions
I Made a win32 dll named with Test.dll in VC++6.0 using following code
/
******************************************************************************
** FUNCTION: ASum
*******************************************************************************/
extern "C" __declspec(dllexport) int ASum(int a, int b)
{
return (a+b);
}
When I Use this Test.dll (Unmanaged code) in WebService(Managed code)
written in C# like
public class AldorWeb : System.Web.Services.WebService
{
[DllImport("Test.dll", SetLastError = false)]
public static extern int ASum(int a,int b);
public AldorWeb()
{
//CODEGEN: This call is required by the ASP.NET Web
Services Designer
InitializeComponent();
}
[WebMethod]
public bool SUM()
{
try
{
int x = ASum(2, 3);
}
catch(Exception e)
{
LogWriter.WriteLog(1, 1, (int)enLogType.eTraceLog,e.ToString());
}
}
}
it gives error like "Unable to load DLL (Test.dll)." if I call SUM
webmethod. while same code in Windows Application is working fine.
I think that Permission might be an issue but don't know how to
implement it. I use Impersonation also but no benefit. even I tried to
use this code using class library written in C# and called this
library in webservice but useless.
Please suggest me some solujtions.
Thanks all.
Dharmendra Singh Tomar
Metadesign Solutions