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

Managed C++/CLI

 
GeneralRe: Array and String Pin
George L. Jackson8-Sep-07 5:27
George L. Jackson8-Sep-07 5:27 
GeneralRe: Array and String Pin
pourang10-Sep-07 4:20
pourang10-Sep-07 4:20 
AnswerRe: Array and String Pin
George L. Jackson8-Sep-07 5:23
George L. Jackson8-Sep-07 5:23 
GeneralRe: Array and String Pin
pourang9-Sep-07 11:59
pourang9-Sep-07 11:59 
AnswerRe: Array and String Pin
Chetan Patel9-Sep-07 21:23
Chetan Patel9-Sep-07 21:23 
GeneralRe: Array and String Pin
pourang10-Sep-07 4:24
pourang10-Sep-07 4:24 
QuestionPrinting from Print-Preview results in different output Pin
BuckBrown7-Sep-07 10:37
BuckBrown7-Sep-07 10:37 
QuestionHelp with Threading Pin
art_ami7-Sep-07 3:14
art_ami7-Sep-07 3:14 
Here is the code snippet of my application. background thread is a managed thread.

Code Snippet

public ref class Form1 : public System::Windows::Forms::Form

{

private:

Thread^ myThread; //Managed Thread Handle

IDiscovery* discObj // Pointer to unmanaged type

public :

static System::Void ThreadProc(System::Object^ pv)

{

System::IntPtr^ ptrDiscovery = cli::safe_cast<system::intptr^>(pv);

IDiscovery *discObj;

discObj = (IDiscovery *)ptrDiscovery->ToPointer();

//get the list from IDiscovery

discObj->discoverList(false);

}//END OF THREADPROC



private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

System::IntPtr^ pV = gcnew System::IntPtr(static_cast<void*>(discObj));

myThread = gcnew Thread(gcnew ParameterizedThreadStart(Form1::ThreadProc));

myThread->Start(pV);



}//END OF FUNCTION


At times I am getting following exception:

An unhandled exception of type 'System.AccessViolationException'

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.


I am not sure whether this the right way to do it. Please suggest.



Thanks a lot,

Arti
AnswerRe: Help with Threading Pin
led mike7-Sep-07 4:29
led mike7-Sep-07 4:29 
GeneralRe: Help with Threading Pin
art_ami7-Sep-07 22:52
art_ami7-Sep-07 22:52 
QuestionDesign Forms and Existing Items Pin
BuckBrown6-Sep-07 11:48
BuckBrown6-Sep-07 11:48 
QuestionMessage Removed Pin
5-Sep-07 13:39
Armond Sarkisian5-Sep-07 13:39 
AnswerRe: Opening a new command line instance Pin
Christian Graus5-Sep-07 15:00
protectorChristian Graus5-Sep-07 15:00 
AnswerRe: Opening a new command line instance Pin
Ralf Lohmueller5-Sep-07 15:21
Ralf Lohmueller5-Sep-07 15:21 
AnswerRe: Opening a new command line instance Pin
wly10286-Sep-07 0:17
wly10286-Sep-07 0:17 
QuestionPls can u help me with this error Pin
urbdos4-Sep-07 22:05
urbdos4-Sep-07 22:05 
AnswerRe: Pls can u help me with this error Pin
Hamid_RT5-Sep-07 5:29
Hamid_RT5-Sep-07 5:29 
AnswerRe: Pls can u help me with this error Pin
Christian Graus5-Sep-07 15:00
protectorChristian Graus5-Sep-07 15:00 
QuestionHow to add virtual ip in the windows xp to using c++? Pin
songjacky4-Sep-07 19:27
songjacky4-Sep-07 19:27 
AnswerRe: How to add virtual ip in the windows xp to using c++? Pin
Hamid_RT5-Sep-07 5:29
Hamid_RT5-Sep-07 5:29 
Questiona little help for an someone admittedly new to the program Pin
misterjason4-Sep-07 8:20
misterjason4-Sep-07 8:20 
AnswerRe: a little help for an someone admittedly new to the program Pin
Mark Salsbery4-Sep-07 9:36
Mark Salsbery4-Sep-07 9:36 
GeneralC1001 [modified] Pin
Hamid_RT4-Sep-07 3:41
Hamid_RT4-Sep-07 3:41 
GeneralRe: C1001 Pin
led mike5-Sep-07 5:44
led mike5-Sep-07 5:44 
GeneralRe: C1001 Pin
Hamid_RT5-Sep-07 19:32
Hamid_RT5-Sep-07 19:32 

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.