Click here to Skip to main content
15,916,941 members
Home / Discussions / C#
   

C#

 
GeneralRe: for statement with divide sums Pin
Yustme11-Nov-06 11:11
Yustme11-Nov-06 11:11 
QuestionIt seems stuped question but i have to know the answer. Pin
barak16048711-Nov-06 0:56
barak16048711-Nov-06 0:56 
AnswerRe: It seems stuped question but i have to know the answer. Pin
Stefan Troschuetz11-Nov-06 1:41
Stefan Troschuetz11-Nov-06 1:41 
QuestionCommand for EchoOff & EchoOn in C#...? Pin
IamHuM11-Nov-06 0:53
IamHuM11-Nov-06 0:53 
AnswerRe: Command for EchoOff & EchoOn in C#...? Pin
sj_h111-Nov-06 4:16
sj_h111-Nov-06 4:16 
QuestionUnmanaged exceptions in managed code Pin
Daniel_at_Scania10-Nov-06 23:01
Daniel_at_Scania10-Nov-06 23:01 
AnswerRe: Unmanaged exceptions in managed code Pin
mav.northwind11-Nov-06 20:47
mav.northwind11-Nov-06 20:47 
QuestionHelp: Running error while invoking unmanaged code Pin
mtk00810-Nov-06 16:27
mtk00810-Nov-06 16:27 
Judge.dll defines following two struct types and exports the method
i4IcsJudgeStartGame. In csharp code there is a wrapper for this method.
Building succeeds, but running get an exception:
{System.Runtime.InteropServices.MarshalDirectiveException}
{"Can not marshal parameter #4: Invalid managed/unmanaged type combination
(this value type must be paired with Struct)." }

Frown | :( :Please help me, what's the problem in these code.

============================ in Judge.dll ========================
struct IcsGameRule
{
int fgHasTimeLmt;
unsigned short int u2RangZi;
unsigned short int u2TieMu;
};

struct IcsGameTime
{
unsigned char ucHour;
unsigned char ucMiniute;
unsigned char ucDumiaoLen;
unsigned char ucDumiaoCnt;
};

DllExport int i4IcsJudgeStartGame(unsigned int Judge,
int Type,
struct IcsGameRule Rule,
struct IcsGameTime Time);




===================== in csharp wrapper ==================================
[StructLayout(LayoutKind.Sequential)]
public struct GameRule
{
public int HasTimeLmt;
public ushort RangZi;
public ushort TieMu;
}

[StructLayout(LayoutKind.Sequential)]
public struct GameTime
{
public byte Hour;
public byte Miniute;
public byte DumiaoLen;
public byte DumiaoCnt;
}

[DllImport("judge.dll")]
private static extern int i4IcsJudgeStartGame(
[MarshalAs(UnmanagedType.U4)]uint judge,
[MarshalAs(UnmanagedType.I4)]GameType type, //GameType is enum
[MarshalAs(UnmanagedType.LPStruct)]GameRule rule,
[MarshalAs(UnmanagedType.LPStruct)]GameTime time);

AnswerRe: Help: Running error while invoking unmanaged code Pin
mav.northwind10-Nov-06 19:34
mav.northwind10-Nov-06 19:34 
GeneralRe: Help: Running error while invoking unmanaged code Pin
mtk00810-Nov-06 20:26
mtk00810-Nov-06 20:26 
QuestionEvent of dynamically created control problem - please help Pin
Kasic Slobodan10-Nov-06 15:42
Kasic Slobodan10-Nov-06 15:42 
AnswerRe: Event of dynamically created control problem - please help Pin
Guffa10-Nov-06 15:50
Guffa10-Nov-06 15:50 
QuestionRe: Event of dynamically created control problem - please help Pin
Kasic Slobodan11-Nov-06 2:44
Kasic Slobodan11-Nov-06 2:44 
AnswerRe: Event of dynamically created control problem - please help Pin
Guffa11-Nov-06 6:22
Guffa11-Nov-06 6:22 
QuestionRe: Event of dynamically created control problem - please help [modified] Pin
Kasic Slobodan11-Nov-06 16:04
Kasic Slobodan11-Nov-06 16:04 
QuestionRe: Event of dynamically created control problem - please help Pin
Kasic Slobodan16-Nov-06 15:34
Kasic Slobodan16-Nov-06 15:34 
AnswerRe: Event of dynamically created control problem - please help Pin
Kasic Slobodan19-Nov-06 8:03
Kasic Slobodan19-Nov-06 8:03 
QuestionHOOK YahooMessenger Pin
cuongcntt200210-Nov-06 14:18
cuongcntt200210-Nov-06 14:18 
AnswerRe: HOOK YahooMessenger Pin
aamironline10-Nov-06 15:58
aamironline10-Nov-06 15:58 
QuestionProblem with Connect to SqlServer 2000 From Client Pin
hdv21210-Nov-06 13:08
hdv21210-Nov-06 13:08 
AnswerRe: Problem with Connect to SqlServer 2000 From Client Pin
Guffa10-Nov-06 15:53
Guffa10-Nov-06 15:53 
QuestionWeb Service receiving parameters Pin
fjbotto10-Nov-06 9:09
fjbotto10-Nov-06 9:09 
AnswerRe: Web Service receiving parameters Pin
aamironline10-Nov-06 16:01
aamironline10-Nov-06 16:01 
Questionhow to pass parameter to CrystalReports ? Pin
hdv21210-Nov-06 8:00
hdv21210-Nov-06 8:00 
AnswerRe: how to pass parameter to CrystalReports ? Pin
ednrgc10-Nov-06 8:44
ednrgc10-Nov-06 8:44 

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.