Click here to Skip to main content
15,897,704 members
Home / Discussions / C#
   

C#

 
AnswerRe: Array of strings to old DLL? Pin
Stephane Rodriguez.1-Sep-02 23:38
Stephane Rodriguez.1-Sep-02 23:38 
GeneralRe: Array of strings to old DLL? Pin
EdgarBM2-Sep-02 1:14
EdgarBM2-Sep-02 1:14 
GeneralRe: Array of strings to old DLL? Pin
Stephane Rodriguez.2-Sep-02 1:33
Stephane Rodriguez.2-Sep-02 1:33 
GeneralRe: Array of strings to old DLL? Pin
EdgarBM2-Sep-02 1:52
EdgarBM2-Sep-02 1:52 
AnswerRe: Array of strings to old DLL? Pin
leppie2-Sep-02 1:50
leppie2-Sep-02 1:50 
GeneralRe: Array of strings to old DLL? Pin
EdgarBM2-Sep-02 2:10
EdgarBM2-Sep-02 2:10 
GeneralRe: Array of strings to old DLL? Pin
leppie2-Sep-02 2:33
leppie2-Sep-02 2:33 
GeneralRe: Array of strings to old DLL? Pin
EdgarBM2-Sep-02 21:44
EdgarBM2-Sep-02 21:44 
Hi,
I'm trying your second code but I'm having problems and I don't know if I'm doing it quite well. That's what I'm trying now:

For the double[]:
<br />
IntPtr buffer = Marshal.AllocCoTaskMem( Marshal.SizeOf( cantidad ) * sVN.Length); // or Marshal.AllocHGlobal (COM or not)      <br />
Marshal.Copy( sVN, 0, buffer, sVN.Length );<br />


...and for the string[]:
<br />
IntPtr ptag = new IntPtr ();<br />
ptag = Marshal.StringToHGlobalAnsi ("maybe...");<br />
ArrayList tags = new ArrayList();<br />
do <br />
{<br />
	string tag = Marshal.PtrToStringAnsi (ptag); //PtrToStringUni (ptag);    // ptag is pointer to string[], make sure about unicode/ansi, i assume unicode  <br />
	if (tag == "") break;  <br />
	else   <br />
	{    <br />
		tags.Add(tag);    <br />
		ptag = new IntPtr(ptag.ToInt32() + <br />
		Marshal.SizeOf(Marshal.StringToHGlobalAnsi (tag)));  <br />
	}<br />
}while(true);


And I define the DLL Function like:
Method (..., ref IntPtr sbufN, ArrayList sbufC, ...);

What am I doing wrong?

Thank you again for your dedication,
Edgar



__________________________________________
Edgar Berengena Moreno
Software Engineer
Appeyron Research

GeneralRe: Array of strings to old DLL? Pin
leppie3-Sep-02 2:19
leppie3-Sep-02 2:19 
QuestionHow to do a virtual keyboard in c# ? Pin
AlbertoFujimori1-Sep-02 21:34
AlbertoFujimori1-Sep-02 21:34 
AnswerRe: How to do a virtual keyboard in c# ? Pin
Stephane Rodriguez.2-Sep-02 0:01
Stephane Rodriguez.2-Sep-02 0:01 
GeneralBringToFront changes index Pin
James McCutcheon1-Sep-02 20:32
James McCutcheon1-Sep-02 20:32 
QuestionGraphic engine for .NET anyone? Pin
Alastair Stell1-Sep-02 16:01
Alastair Stell1-Sep-02 16:01 
AnswerRe: Graphic engine for .NET anyone? Pin
David Stone1-Sep-02 17:58
sitebuilderDavid Stone1-Sep-02 17:58 
AnswerRe: Graphic engine for .NET anyone? Pin
Rickard Andersson201-Sep-02 20:47
Rickard Andersson201-Sep-02 20:47 
AnswerRe: Graphic engine for .NET anyone? Pin
Stephane Rodriguez.1-Sep-02 21:20
Stephane Rodriguez.1-Sep-02 21:20 
AnswerRe: Graphic engine for .NET anyone? Pin
leppie2-Sep-02 5:24
leppie2-Sep-02 5:24 
GeneralnBASS updated Pin
leppie1-Sep-02 10:23
leppie1-Sep-02 10:23 
GeneralRe: nBASS updated Pin
James T. Johnson1-Sep-02 11:43
James T. Johnson1-Sep-02 11:43 
GeneralRe: nBASS updated Pin
leppie1-Sep-02 11:54
leppie1-Sep-02 11:54 
GeneralRichTextBox Pin
Iulian Serban1-Sep-02 8:11
Iulian Serban1-Sep-02 8:11 
GeneralRe: RichTextBox Pin
Mazdak1-Sep-02 9:40
Mazdak1-Sep-02 9:40 
GeneralRe: RichTextBox Pin
Iulian Serban1-Sep-02 22:39
Iulian Serban1-Sep-02 22:39 
GeneralRe: RichTextBox Pin
James McCutcheon1-Sep-02 22:01
James McCutcheon1-Sep-02 22:01 
GeneralRe: RichTextBox Pin
Iulian Serban1-Sep-02 22:37
Iulian Serban1-Sep-02 22:37 

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.