Click here to Skip to main content
15,881,967 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am having wpf application and C++ dll.and having while loop in c++ dll when ever the data found in loop need to send message to Wpf application for eg:- i am having the list of 100 names and run in a loop one by one for each name i need to get message from c++ dll that name need to view one by one dynamically in the wpf application.

What I have tried:

i tried a whole list will send from c++ dll to WPF application not one by one.
Posted
Updated 16-Feb-21 19:24pm
v2
Comments
Richard MacCutchan 15-Feb-21 8:36am    
The functions in a DLL are generally designed as passive. That is they only return information when requested by the controlling application. If you need the DLL to be active then you will need to register a callback in the application to receive the data.
Shao Voon Wong 15-Feb-21 21:24pm    
To keep it simple, the C++ function should just find the names and return the found names to WPF.

1 solution

A message isnt the best solution, but some callback delegate to change the displayed data. Best is to use some dispatch to avoid blocking and threading issues of the software.

Read my article about C++ and C# interaction for some example code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900