Click here to Skip to main content
15,913,758 members
Home / Discussions / C#
   

C#

 
AnswerRe: Overwrite one section of binary file Pin
Dave Kreskowiak30-Oct-05 9:45
mveDave Kreskowiak30-Oct-05 9:45 
GeneralRe: Overwrite one section of binary file Pin
tommazzo30-Oct-05 12:36
tommazzo30-Oct-05 12:36 
QuestionHow to embed newline in a string resource? Pin
Rob Philpott29-Oct-05 8:43
Rob Philpott29-Oct-05 8:43 
AnswerRe: How to embed newline in a string resource? Pin
Judah Gabriel Himango29-Oct-05 15:08
sponsorJudah Gabriel Himango29-Oct-05 15:08 
GeneralRe: How to embed newline in a string resource? Pin
Rob Philpott30-Oct-05 4:59
Rob Philpott30-Oct-05 4:59 
QuestionHow to set limit to the bandwidth usage? Pin
dunbshy29-Oct-05 6:38
dunbshy29-Oct-05 6:38 
AnswerRe: How to set limit to the bandwidth usage? Pin
Dave Kreskowiak29-Oct-05 7:21
mveDave Kreskowiak29-Oct-05 7:21 
QuestionDelphi Dlls in C# Pin
Dave Shaw29-Oct-05 6:38
Dave Shaw29-Oct-05 6:38 
Hi, I have a Delphi 6 DLL that I need to run from C#.Net 2.0. I have some problems with it though.

Here Goes:

The Delphi Decalration is :
<br />
function M_Login(ip : PChar; port : LongInt; uci : PChar; vol : PChar; pass : PChar; user : PChar) : LongInt; stdCall;<br />

And the C# Declaration is :
<br />
[DllImport("iMSMAPI.DLL", CallingConvention = CallingConvention.StdCall, CharSet=CharSet.Ansi)]<br />
        private static extern Int64 M_Login(string ip, Int64 port, string uci, string vol, string pass, string user);<br />


This gives me an AccessViolationException at RunTime when I call M_Login.

I can Change the Delphi Declaration to expect Strings instead of PChars, this avoids the AccessViolationError, but this causes the values passed to the Delphi DLL to be incorrect. i.e. contain characters that the C# Application did not pass. I passed the value "127.0.0.1" as the ip parameter in C# and when I inspected the ip parameter in Delphi it was '1'#0'2'#0'7'#0'.'#0'0' .

Can anyone help.


Thanx!

Dave Shaw
History admires the wise, but elevates the brave. - Edmund Morris

AnswerRe: Delphi Dlls in C# Pin
S. Senthil Kumar29-Oct-05 7:39
S. Senthil Kumar29-Oct-05 7:39 
GeneralRe: Delphi Dlls in C# Pin
Dave Shaw29-Oct-05 13:50
Dave Shaw29-Oct-05 13:50 
Questionpublic static const member? Pin
budidharma29-Oct-05 6:26
budidharma29-Oct-05 6:26 
AnswerRe: public static const member? Pin
S. Senthil Kumar29-Oct-05 7:46
S. Senthil Kumar29-Oct-05 7:46 
AnswerRe: public static const member? Pin
Robert Rohde29-Oct-05 20:49
Robert Rohde29-Oct-05 20:49 
QuestionHow to visualize a machine scheduling plan? Pin
bjung29-Oct-05 6:09
bjung29-Oct-05 6:09 
AnswerRe: How to visualize a machine scheduling plan? Pin
Tom Ollar29-Oct-05 10:42
Tom Ollar29-Oct-05 10:42 
QuestionPassing values to another Form Pin
rich_wenger29-Oct-05 6:06
rich_wenger29-Oct-05 6:06 
AnswerRe: Passing values to another Form Pin
S. Senthil Kumar29-Oct-05 7:54
S. Senthil Kumar29-Oct-05 7:54 
GeneralRe: Passing values to another Form Pin
rich_wenger29-Oct-05 10:00
rich_wenger29-Oct-05 10:00 
GeneralRe: Passing values to another Form Pin
S. Senthil Kumar29-Oct-05 19:17
S. Senthil Kumar29-Oct-05 19:17 
AnswerRe: Passing values to another Form Pin
Aldorado29-Oct-05 13:37
Aldorado29-Oct-05 13:37 
GeneralRe: Passing values to another Form Pin
S. Senthil Kumar29-Oct-05 19:15
S. Senthil Kumar29-Oct-05 19:15 
QuestionHow to determine namespace for a class Pin
SharpSmith29-Oct-05 4:52
SharpSmith29-Oct-05 4:52 
AnswerRe: How to determine namespace for a class Pin
Guffa29-Oct-05 5:12
Guffa29-Oct-05 5:12 
GeneralRe: How to determine namespace for a class Pin
SharpSmith29-Oct-05 5:32
SharpSmith29-Oct-05 5:32 
QuestionSocket Connections Pin
budidharma29-Oct-05 4:33
budidharma29-Oct-05 4:33 

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.