Click here to Skip to main content
16,018,664 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: can not disassemble .lib file using ILDASM Pin
led mike12-Feb-08 9:56
led mike12-Feb-08 9:56 
Generalconvert Message To MSG Pin
javad_20058-Feb-08 1:13
javad_20058-Feb-08 1:13 
Generalerror C2371: 'IDataObject' : redefinition; different basic types Pin
s196675m7-Feb-08 7:15
s196675m7-Feb-08 7:15 
QuestionConvertion funtions Pin
lgatcodeproject6-Feb-08 22:55
lgatcodeproject6-Feb-08 22:55 
GeneralRe: Convertion funtions Pin
led mike7-Feb-08 4:31
led mike7-Feb-08 4:31 
GeneralRe: Convertion funtions Pin
lgatcodeproject11-Feb-08 22:15
lgatcodeproject11-Feb-08 22:15 
GeneralNetwork connection status Pin
vijboy5-Feb-08 12:14
vijboy5-Feb-08 12:14 
GeneralMulti threading Pin
vijboy4-Feb-08 11:21
vijboy4-Feb-08 11:21 
Hi,

I've the following code that runs in a timer function every second. OnTimedEvent() is a timer delegate that is invoked by Windows timer every second. It uses MFC/Windows SDK. It sets the processor priority for the thread that is running this code.

void CPci1553::OnTimedEvent( Object^ source, ElapsedEventArgs^ e )
{
//set the timer thread affinity to second process and set it to higher priority
SYSTEM_INFO info;

//get the configuration information of computer
GetSystemInfo(&info);

//if the system has more than one processor, use the last processor for TOD thread
//set the thread affinity to second processor
if(info.dwNumberOfProcessors > 1)
SetThreadIdealProcessor(GetCurrentThread(),info.dwNumberOfProcessors-1);
}


I need to upgrage this code for .NET using C++/CLI. I tried to use .NET functions like "System::Environment::ProcessorCount" to processor count in on the system, "System.Diagnostics.ProcessThread.IdealProcessor" to set the processory priority for the thread, "System.Threading.Thread.CurrentThread" to get the current running thread for this code. But the problem is "System.Diagnostics.ProcessThread" is unmanaged thread and "System.Threading.Thread" is managed thread. I don't know how to mix these two. Pls. help me with this code.

Thanks
Ram
GeneralRe: Multi threading Pin
Mark Salsbery4-Feb-08 12:06
Mark Salsbery4-Feb-08 12:06 
GeneralRe: Multi threading Pin
vijboy5-Feb-08 13:29
vijboy5-Feb-08 13:29 
GeneralAnother application running in the form Pin
rover_boy4-Feb-08 10:19
rover_boy4-Feb-08 10:19 
GeneralRe: Another application running in the form Pin
TJoe5-Feb-08 6:05
TJoe5-Feb-08 6:05 
GeneralConverting and .exe to a Form Control Pin
TheBerk4-Feb-08 6:54
TheBerk4-Feb-08 6:54 
AnswerRe: Converting and .exe to a Form Control Pin
TJoe5-Feb-08 6:28
TJoe5-Feb-08 6:28 
GeneralAdd/Remove items in a listBox Pin
newkid31-Jan-08 4:16
newkid31-Jan-08 4:16 
GeneralRe: Add/Remove items in a listBox Pin
led mike31-Jan-08 4:59
led mike31-Jan-08 4:59 
GeneralRe: Add/Remove items in a listBox Pin
newkid31-Jan-08 5:13
newkid31-Jan-08 5:13 
GeneralRe: Add/Remove items in a listBox Pin
led mike31-Jan-08 5:44
led mike31-Jan-08 5:44 
GeneralRe: Add/Remove items in a listBox Pin
rover_boy1-Feb-08 3:57
rover_boy1-Feb-08 3:57 
GeneralRe: Add/Remove items in a listBox Pin
led mike1-Feb-08 4:19
led mike1-Feb-08 4:19 
GeneralRe: Add/Remove items in a listBox Pin
newkid1-Feb-08 4:42
newkid1-Feb-08 4:42 
QuestionHow to wrap MFC control in C++/CLI Pin
BinName30-Jan-08 19:06
BinName30-Jan-08 19:06 
AnswerRe: How to wrap MFC control in C++/CLI Pin
led mike31-Jan-08 4:47
led mike31-Jan-08 4:47 
AnswerRe: How to wrap MFC control in C++/CLI Pin
Zeinpresiyo11-Feb-08 3:18
Zeinpresiyo11-Feb-08 3:18 
QuestionNeed help with twisted callback issue Pin
MissingLinkError30-Jan-08 13:13
MissingLinkError30-Jan-08 13:13 

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.