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:
Expand|Select|Wrap|Line Numbers
- [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;
- }
I am passing the structure in C# as value type. Even I tried passing as ref .but It did not work.
What may be the reason for this type of behaviour?
Please suggest me with your valuable comments ASAP.