Click here to Skip to main content
15,887,436 members
Home / Discussions / C#
   

C#

 
QuestionC# area map Pin
Zap-Man22-Feb-09 12:01
Zap-Man22-Feb-09 12:01 
AnswerRe: C# area map Pin
fly90422-Feb-09 12:13
fly90422-Feb-09 12:13 
GeneralRe: C# area map Pin
Zap-Man22-Feb-09 14:40
Zap-Man22-Feb-09 14:40 
GeneralRe: C# area map Pin
fly90422-Feb-09 15:06
fly90422-Feb-09 15:06 
GeneralRe: C# area map Pin
Zap-Man22-Feb-09 15:18
Zap-Man22-Feb-09 15:18 
GeneralRe: C# area map [modified] Pin
fly90423-Feb-09 0:04
fly90423-Feb-09 0:04 
GeneralRe: C# area map Pin
Zap-Man23-Feb-09 13:41
Zap-Man23-Feb-09 13:41 
QuestionPassable function Pin
Chris Copeland22-Feb-09 10:04
mveChris Copeland22-Feb-09 10:04 
Hey.

I'm trying to create a client which responds to specific packets. The idea is, i'm going to have a large array of struct "packet" which stores information such as, the type of packet, the length of the sent packet, and a corresponding function it should call.

I know in C++ you can parse functions as parameters quite easily, or with some coding. However, in C# you need to use either delegate functions, or use the Reflection.MethodInfo methods.

The delegate functions may work, but the code to setup each row for my array would be extremely long and rather messy. I tried using the MethodInfo method instead, but the functions i'll be calling are marked with unsafe, and so my byte* parameter can't be passed through as an object in the object[] params :\

Is there any other method I could use to automate this system? Here's a snippet of what I mean:

_packetDB[++i] = new Packet() { type = 0x73, len = 11, func = "authok" };


Where "authok" is a function in a class foo. (When the packet is received, it will search for packet 0x73, and send the byte* data, the length into the function func)

Any help would be greatly appreciated.
Thanks
AnswerRe: Passable function Pin
Jon Rista22-Feb-09 10:54
Jon Rista22-Feb-09 10:54 
GeneralRe: Passable function Pin
Chris Copeland22-Feb-09 11:02
mveChris Copeland22-Feb-09 11:02 
GeneralRe: Passable function Pin
Jon Rista22-Feb-09 11:16
Jon Rista22-Feb-09 11:16 
QuestionHow to enable auto scroll in a listbox? Pin
bar300022-Feb-09 9:20
bar300022-Feb-09 9:20 
AnswerRe: How to enable auto scroll in a listbox? Pin
Luis Alonso Ramos22-Feb-09 9:34
Luis Alonso Ramos22-Feb-09 9:34 
GeneralRe: How to enable auto scroll in a listbox? Pin
bar300022-Feb-09 9:48
bar300022-Feb-09 9:48 
GeneralRe: How to enable auto scroll in a listbox? Pin
Luis Alonso Ramos22-Feb-09 10:11
Luis Alonso Ramos22-Feb-09 10:11 
GeneralRe: How to enable auto scroll in a listbox? Pin
Luis Alonso Ramos22-Feb-09 10:30
Luis Alonso Ramos22-Feb-09 10:30 
AnswerRe: How to enable auto scroll in a listbox? Pin
Luc Pattyn22-Feb-09 10:11
sitebuilderLuc Pattyn22-Feb-09 10:11 
GeneralRe: How to enable auto scroll in a listbox? Pin
bar300023-Feb-09 7:08
bar300023-Feb-09 7:08 
GeneralRe: How to enable auto scroll in a listbox? Pin
Luc Pattyn23-Feb-09 7:27
sitebuilderLuc Pattyn23-Feb-09 7:27 
QuestionIHTMLElement to Bitmap Pin
Sunset Towers22-Feb-09 9:14
Sunset Towers22-Feb-09 9:14 
QuestionHow to query and execute code according to result.. Pin
High0ctane22-Feb-09 8:59
High0ctane22-Feb-09 8:59 
AnswerRe: How to query and execute code according to result.. Pin
Luis Alonso Ramos22-Feb-09 9:12
Luis Alonso Ramos22-Feb-09 9:12 
GeneralRe: How to query and execute code according to result.. Pin
High0ctane22-Feb-09 12:17
High0ctane22-Feb-09 12:17 
QuestionHow to make pdf file ? Pin
E_Gold22-Feb-09 8:42
E_Gold22-Feb-09 8:42 
AnswerRe: How to make pdf file ? Pin
Luis Alonso Ramos22-Feb-09 9:16
Luis Alonso Ramos22-Feb-09 9:16 

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.