Click here to Skip to main content
16,005,121 members
Home / Discussions / C#
   

C#

 
AnswerRe: Winforms.TreeView node limit Pin
Mycroft Holmes11-Jul-10 12:29
professionalMycroft Holmes11-Jul-10 12:29 
GeneralRe: Winforms.TreeView node limit Pin
Trollslayer11-Jul-10 12:48
mentorTrollslayer11-Jul-10 12:48 
GeneralRe: Winforms.TreeView node limit Pin
Mycroft Holmes11-Jul-10 14:18
professionalMycroft Holmes11-Jul-10 14:18 
GeneralRe: Winforms.TreeView node limit Pin
Trollslayer11-Jul-10 21:43
mentorTrollslayer11-Jul-10 21:43 
GeneralRe: Winforms.TreeView node limit Pin
Mycroft Holmes11-Jul-10 23:09
professionalMycroft Holmes11-Jul-10 23:09 
QuestionHow to Inherit C++/CLI Interface in C#? Pin
glitteringsound11-Jul-10 2:24
glitteringsound11-Jul-10 2:24 
AnswerRe: How to Inherit C++/CLI Interface in C#? Pin
Luc Pattyn11-Jul-10 6:00
sitebuilderLuc Pattyn11-Jul-10 6:00 
QuestionSharing strings between unmanaged and managed code Pin
Keith Vitali10-Jul-10 11:39
Keith Vitali10-Jul-10 11:39 
Hello,

I have some native C++ code that interacts with my managed C# app through delegates and function pointers. Normally, I have the following setup for basic types in my native C++ DLL.

So, for example this function set interacts with the managed code and updates a variable of type short.

typedef int (__stdcall* GET_SHORT)(short &value, int ID);
// function pointer to hold delegate.
GET_SHORT getAttShort = NULL; 

//! Store a delegate for future use. This will be called by the C# app.
extern "C" __declspec(dllexport) void SetShortHandler(GET_SHORT handler) 
{
    getDicomAttShort = handler;
}

//! This method calls the method in C#
int GetAttribute(short &value, int ID)
{
    // value gets updated by managed app.
    if (getDicomAttShort) return getAttShort(value, ID);
    return -1; // no handler set
}


Here, the managed app sets the delegate by calling SetShortHandler which sets the function pointer and then the method is called through GetAttribute()..

No, this works great for types like short, int, double, long... However, I am at a loss as to how I can get it to work with strings. I like to use STL strings and I want to do something similar as the code above but with strings instead of basic types.

Any ideas? Would appreciate any help.

Keith
AnswerRe: Sharing strings between unmanaged and managed code Pin
Keith Vitali11-Jul-10 6:20
Keith Vitali11-Jul-10 6:20 
QuestionSet Exit code in win mobile C# Pin
alto10-Jul-10 10:37
alto10-Jul-10 10:37 
AnswerRe: Set Exit code in win mobile C# Pin
DaveyM6910-Jul-10 23:04
professionalDaveyM6910-Jul-10 23:04 
QuestionShowing Main Form Quickly? Pin
ali_zdn10-Jul-10 9:29
ali_zdn10-Jul-10 9:29 
AnswerRe: Showing Main Form Quickly? Pin
Bigdeak10-Jul-10 10:12
Bigdeak10-Jul-10 10:12 
GeneralRe: Showing Main Form Quickly? Pin
ali_zdn10-Jul-10 10:36
ali_zdn10-Jul-10 10:36 
GeneralRe: Showing Main Form Quickly? Pin
Richard Blythe10-Jul-10 11:34
Richard Blythe10-Jul-10 11:34 
GeneralRe: Showing Main Form Quickly? Pin
Ravi Bhavnani10-Jul-10 13:43
professionalRavi Bhavnani10-Jul-10 13:43 
AnswerRe: Showing Main Form Quickly? Pin
PIEBALDconsult10-Jul-10 15:06
mvePIEBALDconsult10-Jul-10 15:06 
GeneralRe: Showing Main Form Quickly? Pin
OriginalGriff10-Jul-10 20:30
mveOriginalGriff10-Jul-10 20:30 
GeneralRe: Showing Main Form Quickly? Pin
PIEBALDconsult11-Jul-10 3:15
mvePIEBALDconsult11-Jul-10 3:15 
GeneralRe: Showing Main Form Quickly? Pin
OriginalGriff11-Jul-10 3:46
mveOriginalGriff11-Jul-10 3:46 
AnswerRe: Showing Main Form Quickly? Pin
Pete O'Hanlon10-Jul-10 21:46
mvePete O'Hanlon10-Jul-10 21:46 
QuestionMessage Removed Pin
10-Jul-10 4:31
isprog110-Jul-10 4:31 
AnswerRe: Graphics Object Using text box for x & y axis. Pin
OriginalGriff10-Jul-10 4:44
mveOriginalGriff10-Jul-10 4:44 
GeneralMessage Removed Pin
10-Jul-10 6:12
isprog110-Jul-10 6:12 
GeneralRe: Graphics Object Using text box for x & y axis. Pin
OriginalGriff10-Jul-10 10:22
mveOriginalGriff10-Jul-10 10:22 

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.