0

I am writing a plugin for notepad++ on c#. My plugin creates a tree to represents the stucture of some specific text-files. I have some problems calling functions with paramets like (char* text). Could you help mw with this problem ?

for example

SCI_GETLINE(int line, char *text)
{
    string st="";
    Win32.SendMessage(curScintilla, SciMsg.SCI_GETLINE, (int)line, st);
}

such way of calling raise Not valid string format exeption.

Dave Zych
  • 21,581
  • 7
  • 51
  • 66
Yuurga
  • 9
  • 5
  • If somebody face up to this problem, a answer it for myself. My plugin work in other thread, so i must use marshalling, to get this string. – Yuurga Aug 28 '12 at 13:31

1 Answers1

2

Tag the argument with: [MarshalAs(UnmanagedType.LPStr)]. The problem is you are passing a unicode string in some string type that's not an byte C-style null terminated string.

quantum
  • 3,672
  • 29
  • 51