ConfNoob,
You haven't shown the declaration of the function in C#. Can you
provide that?
Also, are you sure that the calling convention is correct?
--
- Nicholas Paldino [.NET/C# MVP]
-
mvp@spam.guard.caspershouse.com
"ConfNoob" <Ronodev.Sen@gmail.com> wrote in message
news:1146664824.723801.317390@i40g2000cwc.googlegr oups.com...[color=blue]
> part 1: there is a NON - COM unmanaged dll in VC++ 6.0
> BOOL function(char * name, int nOption)
>
> part 2: there is a C# web service that has to consume the above DLL
> used DLLImport to call the Non-COM Dll.
> [DllImport("Dllname.dll", EntryPoint = "function",
>
> used "Debug Unmanaged Code" to step into DLL.
>
> the DLL gets the right values, processes the steps properly.
>
> however when the value is returned to the C# Webservice
> no matter if the return from the unmanaged DLL is TRUE (1) or FALSE
> (0), the bool in the C# webservice is always 0/false
>
> the DLL DOES return BOOL which is a 4 byte int , hence im led to
> believe that it should be marshalled properly into a C# 'bool'
>
> as alternatives have done the following.
>
> - tried casting the BOOL to an int using Convert.ToInt32()
>
> trying to convert the ENTIRE unmanaged DLL into a COM application is
> not something i am able to do ....
>
> suggestions ??
>
> TIA
>[/color]