Click here to Skip to main content
15,892,927 members
Home / Discussions / C#
   

C#

 
AnswerRe: Local Database cached with C# Pin
Mycroft Holmes16-Aug-09 16:40
professionalMycroft Holmes16-Aug-09 16:40 
QuestionA question related to Computers connection using C# Pin
CoderForEver16-Aug-09 10:11
CoderForEver16-Aug-09 10:11 
AnswerRe: A question related to Computers connection using C# Pin
Saksida Bojan16-Aug-09 11:03
Saksida Bojan16-Aug-09 11:03 
GeneralRe: A question related to Computers connection using C# Pin
CoderForEver16-Aug-09 21:54
CoderForEver16-Aug-09 21:54 
GeneralRe: A question related to Computers connection using C# Pin
Saksida Bojan16-Aug-09 23:43
Saksida Bojan16-Aug-09 23:43 
GeneralRe: A question related to Computers connection using C# Pin
Henry Minute17-Aug-09 0:59
Henry Minute17-Aug-09 0:59 
GeneralRe: A question related to Computers connection using C# Pin
CoderForEver17-Aug-09 8:33
CoderForEver17-Aug-09 8:33 
QuestionMore marshaling woes :-( Pin
DaveyM6916-Aug-09 8:48
professionalDaveyM6916-Aug-09 8:48 
This is the C code from MSDN[^]:
typedef struct { 
    DWORD dwDeltaTime; 
    DWORD dwStreamID; 
    DWORD dwEvent; 
    DWORD dwParms[]; // this is the problem!
} MIDIEVENT;
The problem is with the array as the dwParms field.

If I just want one value, no problem - I just declare the struct like this:
[StructLayout(LayoutKind.Sequential)]
public struct MIDIEVENT
{
    public int dwDeltaTime;
    private int dwStreamID;
    public uint dwEvent;
    public uint dwParms;
}
... and it works fine, but when I need an array of uints I can't make it work. If I change the last C# field to
[MarshalAs(UnmanagedType.ByValArray)]
public uint[] dwParms;
then it works fine but only gets the first element. If I specify a SizeConst then I can get all the values fine, but I have no way of knowing how many elements there will be at compile time.

Help!

Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
Why are you using VB6? Do you hate yourself? (Christian Graus)

AnswerRe: More marshaling woes :-( Pin
Luc Pattyn16-Aug-09 8:58
sitebuilderLuc Pattyn16-Aug-09 8:58 
GeneralRe: More marshaling woes :-( Pin
DaveyM6916-Aug-09 9:51
professionalDaveyM6916-Aug-09 9:51 
GeneralRe: More marshaling woes :-( Pin
Luc Pattyn16-Aug-09 10:33
sitebuilderLuc Pattyn16-Aug-09 10:33 
GeneralRe: More marshaling woes :-( Pin
DaveyM6917-Aug-09 0:46
professionalDaveyM6917-Aug-09 0:46 
GeneralRe: More marshaling woes :-( Pin
Luc Pattyn17-Aug-09 1:13
sitebuilderLuc Pattyn17-Aug-09 1:13 
GeneralRe: More marshaling woes :-( Pin
DaveyM6917-Aug-09 1:50
professionalDaveyM6917-Aug-09 1:50 
AnswerRe: More marshaling woes :-( Pin
Hristo-Bojilov16-Aug-09 9:04
Hristo-Bojilov16-Aug-09 9:04 
GeneralRe: More marshaling woes :-( Pin
DaveyM6916-Aug-09 10:03
professionalDaveyM6916-Aug-09 10:03 
GeneralAdditional information Pin
Pete O'Hanlon16-Aug-09 10:22
mvePete O'Hanlon16-Aug-09 10:22 
GeneralRe: Additional information Pin
Luc Pattyn16-Aug-09 10:38
sitebuilderLuc Pattyn16-Aug-09 10:38 
GeneralRe: Additional information Pin
Pete O'Hanlon16-Aug-09 10:41
mvePete O'Hanlon16-Aug-09 10:41 
GeneralRe: Additional information Pin
DaveyM6916-Aug-09 10:52
professionalDaveyM6916-Aug-09 10:52 
GeneralRe: Additional information Pin
Pete O'Hanlon16-Aug-09 10:58
mvePete O'Hanlon16-Aug-09 10:58 
GeneralRe: Additional information Pin
Luc Pattyn16-Aug-09 11:14
sitebuilderLuc Pattyn16-Aug-09 11:14 
GeneralRe: Additional information Pin
Pete O'Hanlon16-Aug-09 11:19
mvePete O'Hanlon16-Aug-09 11:19 
GeneralRe: Additional information Pin
DaveyM6916-Aug-09 11:50
professionalDaveyM6916-Aug-09 11:50 
QuestionSelected tab that affect on listbox Pin
tamir90116-Aug-09 8:15
tamir90116-Aug-09 8:15 

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.