Results 1 to 32 of 32

Thread: Wm_copydata

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Wm_copydata

    Hi to all:

    I would like to pass some values from vb.net to an .dll in C++, using WM_COPYDATA or even using pipes...

    Can anyone point me to a existing example code for start?

    Thanks

  2. #2
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: Wm_copydata

    WM_COPYDATA implies a message that means a message loop is necessary. I've yet to see a Dll that implements a message loop. I think you need to provide a whole lot of details here because this doesn't sound right.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Wm_copydata

    Hi:

    Thanks for your reply...do You Know where i can find a code as example?

  4. #4
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: Wm_copydata

    Code sample to do what ?
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Wm_copydata

    That show wm_copydata

  6. #6
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: Wm_copydata

    Here is an example that shows how to use it. Note though that it is written in C++.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Wm_copydata

    Ok...nothing in vb.net no?

  8. #8
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: Wm_copydata

    Here is another article about it with some code in c#. It provides a better explanation and you may pass the code through an online converter to get its VB.Net equivalent.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  9. #9
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Wm_copydata

    What is it that you really want to do? As Niya already pointed out the WM_COPYDATA is a Windows message that you normally send to a window not to a particular file. The message will then be handled by the owner process of that window (the handler or message pump could technically be located in a DLL but the DLL must then be virtually mapped to that process).

    If the DLL expose a function that accepts data why not just make a call into that?

    I'm sorry but the question as it stands just doesn't make any sense so it would be better if you explain what you're really trying to do instead of what you think you should do, otherwise it's impossible for anyone to give you any decent answer.

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Wm_copydata

    Hi:

    Like i had said in my first post:
    I would like to pass some values from vb.net to an .dll in C++, using WM_COPYDATA or even using pipes
    The .dll is write in C++, and I not know C++ language, that's because i need to make an externall application to pass some values for this .dll...This .Dll are ready to receive this process!

    Thanks

  11. #11
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: Wm_copydata

    How can the Dll receive these values ?
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  12. #12

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Wm_copydata

    Good question Niya...this is a problem that i need to understand and resolve!

  13. #13
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: Wm_copydata

    Well I can't tell you how the Dll would receive the values. I don't have the Dll. You're the one that has the Dll and presumably any documentation that goes with it.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  14. #14

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Wm_copydata

    The .dll it's not mine...The owner of the .dll said the only way i can do that is via WM_COPYDATA or even using pipes, but i'm with you Niya, i think it's not possible but.....

  15. #15
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Wm_copydata

    Quote Originally Posted by sacramento View Post
    The owner of the .dll said the only way i can do that is via WM_COPYDATA or even using pipes, but i'm with you Niya, i think it's not possible but.....
    The only way you can do what??? Why is it so hard to describe what it is that you want to do, and don't just reply and once more say that you want to use WM_COPYDATA.

  16. #16

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Wm_copydata

    Joacim i had already tell what i want to do...What you don't understand in my question? I think it's clear that I want to do no?

  17. #17
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Wm_copydata

    No it's absolutely not clear what you want to do. What was the question you asked the creator of the DLL that got him to reply that you needed to use WM_COPYDATA? What do you expect to happen when you send that message? What are the desired results? You have told us nothing of what you really want to do, all you've said is that "I was told to use WM_COPYDATA how do I send that to a DLL" and the answer to that question is: You don't! You send messages to a window or a control but not to a file.

  18. #18

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Wm_copydata

    Ok...let's see if i could explain a little more better:

    I need to communicate with an application XX, via an specific protocol, that this application XX have!

    A company YY had construct a .DLL that comunicate (input and outputs) with this application XX, and this .DLL is an example the way we can communicate with AP XX...

    Well...in my side I have an electronic board that i have to collect data and send this collect data (via strings, and integer numbers) to this .DLL and this .DLL for APXX...in other words this .DLL function like an interface....In contact with Company YY they are told me the way to do this is use WM_COPYDATA or using pipes..

    That i expect when i send the message is the .DLL could collect him in a variable

    that i would like to do is just throught this WM_COPYDATA send my strings and integer numbers to the variables that this .DLL have in an specific function...

  19. #19
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: Wm_copydata

    If he told you to use WM_COPYDATA then he must have told you how to retrieve a window handle from the Dll so we can use SendMessage to post a WM_COPYDATA message to it.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  20. #20

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Wm_copydata

    Yes...is that i go ask him!

  21. #21
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Wm_copydata

    Quote Originally Posted by sacramento View Post
    A company YY had construct a .DLL that comunicate (input and outputs) with this application XX, and this .DLL is an example the way we can communicate with AP XX...
    If the DLL is an example of how you can communicate with the application then it's not really via the DLL you should communicate but rather build something like this DLL. What you really want is obviously then to communicate with the app XX. Do you have the source code for the DLL, and would it be possible for you to post that here? Maybe that would be an easier way of figuring out exactly what you're trying to do.

  22. #22

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Wm_copydata

    Yes...I would like to send all project but the file is too large for attach...wich way i can send?

  23. #23
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Wm_copydata

    The source files of the DLL can't be that large, just zip them up and attach it as one file.

  24. #24

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Wm_copydata

    Files Attached
    Attached Files Attached Files
    Last edited by sacramento; May 16th, 2013 at 10:39 AM.

  25. #25
    Fanatic Member AceInfinity's Avatar
    Join Date
    May 2011
    Posts
    696

    Re: Wm_copydata

    WM_COPYDATA is not what you are looking for here (if you want to deal with the DLL because as said this is a file (Windows Messages--evidently are usually for window's)). How can you pass values to a DLL? Are you trying to invoke a function embedded within the DLL called with parameters? I don't understand. It seems like you actually want to deal with the application window, and not the DLL itself.

    Also, if this is Vista or later, you may have issues with this Windows message if the target windows process is invoked with higher privileges because of UIFI. I ran into this and worked out a fix for a few of the affected WM's a while back.

    edit; Hehe... *chuckles*
    cpp Code:
    1. // dllmain.cpp : Definiert den Einstiegspunkt für die DLL-Anwendung.
    2. #include "stdafx.h"
    3.  
    4. BOOL APIENTRY DllMain( HMODULE hModule,
    5.                        DWORD  ul_reason_for_call,
    6.                        LPVOID lpReserved
    7.                      )
    8. {
    9.     switch (ul_reason_for_call)
    10.     {
    11.     case DLL_PROCESS_ATTACH:
    12.     case DLL_THREAD_ATTACH:
    13.     case DLL_THREAD_DETACH:
    14.     case DLL_PROCESS_DETACH:
    15.         break;
    16.     }
    17.     return TRUE;
    18. }

    Okay, this doesn't say a whole lot though lol. I took a look at the other file too, and there's not much in there that means anything to me without knowing what it's for.

    Can you explain why you are trying to interact with this DLL? What is your main goal (in specific)? You should be able to provide more details here unless this is confidential information for some reason...
    Last edited by AceInfinity; May 16th, 2013 at 03:56 PM.
    <<<------------
    Improving Managed Code Performance | .NET Application Performance
    < Please if this helped you out. Any kind of thanks is gladly appreciated >


    .NET Programming (2012 - 2018)
    ®Crestron - DMC-T Certified Programmer | Software Developer
    <<<------------

  26. #26
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: Wm_copydata

    Quote Originally Posted by sacramento View Post
    Files Attached
    I've look at the code and I don't see thing in there that can be used as an interface to put data. There are no windows so that means WM_COPYDATA can't be used and there nothing that setup pipes to listen. I'm sorry, but if that was the Dll, then I'm afraid that sending info to it from VB.Net is impossible.

    However, all hope is not lost. If you have the source code for the Dll then I can assume that you are allowed to make your own versions of the Dll. If this is true then that means you are free to implement whatever scheme for passing data that your heart desires. The simplest would be to add a function which you call from VB.Net passing whatever value you want.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  27. #27
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Wm_copydata

    The DLL is not really used for anything else but as some kind of add-in to what I believe is a flight simulator program. It creates a new gauge on the panel (which I assume is like the dashboard in the cockpit of the plane). It's actually all explained in the readme file (which I read because it told me to ).

  28. #28

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Wm_copydata

    Hi guys...
    In fact Joacim are right, and he had told everything....the .dll comunicate with FS, and that i would Like to do is create an External application that send values to this .dll, but Like i had see in your comments i think i need to find annother solution!

  29. #29
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Wm_copydata

    But this DLL does not accept data from anything but the flight simulator itself. Why do you think you even want to send the data to the DLL? Isn't it to the flight simulator that you want to send the data to?

  30. #30

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Wm_copydata

    Yes Joacim, but once this is an .dll for an specific software that work inside FS, i need to Know if is possible comunicate directly with FS!

  31. #31
    Fanatic Member AceInfinity's Avatar
    Join Date
    May 2011
    Posts
    696

    Re: Wm_copydata

    The program itself would probably deal with the data, so that's where you would need to target, not this dll.
    <<<------------
    Improving Managed Code Performance | .NET Application Performance
    < Please if this helped you out. Any kind of thanks is gladly appreciated >


    .NET Programming (2012 - 2018)
    ®Crestron - DMC-T Certified Programmer | Software Developer
    <<<------------

  32. #32

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Wm_copydata

    Thanks to all for your Help

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