Summary - What should a C# bool map to in C++? Are return types
different?
I have lots of methods declared with bool parameters and bool return
type which appear to work without any problems but one method in
particular seems to always return true.
The method is declared in C# as
[DllImport("my.d ll")] private static extern
bool T_Cursor_GetBoo lean(
int key, short columnID, ErrorCode *code
);
And in C++ as
extern "C" {
__declspec(dlle xport) bool T_Cursor_GetBoo lean(
int natKey, short cid, int *code
);
}
__declspec(dlle xport) bool T_Cursor_GetBoo lean(
int natKey, short cid, int *code
)
{
bool out = some stuff;
return out;
}
Stepping through the code in Visual Studio on the desktop, I see the
unmanaged code returning false and the managed code receiving true.
I need this code to work on both the .NET framework and the
CompactFramewor k.
Is there a way to globally change the marshalling of bool's and will
this work in the compact framework?
- Thanks
Philippe
different?
I have lots of methods declared with bool parameters and bool return
type which appear to work without any problems but one method in
particular seems to always return true.
The method is declared in C# as
[DllImport("my.d ll")] private static extern
bool T_Cursor_GetBoo lean(
int key, short columnID, ErrorCode *code
);
And in C++ as
extern "C" {
__declspec(dlle xport) bool T_Cursor_GetBoo lean(
int natKey, short cid, int *code
);
}
__declspec(dlle xport) bool T_Cursor_GetBoo lean(
int natKey, short cid, int *code
)
{
bool out = some stuff;
return out;
}
Stepping through the code in Visual Studio on the desktop, I see the
unmanaged code returning false and the managed code receiving true.
I need this code to work on both the .NET framework and the
CompactFramewor k.
Is there a way to globally change the marshalling of bool's and will
this work in the compact framework?
- Thanks
Philippe
Comment