Click here to Skip to main content
15,888,521 members
Home / Discussions / C#
   

C#

 
AnswerRe: reportAppFactory.OpenDocument throws Invalid Cast exception (No such interfaces supported) Pin
phil.o6-Sep-10 23:28
professionalphil.o6-Sep-10 23:28 
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 
Hi
I am writing a C# app that talks TCP/IP to a development board. The board has C command struct packets defined below.

#define MAX_PACKET_PAYLOAD 1024
typedef enum packetCmds_enum {
PC_TO_DSP_WRITE = 1,
PC_TO_DSP_READ = 2,
DSP_TO_PC_ACK = 3
}packetCmds_enum;

//@brief This packet is sent from the DSP to the PC as a command.
typedef struct cmdPacket_type {
packetCmds_enum cmd; //< Should be 32 bits
Uint32 size; //< Set to zero if no data
Uint32 addr; //< Target address
Uint8 data[MAX_PACKET_PAYLOAD];
Uint32 checksum; //< Includes cmd, size, addr and data.
} cmdPacket_type;

I started programming it as public struct but then ran into an issue with the Uint8 data array. If I use

byte[] data = new byte[MAX_PACKET_PAYLOAD]

then I won't get the same structure because its an object.

I'm also using the System.NET.socket library to get the packet from the board.

socket.Receive(bytesReceived)

I've learned that I can't typecast bytesReceived to cmdPacket_type, so whats the cleanest way for me to parse the packet?

I also have to send packets to the dev board, but once I understand the conversion between un-managed and managed code (if thats even possible), I should be able to figure it out.

Thanks

Cheers
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 
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 

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.