Click here to Skip to main content
16,016,501 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPipes Pin
Archer28225-Jun-04 20:08
Archer28225-Jun-04 20:08 
GeneralRe: Pipes Pin
Trollslayer26-Jun-04 5:47
mentorTrollslayer26-Jun-04 5:47 
GeneralRe: Pipes Pin
Graham Bradshaw26-Jun-04 13:54
Graham Bradshaw26-Jun-04 13:54 
GeneralMinimize another app. Pin
Some_Dude25-Jun-04 18:53
Some_Dude25-Jun-04 18:53 
GeneralRe: Minimize another app. Pin
Archer28225-Jun-04 20:05
Archer28225-Jun-04 20:05 
GeneralRe: Minimize another app. Pin
Some_Dude26-Jun-04 20:50
Some_Dude26-Jun-04 20:50 
GeneralRe: Minimize another app. Pin
Archer28227-Jun-04 17:28
Archer28227-Jun-04 17:28 
Generalchange data in C++ dll by a C# program Pin
ting66825-Jun-04 17:15
ting66825-Jun-04 17:15 
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
Questionhow to creat a SubDialog dynamically Pin
yingkou25-Jun-04 15:50
yingkou25-Jun-04 15:50 
AnswerRe: how to creat a SubDialog dynamically Pin
Michael Dunn25-Jun-04 17:03
sitebuilderMichael Dunn25-Jun-04 17:03 
GeneralChild Window Not Recieving Keyboard Input Properly Pin
Xzyx987X25-Jun-04 15:49
Xzyx987X25-Jun-04 15:49 
GeneralRe: Child Window Not Recieving Keyboard Input Properly Pin
Johan Rosengren25-Jun-04 20:14
Johan Rosengren25-Jun-04 20:14 
GeneralRe: Child Window Not Recieving Keyboard Input Properly Pin
Xzyx987X25-Jun-04 23:43
Xzyx987X25-Jun-04 23:43 
GeneralRe: Child Window Not Recieving Keyboard Input Properly Pin
Johan Rosengren26-Jun-04 0:15
Johan Rosengren26-Jun-04 0:15 
GeneralGetting around vanishing pointers Pin
brdavid25-Jun-04 14:38
brdavid25-Jun-04 14:38 
GeneralRe: Getting around vanishing pointers Pin
bneacetp25-Jun-04 16:31
bneacetp25-Jun-04 16:31 
GeneralRe: Getting around vanishing pointers Pin
Michael Dunn25-Jun-04 17:06
sitebuilderMichael Dunn25-Jun-04 17:06 
GeneralRe: Getting around vanishing pointers Pin
CaesarCZ26-Jun-04 6:48
CaesarCZ26-Jun-04 6:48 
GeneralRe: Getting around vanishing pointers Pin
brdavid26-Jun-04 8:22
brdavid26-Jun-04 8:22 
GeneralBrightness of LCD Display Pin
Blake Miller25-Jun-04 12:52
Blake Miller25-Jun-04 12:52 
GeneralTerminate word application Pin
elephantstar25-Jun-04 12:42
elephantstar25-Jun-04 12:42 
GeneralRe: How to send Msg to child window Pin
Sumit Kapoor25-Jun-04 11:03
Sumit Kapoor25-Jun-04 11:03 
GeneralRe: How to send Msg to child window Pin
Christopher Lloyd25-Jun-04 15:22
Christopher Lloyd25-Jun-04 15:22 
QuestionHow to send Msg to child window Pin
Sumit Kapoor25-Jun-04 10:21
Sumit Kapoor25-Jun-04 10:21 
AnswerRe: How to send Msg to child window Pin
Jeremy Falcon25-Jun-04 10:36
professionalJeremy Falcon25-Jun-04 10:36 

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.