Click here to Skip to main content
15,879,348 members
Home / Discussions / C#
   

C#

 
GeneralRe: Copy or read locked/in use files Pin
stancrm31-May-06 23:47
stancrm31-May-06 23:47 
GeneralRe: Copy or read locked/in use files Pin
nemopeti31-May-06 23:54
nemopeti31-May-06 23:54 
QuestionIs it a correct way Pin
engsrini31-May-06 20:43
engsrini31-May-06 20:43 
AnswerRe: Is it a correct way Pin
BadKarma31-May-06 21:33
BadKarma31-May-06 21:33 
AnswerRe: Is it a correct way Pin
InOut.NET31-May-06 21:57
InOut.NET31-May-06 21:57 
Questioncombobox Pin
kjosh31-May-06 20:28
kjosh31-May-06 20:28 
AnswerRe: combobox Pin
InOut.NET31-May-06 22:11
InOut.NET31-May-06 22:11 
QuestionHelp on P/Invoke BSTR* Pin
bluish31-May-06 20:08
bluish31-May-06 20:08 
Hello folks,

What's the equivalent of BSTR* in .NET (C#)

I used string and it gave me memory error. I used String and nothing gets returned.

The following is the declaration in C++ header file:

extern DllImport short int WINAPI ReceiveResponse(short int, short int, LONG, short int, BSTR*, BSTR*, BSTR*);
extern DllImport short int WINAPI ReceiveData(short int, short int, BSTR*, short int*);


The following is how the two functions declared in VB6 which works perfectly:
Declare Function ReceiveResponse Lib "some.dll" _
(ByVal a As Integer, _
ByVal b As Integer, _
ByVal c As Long, _
ByVal d As Integer, _
ByRef e As String, _
ByRef f As String, _
ByRef g As String _
) As Integer


Declare Function crwReceiveData Lib "some.dll" _
(ByVal a As Integer, _
ByVal b As Integer, _
ByRef c As String, _
ByRef d As Integer _
) As Integer


The following is how I declared it in C# which doesn't work:

[DllImport("some.dll")]
public static extern int ReceiveResponse (
int a, int b, int c, int d,
String e
String f,
String g );

[DllImport("some.dll")]
public static extern int ReceiveData(
int a, int b, String c, int d);


If the way I declare in it C# looks good, I don't know why it didn't work. Perhaps somebody could help me out.

Thanks,
TonyConfused | :confused:

AnswerRe: Help on P/Invoke BSTR* Pin
rah_sin31-May-06 20:13
professionalrah_sin31-May-06 20:13 
GeneralRe: Help on P/Invoke BSTR* Pin
bluish31-May-06 20:22
bluish31-May-06 20:22 
AnswerRe: Help on P/Invoke BSTR* [modified] Pin
stancrm31-May-06 20:27
stancrm31-May-06 20:27 
Questionupdating and retriving image Pin
leelaraj31-May-06 20:03
leelaraj31-May-06 20:03 
AnswerRe: updating and retriving image Pin
Laubi1-Jun-06 2:19
Laubi1-Jun-06 2:19 
GeneralRe: updating and retriving image Pin
leelaraj2-Jun-06 19:47
leelaraj2-Jun-06 19:47 
QuestionAdding Design script to script component in SSIS using C# Pin
Tarsha31-May-06 19:31
Tarsha31-May-06 19:31 
QuestionUrgent Pin
Shiv531-May-06 17:54
Shiv531-May-06 17:54 
AnswerRe: Urgent Pin
rah_sin31-May-06 18:21
professionalrah_sin31-May-06 18:21 
AnswerRe: Urgent Pin
_AK_31-May-06 18:31
_AK_31-May-06 18:31 
AnswerRe: Urgent Pin
nandank8131-May-06 18:56
nandank8131-May-06 18:56 
Questionwhat is the C# equivalent of PHP crypt() function Pin
Srivalli31-May-06 14:07
Srivalli31-May-06 14:07 
AnswerRe: what is the C# equivalent of PHP crypt() function Pin
Christian Graus31-May-06 15:06
protectorChristian Graus31-May-06 15:06 
Questionhow to create a FillReversibleRectangle blue? Pin
Susuko31-May-06 13:59
Susuko31-May-06 13:59 
Questionusing .Split() without loss Pin
PyroManiak31-May-06 11:57
PyroManiak31-May-06 11:57 
AnswerRe: using .Split() without loss Pin
Guffa31-May-06 12:15
Guffa31-May-06 12:15 
QuestionRegistry Keys Pin
NaNg1524131-May-06 10:50
NaNg1524131-May-06 10:50 

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.