Click here to Skip to main content
15,885,953 members
Home / Discussions / C#
   

C#

 
AnswerRe: PropertyGrid TypeConverter Pin
joe carbone16-Jan-06 4:17
joe carbone16-Jan-06 4:17 
GeneralRe: PropertyGrid TypeConverter Pin
Dylan van Heerden16-Jan-06 4:20
Dylan van Heerden16-Jan-06 4:20 
GeneralRe: PropertyGrid TypeConverter Pin
joe carbone16-Jan-06 4:37
joe carbone16-Jan-06 4:37 
QuestionGDI+ Pin
usmanali12316-Jan-06 3:56
usmanali12316-Jan-06 3:56 
AnswerRe: GDI+ Pin
Andy Moore16-Jan-06 4:21
Andy Moore16-Jan-06 4:21 
AnswerRe: GDI+ Pin
Robert Rohde16-Jan-06 4:21
Robert Rohde16-Jan-06 4:21 
QuestionHow to marshal char** in struct? Pin
jurot16-Jan-06 3:49
jurot16-Jan-06 3:49 
AnswerRe: How to marshal char** in struct? Pin
Andy Moore16-Jan-06 4:57
Andy Moore16-Jan-06 4:57 
Try changing your c# struct to the following:

public struct MY_STRUCT<br />
{<br />
   public int x;<br />
   public int y;<br />
   public System.IntPtr arrNames;<br />
}<br />
<br />
Your calling code looks like this:<br />
<br />
public class MyWrapper<br />
{<br />
    [DllImport("MyDll.dll")]<br />
    private static extern IntPtr GetMyStruct();<br />
<br />
    public static MY_STRUCT GetMyStructW()<br />
    {<br />
        IntPtr p = GetMyStruct();<br />
        IntPtr pArray;<br />
        IntPtr pString;<br />
        string[] strings;<br />
        MY_STRUCT s;<br />
<br />
        s = (MY_STRUCT)Marshal.PtrToStructure(p, typeof(MY_STRUCT));<br />
<br />
        pArray = s.arrayNames;<br />
<br />
        /*Now you can extract each string one by one as follows*/<br />
        pString = Marshal.ReadIntPtr(pArray);<br />
<br />
        while( pString != null )<br />
        {<br />
              strings[i] = Marshal.PtrToStringUni(pString);<br />
              i++;<br />
              pString = Marshal.ReadIntPtr(pArray);<br />
        }<br />
<br />
        return ( s );<br />
        <br />
        <br />
    }<br />
}


I hope this helps.

Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
GeneralRe: How to marshal char** in struct? Pin
jurot16-Jan-06 23:15
jurot16-Jan-06 23:15 
GeneralRe: How to marshal char** in struct? Pin
jurot17-Jan-06 1:06
jurot17-Jan-06 1:06 
GeneralRe: How to marshal char** in struct? Pin
Andy Moore17-Jan-06 11:25
Andy Moore17-Jan-06 11:25 
QuestionDataGrid formatting Pin
jeanchalumeau16-Jan-06 3:21
jeanchalumeau16-Jan-06 3:21 
AnswerRe: DataGrid formatting Pin
Robert Rohde16-Jan-06 4:18
Robert Rohde16-Jan-06 4:18 
GeneralRe: DataGrid formatting Pin
jeanchalumeau17-Jan-06 3:37
jeanchalumeau17-Jan-06 3:37 
QuestionChange file extensions Pin
GermanDM16-Jan-06 3:05
GermanDM16-Jan-06 3:05 
AnswerRe: Change file extensions Pin
Robert Rohde16-Jan-06 4:17
Robert Rohde16-Jan-06 4:17 
JokeRe: Change file extensions Pin
GermanDM16-Jan-06 19:36
GermanDM16-Jan-06 19:36 
GeneralRe: Change file extensions Pin
Robert Rohde16-Jan-06 19:49
Robert Rohde16-Jan-06 19:49 
GeneralRe: Change file extensions Pin
GermanDM16-Jan-06 19:55
GermanDM16-Jan-06 19:55 
QuestionVirtual Printer Driver! Pin
Andy H16-Jan-06 2:53
Andy H16-Jan-06 2:53 
AnswerRe: Virtual Printer Driver! Pin
John Fisher16-Jan-06 6:19
John Fisher16-Jan-06 6:19 
QuestionC# and WinFX Pin
Martin2316-Jan-06 1:52
Martin2316-Jan-06 1:52 
QuestionT-SQL vs. C# stored procedures Pin
Rob Philpott16-Jan-06 1:32
Rob Philpott16-Jan-06 1:32 
AnswerRe: T-SQL vs. C# stored procedures Pin
Colin Angus Mackay16-Jan-06 4:36
Colin Angus Mackay16-Jan-06 4:36 
QuestionListView control Pin
PrakashBhaskar16-Jan-06 1:29
PrakashBhaskar16-Jan-06 1:29 

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.