Click here to Skip to main content
15,920,801 members
Home / Discussions / C#
   

C#

 
AnswerRe: reportAppFactory.OpenDocument throws Invalid Cast exception (No such interfaces supported) Pin
amitcoder836-Sep-10 23:39
amitcoder836-Sep-10 23:39 
GeneralRe: reportAppFactory.OpenDocument throws Invalid Cast exception (No such interfaces supported) Pin
Rhys Gravell6-Sep-10 23:43
professionalRhys Gravell6-Sep-10 23:43 
GeneralRe: reportAppFactory.OpenDocument throws Invalid Cast exception (No such interfaces supported) Pin
amitcoder836-Sep-10 23:46
amitcoder836-Sep-10 23:46 
GeneralRe: reportAppFactory.OpenDocument throws Invalid Cast exception (No such interfaces supported) Pin
Rhys Gravell6-Sep-10 23:53
professionalRhys Gravell6-Sep-10 23:53 
GeneralRe: reportAppFactory.OpenDocument throws Invalid Cast exception (No such interfaces supported) [modified] Pin
phil.o7-Sep-10 0:00
professionalphil.o7-Sep-10 0:00 
AnswerRe: reportAppFactory.OpenDocument throws Invalid Cast exception (No such interfaces supported) Pin
Bernhard Hiller7-Sep-10 0:05
Bernhard Hiller7-Sep-10 0:05 
QuestionHow to write C# struct with array to communicate via IP to C struct device Pin
ejp666-Sep-10 16:12
ejp666-Sep-10 16:12 
AnswerRe: How to write C# struct with array to communicate via IP to C struct device Pin
Luc Pattyn6-Sep-10 16:48
sitebuilderLuc Pattyn6-Sep-10 16:48 
Hi,

here is a partial answer for you:

1.
in order to call native (or unmanaged) code from C#, you need P/Invoke. It isn't very simple, however there is a lot of information available, use Google. I have an unfinished article here[^]. Unfortunately for you, structs will be handled in part 2, which isn't available yet.

2.
to mimic native numeric arrays (with a constant size) in a C# struct, you need MarshalAttribute; it may look like:
struct ... {
    ...
    [MarshalAs(UnmanagedType.ByValArray, SizeConst=1024)]
    byte[] byteArray;
    ...
}


Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


AnswerRe: How to write C# struct with array to communicate via IP to C struct device Pin
DaveyM696-Sep-10 22:18
professionalDaveyM696-Sep-10 22:18 
GeneralRe: How to write C# struct with array to communicate via IP to C struct device Pin
Paul Michalik7-Sep-10 9:42
Paul Michalik7-Sep-10 9:42 
Questionsend file with bluetooth from pc to phone without accept Pin
behzadcp6-Sep-10 8:31
professionalbehzadcp6-Sep-10 8:31 
AnswerRe: send file with bluetooth from pc to phone without accept Pin
Smithers-Jones6-Sep-10 8:42
Smithers-Jones6-Sep-10 8:42 
GeneralRe: send file with bluetooth from pc to phone without accept Pin
behzadcp6-Sep-10 9:01
professionalbehzadcp6-Sep-10 9:01 
GeneralRe: send file with bluetooth from pc to phone without accept Pin
DaveyM696-Sep-10 9:05
professionalDaveyM696-Sep-10 9:05 
GeneralRe: send file with bluetooth from pc to phone without accept Pin
Dave Kreskowiak6-Sep-10 17:41
mveDave Kreskowiak6-Sep-10 17:41 
AnswerRe: send file with bluetooth from pc to phone without accept Pin
allen-homen6-Sep-10 20:11
allen-homen6-Sep-10 20:11 
Questiontextbox like IE Pin
zzinbalzz6-Sep-10 6:40
zzinbalzz6-Sep-10 6:40 
AnswerRe: textbox like IE Pin
DaveyM696-Sep-10 8:24
professionalDaveyM696-Sep-10 8:24 
GeneralRe: textbox like IE Pin
allen-homen6-Sep-10 20:21
allen-homen6-Sep-10 20:21 
AnswerRe: textbox like IE Pin
V.6-Sep-10 20:25
professionalV.6-Sep-10 20:25 
QuestionDraw line in RichTextBox C# Pin
jojoba20116-Sep-10 4:55
jojoba20116-Sep-10 4:55 
AnswerRe: Draw line in RichTextBox C# Pin
Luc Pattyn6-Sep-10 5:07
sitebuilderLuc Pattyn6-Sep-10 5:07 
GeneralRe: Draw line in RichTextBox C# Pin
OriginalGriff6-Sep-10 5:33
mveOriginalGriff6-Sep-10 5:33 
GeneralRe: Draw line in RichTextBox C# Pin
Luc Pattyn6-Sep-10 5:49
sitebuilderLuc Pattyn6-Sep-10 5:49 
GeneralRe: Draw line in RichTextBox C# Pin
jojoba20116-Sep-10 5:56
jojoba20116-Sep-10 5:56 

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.