Click here to Skip to main content
15,923,015 members
Home / Discussions / C#
   

C#

 
AnswerRe: Zooming a group of controls Pin
Paul Conrad12-Oct-07 13:33
professionalPaul Conrad12-Oct-07 13:33 
GeneralRe: Zooming a group of controls Pin
wolfshad312-Oct-07 13:39
wolfshad312-Oct-07 13:39 
QuestionAccess to Object (TextBox or ListBox) from a Thread Pin
Patricio Tapia11-Oct-07 12:56
Patricio Tapia11-Oct-07 12:56 
AnswerRe: Access to Object (TextBox or ListBox) from a Thread Pin
Luc Pattyn11-Oct-07 13:25
sitebuilderLuc Pattyn11-Oct-07 13:25 
QuestionRe: Access to Object (TextBox or ListBox) from a Thread Pin
Patricio Tapia11-Oct-07 15:34
Patricio Tapia11-Oct-07 15:34 
AnswerRe: Access to Object (TextBox or ListBox) from a Thread Pin
Luc Pattyn11-Oct-07 15:50
sitebuilderLuc Pattyn11-Oct-07 15:50 
GeneralRe: Access to Object (TextBox or ListBox) from a Thread Pin
Patricio Tapia11-Oct-07 19:41
Patricio Tapia11-Oct-07 19:41 
Questionc# calling unmanaged C Pin
j10000_18611-Oct-07 12:53
j10000_18611-Oct-07 12:53 
I am trying to pass a structure to unmanaged C and the unmangaed C returns an error because it thinks a value within the struture is set to a different value then the c# has set it to prior to passing it to the unmanaged c. I dont't have access to the C code.

[StructLayout(LayoutKind.Sequential)]<br />
    public struct PASSTHRU_MSG<br />
    {<br />
        public UInt32? ProtocolID;<br />
        public UInt32? RxStatus;<br />
        public UInt32? TxFlags;<br />
        public UInt32? Timestamp;<br />
        public UInt32? DataSize;<br />
        public UInt32? ExtraDataIndex;<br />
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4128)] <br />
        public byte[] Data;<br />
    }<br />
<br />
    [DllImport("CARDA432.DLL", EntryPoint = "PassThruStartMsgFilter", ExactSpelling     =true)]<br />
        public static extern UInt32 PassThruStartMsgFilter(UInt32 ChannelID, UInt32 FilterType, ref PASSTHRU_MSG pMaskMsg, ref PASSTHRU_MSG pPatternMsg, ref PASSTHRU_MSG pFlowControlMsg,ref UInt32 pMsgID);<br />
<br />
            MaskMsg.Data = new byte[4128];<br />
            MaskMsg.ProtocolID = 5;<br />
            MaskMsg.DataSize = 4;<br />
            MaskMsg.Data[0] = 0xff;<br />
            MaskMsg.Data[1] = 0xff;<br />
            MaskMsg.Data[2] = 0xff;<br />
            MaskMsg.Data[3] = 0xff;<br />
            PatternMsg.Data = new byte[4128];<br />
            PatternMsg.ProtocolID = 5;<br />
            PatternMsg.DataSize = 4;<br />
            PatternMsg.Data[0] = 0x00;<br />
            PatternMsg.Data[1] = 0x00;<br />
            PatternMsg.Data[2] = 0x07;<br />
            PatternMsg.Data[3] = 0xE8;<br />
<br />
            FlowMsg.Data = new byte[4128];<br />
            FlowMsg.ProtocolID = 5;<br />
            FlowMsg.TxFlags = 0;<br />
            FlowMsg.DataSize = 0x04;<br />
            FlowMsg.Data[0] = 0x00;<br />
            FlowMsg.Data[1] = 0x00;<br />
            FlowMsg.Data[2] = 0x07;<br />
            FlowMsg.Data[3] = 0xE8;<br />
<br />
            if ((status = PassThruStartMsgFilter(ChannelID, FLOW_CONTROL_FILTER, ref   MaskMsg, ref PatternMsg, ref FlowMsg, ref FilterID)) != STATUS_NOERROR)<br />
            {<br />
                status = PassThruGetLastError(serror);<br />
                MessageBox.Show(serror.ToString());<br />
            }<br />

the function returns an error stating that the MaskMsg.ProtocolID = 1 (the code is expecting 5 as set by the c# code) and I can't figure out why? There must be an issue with the memory getting overwritten or the "pointer" not being referenced properly.
GeneralRe: c# calling unmanaged C [modified] Pin
j10000_18611-Oct-07 13:03
j10000_18611-Oct-07 13:03 
GeneralRe: c# calling unmanaged C Pin
Luc Pattyn11-Oct-07 13:27
sitebuilderLuc Pattyn11-Oct-07 13:27 
GeneralRe: c# calling unmanaged C Pin
j10000_18611-Oct-07 13:41
j10000_18611-Oct-07 13:41 
GeneralRe: c# calling unmanaged C Pin
Luc Pattyn11-Oct-07 14:03
sitebuilderLuc Pattyn11-Oct-07 14:03 
GeneralRe: c# calling unmanaged C Pin
j10000_18611-Oct-07 14:52
j10000_18611-Oct-07 14:52 
GeneralRe: c# calling unmanaged C Pin
j10000_18612-Oct-07 0:51
j10000_18612-Oct-07 0:51 
GeneralRe: c# calling unmanaged C Pin
Luc Pattyn12-Oct-07 2:48
sitebuilderLuc Pattyn12-Oct-07 2:48 
QuestionGridView Bound column Pin
ss.mmm11-Oct-07 11:16
ss.mmm11-Oct-07 11:16 
QuestionSome kind of timer.. Pin
Joplinazz11-Oct-07 10:59
Joplinazz11-Oct-07 10:59 
AnswerRe: Some kind of timer.. Pin
Pete O'Hanlon11-Oct-07 11:08
mvePete O'Hanlon11-Oct-07 11:08 
AnswerRe: Some kind of timer.. Pin
Justin Perez11-Oct-07 11:11
Justin Perez11-Oct-07 11:11 
GeneralRe: Some kind of timer.. Pin
Joplinazz11-Oct-07 11:16
Joplinazz11-Oct-07 11:16 
GeneralRe: Some kind of timer.. Pin
Justin Perez11-Oct-07 11:19
Justin Perez11-Oct-07 11:19 
GeneralRe: Some kind of timer.. Pin
Pete O'Hanlon11-Oct-07 11:28
mvePete O'Hanlon11-Oct-07 11:28 
GeneralRe: Some kind of timer.. Pin
Justin Perez11-Oct-07 11:36
Justin Perez11-Oct-07 11:36 
GeneralRe: Some kind of timer.. Pin
Pete O'Hanlon11-Oct-07 11:46
mvePete O'Hanlon11-Oct-07 11:46 
GeneralRe: Some kind of timer.. Pin
Justin Perez11-Oct-07 11:51
Justin Perez11-Oct-07 11:51 

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.