Click here to Skip to main content
16,004,882 members
Home / Discussions / COM
   

COM

 
GeneralRe: activeX in Matlab Pin
ffredoux30-Jun-04 21:48
ffredoux30-Jun-04 21:48 
GeneralRe: activeX in Matlab Pin
darkbyte1-Jul-04 7:19
darkbyte1-Jul-04 7:19 
QuestionCLSID of a COM object? Pin
M.C.27-Jun-04 19:14
M.C.27-Jun-04 19:14 
AnswerRe: CLSID of a COM object? Pin
Jörgen Sigvardsson1-Jul-04 11:54
Jörgen Sigvardsson1-Jul-04 11:54 
GeneralCOM Server (exe) as a Service Pin
darkbyte26-Jun-04 10:43
darkbyte26-Jun-04 10:43 
GeneralRe: COM Server (exe) as a Service <---- Solved Pin
darkbyte29-Jun-04 1:33
darkbyte29-Jun-04 1:33 
QuestionHow can I rename an NT user using the ADSI? Pin
zzzhouzhou26-Jun-04 5:42
zzzhouzhou26-Jun-04 5:42 
Generalchange the data in C++ dll by C# program Pin
ting66825-Jun-04 17:12
ting66825-Jun-04 17:12 
HI~

I would like to ask
How do I change the data in C++ dll by a C# program?

I have ever tried this.
I wrote a dll with VC++. There is a variable in the dll (e.g "m_string"). "m_string" is a LPCTSTR type and it's inital value set by constructor is _T("Hello World"). I also wrote a function for setting the variable. The function is declared like this:

extern "C" _declspec(dllexport) void set(LPCTSTR s)
{
m_string = s;
}

Afterward, I wrote a C# dll assembly. The C# dll import the dll written by C++. The import the dll like this:

#region DLLImports

[DllImport("Test.dll")] //test is the C++ dll filename
private static extern void Set(string s);

#endregion

Finally, I wrote a form to call the method "Set". After the method have finished executing, the value "m_string" does not change. The "m_string" is still "Hello World".

My question is, how to change a variable in dll permanently by a C# library or exe?

Thanks


GeneralRe: change the data in C++ dll by C# program Pin
darkbyte27-Jun-04 4:34
darkbyte27-Jun-04 4:34 
GeneralRe: change the data in C++ dll by C# program Pin
ting66827-Jun-04 20:19
ting66827-Jun-04 20:19 
GeneralRe: change the data in C++ dll by C# program Pin
darkbyte28-Jun-04 1:34
darkbyte28-Jun-04 1:34 
GeneralRe: change the data in C++ dll by C# program Pin
ting6687-Jul-04 4:04
ting6687-Jul-04 4:04 
GeneralRe: change the data in C++ dll by C# program Pin
darkbyte7-Jul-04 7:15
darkbyte7-Jul-04 7:15 
GeneralExceptions raised while CoCreateInstance Pin
Anonymous25-Jun-04 3:26
Anonymous25-Jun-04 3:26 
GeneralRe: Exceptions raised while CoCreateInstance Pin
darkbyte27-Jun-04 4:36
darkbyte27-Jun-04 4:36 
General&quot;virtual drive&quot; extension - accesing from &quot;Open File&quot; and System.IO.File API Pin
mr_mark_hewitt24-Jun-04 20:36
mr_mark_hewitt24-Jun-04 20:36 
GeneralRe: &quot;virtual drive&quot; extension - accesing from &quot;Open File&quot; and System.IO.File API Pin
darkbyte27-Jun-04 4:42
darkbyte27-Jun-04 4:42 
QuestionHow do I FULLY unregister a COM+ component programmatically from managed code? Pin
Boyd Campbell24-Jun-04 10:40
Boyd Campbell24-Jun-04 10:40 
AnswerRe: How do I FULLY unregister a COM+ component programmatically from managed code? Pin
darkbyte7-Jul-04 7:18
darkbyte7-Jul-04 7:18 
GeneralRe: How do I FULLY unregister a COM+ component programmatically from managed code? Pin
Boyd Campbell7-Jul-04 11:06
Boyd Campbell7-Jul-04 11:06 
GeneralRe: How do I FULLY unregister a COM+ component programmatically from managed code? Pin
darkbyte7-Jul-04 11:10
darkbyte7-Jul-04 11:10 
GeneralRe: How do I FULLY unregister a COM+ component programmatically from managed code? Pin
Boyd Campbell7-Jul-04 11:12
Boyd Campbell7-Jul-04 11:12 
GeneralRe: How do I FULLY unregister a COM+ component programmatically from managed code? Pin
darkbyte8-Jul-04 2:37
darkbyte8-Jul-04 2:37 
GeneralRe: How do I FULLY unregister a COM+ component programmatically from managed code? Pin
Boyd Campbell8-Jul-04 2:54
Boyd Campbell8-Jul-04 2:54 
GeneralType library that has no coclass Pin
pain23-Jun-04 16:08
pain23-Jun-04 16:08 

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.