Click here to Skip to main content
16,014,677 members
Home / Discussions / C#
   

C#

 
GeneralRe: datagrid question Pin
azumi17-May-04 22:26
azumi17-May-04 22:26 
GeneralEvent handler Pin
sreejith ss nair14-May-04 1:02
sreejith ss nair14-May-04 1:02 
GeneralRe: Event handler Pin
Aryadip14-May-04 1:25
Aryadip14-May-04 1:25 
GeneralRe: Event handler Pin
sreejith ss nair14-May-04 1:44
sreejith ss nair14-May-04 1:44 
GeneralRe: Event handler Pin
Dave Kreskowiak14-May-04 7:40
mveDave Kreskowiak14-May-04 7:40 
GeneralRe: Event handler Pin
Heath Stewart14-May-04 3:15
protectorHeath Stewart14-May-04 3:15 
GeneralRe: Event handler Pin
sreejith ss nair14-May-04 3:27
sreejith ss nair14-May-04 3:27 
QuestionHow to pass a string from c++ to c# Pin
peraonline14-May-04 0:37
peraonline14-May-04 0:37 
Hi, I must get a string from a function included into a DLL, imported in a ASP.NET page.
The code:
----

Into a .aspx.cs page:

//def. function included into a DLL
[DllImport("WebUtility.dll", EntryPoint = "getDescr")]

public static extern string getDescr(int id);

//call the function:
string descr=getDescr(123);

---

into the c++ program, the function is definied as:

char* getDescr(int id) {
char* ret=new char[LUNGHEZZA_STRINGA_MEM];
strcpy(ret,oggetto[id].descr);
return (ret);
}

If I throw the application, the server give me the error: System.NullReferenceException: Object reference not set to an instance of an object.
But this error is generated not every time, but random!! some time I can view the string correctly! Why?

Thanks for the help!!!
AnswerRe: How to pass a string from c++ to c# Pin
Heath Stewart14-May-04 2:57
protectorHeath Stewart14-May-04 2:57 
GeneralRe: How to pass a string from c++ to c# Pin
peraonline14-May-04 3:08
peraonline14-May-04 3:08 
GeneralRe: How to pass a string from c++ to c# Pin
Heath Stewart14-May-04 3:29
protectorHeath Stewart14-May-04 3:29 
GeneralUse lib-file in C#.NET Pin
Nilfunck13-May-04 23:42
Nilfunck13-May-04 23:42 
GeneralRe: Use lib-file in C#.NET Pin
Aryadip14-May-04 1:20
Aryadip14-May-04 1:20 
GeneralRe: Use lib-file in C#.NET Pin
Nilfunck14-May-04 2:10
Nilfunck14-May-04 2:10 
GeneralRe: Use lib-file in C#.NET Pin
sreejith ss nair14-May-04 2:05
sreejith ss nair14-May-04 2:05 
GeneralRe: Use lib-file in C#.NET Pin
Nilfunck14-May-04 2:14
Nilfunck14-May-04 2:14 
GeneralRe: Use lib-file in C#.NET Pin
Heath Stewart14-May-04 2:52
protectorHeath Stewart14-May-04 2:52 
GeneralRe: Use lib-file in C#.NET Pin
Heath Stewart14-May-04 2:52
protectorHeath Stewart14-May-04 2:52 
GeneralRe: Use lib-file in C#.NET Pin
Nilfunck14-May-04 3:56
Nilfunck14-May-04 3:56 
GeneralRe: Use lib-file in C#.NET Pin
Heath Stewart14-May-04 4:01
protectorHeath Stewart14-May-04 4:01 
GeneralRe: Use lib-file in C#.NET Pin
Nilfunck16-May-04 20:37
Nilfunck16-May-04 20:37 
GeneralRe: Use lib-file in C#.NET Pin
Heath Stewart14-May-04 2:53
protectorHeath Stewart14-May-04 2:53 
Generalhelp about print Pin
ggl16513-May-04 23:31
ggl16513-May-04 23:31 
GeneralRe: help about print Pin
Heath Stewart14-May-04 2:48
protectorHeath Stewart14-May-04 2:48 
GeneralRe: help about print Pin
ggl16518-May-04 0:01
ggl16518-May-04 0:01 

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.