CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2001
    Posts
    20

    exe/dll data exchange

    I've got a questuion: i have exe program which creates window(non MFC) and this programm loads dll, which creates another window. Both windows have edit controls. I need to do followng: as far as i change text in edit in dll window, i need to output same text in edit in exe window. There is a pointer (char*) in dll where i store text which is to be output in dll edit. How to access to this pointer from exe window (and make this pointer common for both windows - something like buffer). Probably I need to declare this pointer as dllexport but I don't know how to work with it then. Please somebody give example of solving such problem (using imported variables!). Thanks


  2. #2
    Join Date
    Apr 2001
    Posts
    189

    Re: exe/dll data exchange

    I would create an exported function in your DLL which returns a char** (a pointer to the char *), and in this return value pass the address of your char * to your EXE file.


  3. #3
    Join Date
    Oct 2001
    Posts
    20

    Re: exe/dll data exchange

    and if I need to get pointer to int** (for example there is some matrix) - i should return int*** - or i didn't understand something?


  4. #4
    Join Date
    Apr 2001
    Posts
    189

    Re: exe/dll data exchange

    yes, a pointer to an int** is a int***. Every * means pointer, and you can have many levels of pointers..... i.e. a pointer to a pointer....

    if your char * you want to pass to your EXE is a constant, i.e. the pointer does not change, then it is sufficient to pass it to your EXE by value, not by pointer (char **).


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured