Click here to Skip to main content
15,923,222 members
Home / Discussions / C#
   

C#

 
GeneralRe: Cursor coordinates in TextBox Pin
brian419025-Jun-03 5:29
brian419025-Jun-03 5:29 
GeneralEdit html document with mshtml Pin
benzite24-Jun-03 17:11
benzite24-Jun-03 17:11 
GeneralRe: Edit html document with mshtml Pin
J. Dunlap24-Jun-03 17:20
J. Dunlap24-Jun-03 17:20 
GeneralRe: Edit html document with mshtml Pin
benzite24-Jun-03 19:51
benzite24-Jun-03 19:51 
QuestionHow can I create a component in run-time and show it like as design mode? Pin
silver_ben24-Jun-03 16:06
silver_ben24-Jun-03 16:06 
AnswerRe: How can I create a component in run-time and show it like as design mode? Pin
John Fisher25-Jun-03 7:37
John Fisher25-Jun-03 7:37 
GeneralRe: How can I create a component in run-time and show it like as design mode? Pin
silver_ben30-Jun-03 19:38
silver_ben30-Jun-03 19:38 
GeneralInsanely simple interop question. Pin
Bog24-Jun-03 14:06
Bog24-Jun-03 14:06 
All I want to do is:

I want to make a win32 DLL that takes two LPWSTR's. One [in], one [out]. That's ALL! The problem is, when I call it from C#, the out string is always unchanged. I know this must be simple to do- interop can't suck this bad. Here is my code:

/// In the DLL:

extern "C" {

__declspec(dllexport) void transformIt(LPWSTR,[out] LPWSTR);

void transformIt(LPWSTR markup,[out] LPWSTR changed) {
changed= L"SOME STUFF";
}
}

// The Interop and the call:
[System.Runtime.InteropServices.DllImportAttribute("mydll.dll")]
private static extern void transformIt(
[MarshalAs(UnmanagedType.LPWStr)] string markup,
[Out,MarshalAs(UnmanagedType.LPWStr)] out string changed) ;

string stuff="wefwefw";
string changed; //also tried string changed="",changed=null, and a StringBuilder
transformIt( stuff, out changed);
Console.WriteLine(" >>>>>>>>>>>>>>> " + changed); //empty


I've tried this with a StringBuilder, I've tried with "ref" instead of an "out". No error is thrown, even when I do a try catch block. I know it's finding the DLL ok, becaause I made another test method that just returns an int and it worked. why why why why why why why

Please tell me it's me that sucks and not interop.


"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx

GeneralRe: Insanely simple interop question. Pin
Ranjan Banerji25-Jun-03 3:22
Ranjan Banerji25-Jun-03 3:22 
GeneralRe: Insanely simple interop question. Pin
Bog25-Jun-03 9:23
Bog25-Jun-03 9:23 
GeneralOverride OnPaint in TextBox control Pin
paulb24-Jun-03 13:31
paulb24-Jun-03 13:31 
GeneralRe: Override OnPaint in TextBox control Pin
jspano26-Jun-03 14:51
jspano26-Jun-03 14:51 
GeneralArrow keys in user controls Pin
duncanmeech24-Jun-03 12:35
duncanmeech24-Jun-03 12:35 
GeneralTesting for control+enter in a textbox Pin
monrobot1324-Jun-03 12:00
monrobot1324-Jun-03 12:00 
GeneralRe: Testing for control+enter in a textbox Pin
leppie24-Jun-03 12:42
leppie24-Jun-03 12:42 
GeneralRe: Testing for control+enter in a textbox Pin
monrobot1325-Jun-03 11:26
monrobot1325-Jun-03 11:26 
GeneralCSharp conversion Pin
Member 88602324-Jun-03 10:49
Member 88602324-Jun-03 10:49 
GeneralRe: CSharp conversion Pin
Michael Mac24-Jun-03 12:26
Michael Mac24-Jun-03 12:26 
GeneralRe: CSharp conversion Pin
leppie24-Jun-03 12:30
leppie24-Jun-03 12:30 
GeneralCommon Icons for Buttons and Toolbars Pin
Khang Nguyen24-Jun-03 10:40
Khang Nguyen24-Jun-03 10:40 
GeneralRe: Common Icons for Buttons and Toolbars Pin
John R. Shaw24-Jun-03 12:08
John R. Shaw24-Jun-03 12:08 
GeneralRe: Common Icons for Buttons and Toolbars Pin
Khang Nguyen24-Jun-03 12:41
Khang Nguyen24-Jun-03 12:41 
GeneralC# & Winforms equivilent to AfxMessageBox Pin
Matt Newman24-Jun-03 10:35
Matt Newman24-Jun-03 10:35 
GeneralRe: C# & Winforms equivilent to AfxMessageBox Pin
monrobot1324-Jun-03 11:01
monrobot1324-Jun-03 11:01 
GeneralRe: C# & Winforms equivilent to AfxMessageBox Pin
Matt Newman24-Jun-03 11:32
Matt Newman24-Jun-03 11:32 

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.