Click here to Skip to main content
15,900,378 members
Home / Discussions / C#
   

C#

 
GeneralRe: Reminder System Pin
Dave Kreskowiak2-Jul-05 16:29
mveDave Kreskowiak2-Jul-05 16:29 
GeneralRe: Reminder System Pin
Adoremi3-Jul-05 15:39
Adoremi3-Jul-05 15:39 
GeneralRe: Reminder System Pin
Dave Kreskowiak3-Jul-05 16:16
mveDave Kreskowiak3-Jul-05 16:16 
QuestionHow to use AND operator in sql?? Pin
fire8529-Jun-05 22:31
fire8529-Jun-05 22:31 
AnswerRe: How to use AND operator in sql?? Pin
mav.northwind29-Jun-05 22:38
mav.northwind29-Jun-05 22:38 
GeneralRe: How to use AND operator in sql?? Pin
fire8529-Jun-05 22:42
fire8529-Jun-05 22:42 
GeneralMaking A Phone Call With TAPI 3 Pin
Andre Trollip29-Jun-05 21:54
Andre Trollip29-Jun-05 21:54 
GeneralRe: Making A Phone Call With TAPI 3 Pin
mav.northwind29-Jun-05 22:03
mav.northwind29-Jun-05 22:03 
GeneralRe: Making A Phone Call With TAPI 3 Pin
Andre Trollip29-Jun-05 22:20
Andre Trollip29-Jun-05 22:20 
Generaleditable menu Pin
g00fyman29-Jun-05 21:26
g00fyman29-Jun-05 21:26 
GeneralSecure Remoting Pin
esjq29-Jun-05 21:16
esjq29-Jun-05 21:16 
GeneralRe: Secure Remoting Pin
Adam Goossens30-Jun-05 16:48
Adam Goossens30-Jun-05 16:48 
Generalquestion on Lucene Search Engine Pin
ekynox29-Jun-05 20:41
ekynox29-Jun-05 20:41 
GeneralRectangle problem Pin
Rassul Yunussov29-Jun-05 19:47
Rassul Yunussov29-Jun-05 19:47 
GeneralRe: Rectangle problem Pin
mav.northwind29-Jun-05 20:46
mav.northwind29-Jun-05 20:46 
GeneralMDI Application Pin
deep729-Jun-05 19:45
deep729-Jun-05 19:45 
GeneralRe: MDI Application Pin
sreejith ss nair29-Jun-05 21:39
sreejith ss nair29-Jun-05 21:39 
GeneralCollection Pin
Rassul Yunussov29-Jun-05 19:13
Rassul Yunussov29-Jun-05 19:13 
GeneralRe: Collection Pin
Christian Graus29-Jun-05 19:23
protectorChristian Graus29-Jun-05 19:23 
GeneralOleDbTransaction (rollback) Pin
myNameIsRon29-Jun-05 19:12
myNameIsRon29-Jun-05 19:12 
GeneralTrouble with marshalling structure Pin
Josh Lindenmuth29-Jun-05 18:42
Josh Lindenmuth29-Jun-05 18:42 
Hello,

We are trying to marshal a simple C structure within our C# code. All values are coming across except for doubles (bolded below). A double comes across as junk. Any help you can provide would be appreciated.

Here is our C structure:
<br />
struct other_earn {<br />
   short o_id;<br />
   char o_desc[12];<br />
   char o_tpind[2];<br />
   char o_payee[31];<br />
   char o_addr1[31];<br />
   char o_addr2[31];<br />
   char o_addr3[31];<br />
   char o_hours[2];<br />
   double o_amt1;<br />
   short o_dept;<br />
   char o_txficas[2];<br />
   char o_txficam[2];<br />
   char o_txfit[2];<br />
   char o_txfuta[2];<br />
   char o_txsit[2];<br />
   char o_txsuta[2];<br />
   char o_txloc[2];<br />
   short o_mdt;<br />
   char o_wcexempt[2];<br />
}<br />


And here is how we marshal the struct. Note that all fields except the double are marshalled without issue. We have the same problem with all our other structs:

<br />
        [StructLayout(LayoutKind.Sequential)]<br />
        public struct ROtherEarn<br />
        {<br />
            public Int16 o_id;<br />
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)]<br />
            public String o_desc;<br />
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]<br />
            public String o_tpind;<br />
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)]<br />
            public String o_payee;<br />
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)]<br />
            public String o_addr1;<br />
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)]<br />
            public String o_addr2;<br />
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)]<br />
            public String o_addr3;<br />
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]<br />
            public String o_hours;<br />
            public Double o_amt1;<br />
            public Int16 o_dept;<br />
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]<br />
            public String o_txficas;<br />
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]<br />
            public String o_txficam;<br />
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]<br />
            public String o_txfit;<br />
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]<br />
            public String o_txfuta;<br />
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]<br />
            public String o_txsit;<br />
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]<br />
            public String o_txsuta;<br />
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]<br />
            public String o_txloc;<br />
            public Int16 o_mdt;<br />
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]<br />
            public String o_wcexempt;<br />
        }<br />


Thanks,
Josh Lindenmuth
GeneralRe: Trouble with marshalling structure Pin
Bojan Rajkovic30-Jun-05 15:50
Bojan Rajkovic30-Jun-05 15:50 
Generalfunction template Pin
BicycleTheif29-Jun-05 17:55
BicycleTheif29-Jun-05 17:55 
GeneralRe: function template Pin
Christian Graus29-Jun-05 18:12
protectorChristian Graus29-Jun-05 18:12 
GeneralI have trouble with fgets function in C code Pin
dinh van hai29-Jun-05 17:20
dinh van hai29-Jun-05 17:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.