MultiThreading C++ Windows Forms

T

TazCoder

I have a problem with multithreading. The error I keep getting is that
findFileButton_Click(...) is not a member function. But when I take
the parameters out of the findFileButton_Click(...) inside the
ThreadStart it says that the method is not found, and parameters do not
match. How can I get around this to multithread my application?
Having either this, or sender makes no difference in the maethod.
Thanks for all help. (Sorry for the formatting It will not come out
any better then this)

private: System::Void findFileButton_Click1(System::Object * sender,
System::EventArgs * e)
{
searchThread = new Thread(new
ThreadStart(this,findFileButton_Click(sender,e)));
searchThread->Start();
}
private: System::Void findFileButton_Click(System::Object * sender,
System::EventArgs * e)
{
//code here
}
 
L

Larry I Smith

TazCoder said:
I have a problem with multithreading. The error I keep getting is that
findFileButton_Click(...) is not a member function. But when I take
the parameters out of the findFileButton_Click(...) inside the
ThreadStart it says that the method is not found, and parameters do not
match. How can I get around this to multithread my application?
Having either this, or sender makes no difference in the maethod.
Thanks for all help. (Sorry for the formatting It will not come out
any better then this)

private: System::Void findFileButton_Click1(System::Object * sender,
System::EventArgs * e)
{
searchThread = new Thread(new
ThreadStart(this,findFileButton_Click(sender,e)));
searchThread->Start();
}
private: System::Void findFileButton_Click(System::Object * sender,
System::EventArgs * e)
{
//code here
}

You should address this question to a Microsoft Windows
specific newsgroup like comp.os.ms-windows.programmer.win32.

The C++ language does not address OS specific API's like
the Win32 Thread.

Larry
 
M

m_handler

<quote>
You should address this question to a Microsoft Windows
specific newsgroup like comp.os.ms-windows.programmer.­win32.

The C++ language does not address OS specific API's like
the Win32 Thread.
</quote>

Please excuse the question, but I would just like to clarify for my own
knowledge: Isn't multi-threading processor specific rather then OS?
Also, is there any plans in the work to add multi-threading to the C++
Standard? (I assumed from your answer that it is not).

Thank you in advance for your replies
 
L

Larry I Smith

m_handler said:
<quote>
You should address this question to a Microsoft Windows
specific newsgroup like comp.os.ms-windows.programmer.­win32.

The C++ language does not address OS specific API's like
the Win32 Thread.
</quote>

Well, I'm going to go out on a limb here...
Please excuse the question, but I would just like to clarify for my own
knowledge: Isn't multi-threading processor specific rather then OS?

No. The threading API is provided by the OS. Windows uses (at least)
one threading API, Linux uses a different threading API, Solaris...,
AIX..., etc.
Also, is there any plans in the work to add multi-threading to the C++
Standard? (I assumed from your answer that it is not).

Not that I know of. Anything OS specific is not part of the language.
That does NOT mean that there are no threading libs, just that they
are not part of the 'C' or C++ Language Spec (because they differ from
OS to OS).
Thank you in advance for your replies

Smarter folks than I can correct me and/or provide you with more detail.

Regards,
Larry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,204
Messages
2,571,066
Members
47,672
Latest member
svaraho

Latest Threads

Top