Click here to Skip to main content
15,914,111 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: configuration of windows update Pin
Girish6018-Oct-05 3:11
Girish6018-Oct-05 3:11 
GeneralRe: configuration of windows update Pin
Saksida Bojan12-Oct-05 19:49
Saksida Bojan12-Oct-05 19:49 
QuestionMFC v VC++.Net Pin
Klempie7-Oct-05 9:44
Klempie7-Oct-05 9:44 
AnswerRe: MFC v VC++.Net Pin
Christian Graus8-Oct-05 3:55
protectorChristian Graus8-Oct-05 3:55 
AnswerRe: MFC v VC++.Net Pin
Nemanja Trifunovic8-Oct-05 5:02
Nemanja Trifunovic8-Oct-05 5:02 
QuestionHow to signal an event from a managed event handler to an unmanaged callback in a different thread? Pin
mav.northwind7-Oct-05 0:16
mav.northwind7-Oct-05 0:16 
AnswerRe: How to signal an event from a managed event handler to an unmanaged callback in a different thread? Pin
mikanu10-Oct-05 5:45
mikanu10-Oct-05 5:45 
GeneralRe: How to signal an event from a managed event handler to an unmanaged callback in a different thread? Pin
mav.northwind10-Oct-05 7:51
mav.northwind10-Oct-05 7:51 
Thanks for your reply!

It's a bit complicated.
I have to handle objects implementing an unmanaged interface, let's call it IUnmanaged.
Part of this interface is a notification function, something like void OnPropertyChanged(PropertyType type), that has to be called when a property of the object changes.

The other methods of IUnmanaged have to communicate with a C# remoting server (let's call its interface IManagedServer) to perform their tasks.
In order to be able to access the managed server, I'll have to use managed code, so the result is a mixed mode dll.
This server defines an event (ManagedPropChanged) which in turn has to trigger OnPropertyChanged() for a certain IUnmanaged object.

Usually I'd just hook up the events and in the event handler OnManagedPropChanged() I'd call pMyUnmanagedObject->OnPropertyChanged(PropertyA).

The problem is that OnManagedPropChanged() is called by the .NET remoting infrastructure from a different thread than the one my IUnmanaged object was created in.
I have to call OnPropertyChanged() from the same thread the object was created in, that's part of the IUnmanaged specification.

One way I've come up with is to create an invisible window from the original thread and to PostMessage messages to this window from the OnManagedPropChanged handler, but I was wondering if there is a
better way.

Regards,
mav

-- modified at 13:51 Monday 10th October, 2005
P.S.: You'll see that I've modified the code structure a bit so that the problem gets clearer, but the basic problem is the same as the one in my first post... Smile | :)
Questionconfiguration of windows update Pin
Anonymous7-Oct-05 0:13
Anonymous7-Oct-05 0:13 
AnswerRe: configuration of windows update Pin
Saksida Bojan7-Oct-05 22:39
Saksida Bojan7-Oct-05 22:39 
Questionhow to link .lib file to my project (managed C++) in .Net Pin
vic120006-Oct-05 18:34
vic120006-Oct-05 18:34 
AnswerRe: how to link .lib file to my project (managed C++) in .Net Pin
Anonymous6-Oct-05 21:37
Anonymous6-Oct-05 21:37 
GeneralRe: how to link .lib file to my project (managed C++) in .Net Pin
vic120007-Oct-05 9:00
vic120007-Oct-05 9:00 
GeneralRe: how to link .lib file to my project (managed C++) in .Net Pin
mikanu10-Oct-05 5:50
mikanu10-Oct-05 5:50 
GeneralRe: how to link .lib file to my project (managed C++) in .Net Pin
vic1200011-Oct-05 19:01
vic1200011-Oct-05 19:01 
QuestionNeed help Base36 encoding large number (~45 digits) Pin
Suresh C T6-Oct-05 7:21
sussSuresh C T6-Oct-05 7:21 
AnswerRe: Need help Base36 encoding large number (~45 digits) Pin
Anonymous6-Oct-05 21:34
Anonymous6-Oct-05 21:34 
GeneralRe: Need help Base36 encoding large number (~45 digits) Pin
Anonymous9-Oct-05 21:36
Anonymous9-Oct-05 21:36 
QuestionConvert String to LPSTR ? Pin
Phernando6-Oct-05 6:53
Phernando6-Oct-05 6:53 
AnswerRe: Convert String to LPSTR ? Pin
Sheng Jiang 蒋晟7-Oct-05 12:56
Sheng Jiang 蒋晟7-Oct-05 12:56 
QuestionWindows Message disappearing Pin
mav.northwind5-Oct-05 22:28
mav.northwind5-Oct-05 22:28 
AnswerRe: Windows Message disappearing Pin
mav.northwind6-Oct-05 5:26
mav.northwind6-Oct-05 5:26 
QuestionWindows Services Pin
Laji594-Oct-05 18:02
Laji594-Oct-05 18:02 
AnswerRe: Windows Services Pin
sunit58-Oct-05 2:15
sunit58-Oct-05 2:15 
GeneralRe: Windows Services Pin
Laji598-Oct-05 20:57
Laji598-Oct-05 20:57 

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.