P
Philippe F. Bertrand
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.dll")] private static extern
bool T_Cursor_GetBoolean(
int key, short columnID, ErrorCode *code
);
And in C++ as
extern "C" {
__declspec(dllexport) bool T_Cursor_GetBoolean(
int natKey, short cid, int *code
);
}
__declspec(dllexport) bool T_Cursor_GetBoolean(
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
CompactFramework.
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.dll")] private static extern
bool T_Cursor_GetBoolean(
int key, short columnID, ErrorCode *code
);
And in C++ as
extern "C" {
__declspec(dllexport) bool T_Cursor_GetBoolean(
int natKey, short cid, int *code
);
}
__declspec(dllexport) bool T_Cursor_GetBoolean(
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
CompactFramework.
Is there a way to globally change the marshalling of bool's and will
this work in the compact framework?
- Thanks
Philippe