TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ishwar Goudar
NA
1
0
Problem in Passing double values from a C# Structure to a legacy C++ DLL
Feb 22 2007 12:52 AM
Hi Friends,
I have a .Net Application, through which I am invoking a function from a legacy DLL developed in C++. My structure in C# contains some data of type double which I need to pass to to the DLL to get some results back from it.
My Structure In C# looks like this
:
[StructLayout(LayoutKind.Sequential)]
public struct InputPurchaseOrder
{
public System.String poJobName;
public System.String poTradeName;
public System.Int32 poItemQty;
public double poDiscount;
public double poItemRateTaxExclusive;
}
My structure in C++ DLL looks like this
:
struct InputPurchaseOrder
{
LPSTR poJobName;
LPSTR poTradeName;
int poItemQty ;
double poDiscount;
double poItemRateTaxExclusive
;
}
When I pass the structure through C#, everything is passing to DLL, except the two double values. It is paasing these values as 0.00 rather than the exact values passed.
The other values like string, int are passing with their respected values.
I am passing the structure in C# as value type.
Pls help in understanding:
1. How to Marshal double values from C# to a C++ DLL.
2. What are the possible steps to be taken care while passing double values to a C++ DLL
Reply
Answers (
0
)
What event Fired when User doubleclicks a row on the datagrid.
Please needed help ragarding Problem in Convertion of pages frm HTML to XHTML/ or designing pages compatible to .net 2005