Remko Weijnen's Blog (Remko's Blog)

About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like

Archive for the ‘.NET’ Category

Returning a string from unmanaged dll to .net

I write most of my code in unmanaged languages such as Delphi and C/C++. Sometimes customers ask me to interface my code to their .net code in which case I create a dll for them.

A recurring thing is that I need to return string to .net.

There are many ways to do this of course but in all cases we need to manage memory: who will allocate the memory for the string and who is responsible for freeing it?

(more…)

  • 3 Comments
  • Filed under: .NET, C#, C++, Delphi
  • Making String.IndexOf case insensitive

    I don’t do much programming in .NET based languages but I have to for some things like the Windows Live Writer plugin I am creating.

    I didn’t expect this but the String.IndexOf Method is by default case sensitive.

    But we can make it case insensitive if we use one of the overloads: IndexOf(String, StringComparison).

    Example:

  • 0 Comments
  • Filed under: .NET, C#
  • Donate


    Blogroll


    Categories


    Archives