Click here to Skip to main content
15,899,754 members
Home / Discussions / C#
   

C#

 
GeneralRe: Window size to fit the screen resolution Pin
lune129-Sep-08 0:24
lune129-Sep-08 0:24 
AnswerRe: Window size to fit the screen resolution Pin
Pete O'Hanlon8-Sep-08 23:37
mvePete O'Hanlon8-Sep-08 23:37 
GeneralRe: Window size to fit the screen resolution Pin
lune129-Sep-08 0:15
lune129-Sep-08 0:15 
GeneralRe: Window size to fit the screen resolution Pin
Pete O'Hanlon9-Sep-08 0:37
mvePete O'Hanlon9-Sep-08 0:37 
QuestionPassing a database connection to a web service Pin
Chazzysb8-Sep-08 23:03
Chazzysb8-Sep-08 23:03 
AnswerRe: Passing a database connection to a web service Pin
Pete O'Hanlon8-Sep-08 23:18
mvePete O'Hanlon8-Sep-08 23:18 
AnswerRe: Passing a database connection to a web service Pin
MorganSim9-Sep-08 1:05
MorganSim9-Sep-08 1:05 
QuestionCall function from thread Pin
baerten8-Sep-08 22:55
baerten8-Sep-08 22:55 
Hi everybody,

it's probably a stupid question but i hope someone can help me Big Grin | :-D .

I have the following situation:

A TAPIClass which gets an eventhandler (which himself gets events from the phone)
I created a class CPhone which should store the instance of the TAPIClass.
In the constructor i create the TAPIClass instance and initialize it.

The CPhone instances are created into a thread which is created this way:
new Thread(new ParameterizedThreadStart(TelSignalThread));


where TelSignalThread is a static function of the Main-Form which creates
an instance of the CPhone class

public static void TelSignalThread(object param)
{
  MainForm Win = (MainForm)param;

  CPhone tel = new CPhone(Win);

  while(Win->Running)
  {
    Threading.Sleep(10);
  }
}


My question is, how is it possible to call a function from CPhone from out the MainForm?
Call the GUI from out the Thread works with Invoke.

Edit: Or is it the best way to derive my CPhone-Class from the class Thread and to add class-members<br />
to the CPhone class? Does exists a PhoneThreadInst->Invoke(...); ?



Before i created this thread and the CPhone-Class, i had the TAPIClass into the MainForm, without a special thread and it worked great.
Then i needed to open a new window from a button-click during a phone call.
This provokes sometimes a event-lost from the TAPIClass , and a missing "hang-up Event" disturbes my whole appliction Sigh | :sigh:

Big thanks for any help Smile | :)
AnswerRe: Call function from thread Pin
vikas amin9-Sep-08 8:20
vikas amin9-Sep-08 8:20 
GeneralRe: Call function from thread Pin
baerten9-Sep-08 21:40
baerten9-Sep-08 21:40 
QuestionHow can I convert garbled filenames (Chinese) to the correct codepage? Pin
alien058-Sep-08 22:39
alien058-Sep-08 22:39 
AnswerRe: How can I convert garbled filenames (Chinese) to the correct codepage? Pin
Frank Horn8-Sep-08 23:01
Frank Horn8-Sep-08 23:01 
GeneralRe: How can I convert garbled filenames (Chinese) to the correct codepage? Pin
alien058-Sep-08 23:08
alien058-Sep-08 23:08 
GeneralRe: How can I convert garbled filenames (Chinese) to the correct codepage? Pin
Frank Horn8-Sep-08 23:24
Frank Horn8-Sep-08 23:24 
GeneralRe: How can I convert garbled filenames (Chinese) to the correct codepage? Pin
alien058-Sep-08 23:32
alien058-Sep-08 23:32 
QuestionCrystal Report how to? Pin
TheCardinal8-Sep-08 21:01
TheCardinal8-Sep-08 21:01 
AnswerRe: Crystal Report how to? Pin
Wendelius9-Sep-08 7:39
mentorWendelius9-Sep-08 7:39 
GeneralRe: Crystal Report how to? Pin
TheCardinal9-Sep-08 17:22
TheCardinal9-Sep-08 17:22 
QuestionPrinting Issue in C# Pin
CoolCoder_New8-Sep-08 20:01
CoolCoder_New8-Sep-08 20:01 
QuestionNon PNP device Pin
vinay_K8-Sep-08 19:53
vinay_K8-Sep-08 19:53 
AnswerRe: Non PNP device Pin
leppie8-Sep-08 23:21
leppie8-Sep-08 23:21 
GeneralRe: Non PNP device Pin
vinay_K9-Sep-08 1:12
vinay_K9-Sep-08 1:12 
Questionhow to make a font ? Pin
Wan--Vevi8-Sep-08 17:04
Wan--Vevi8-Sep-08 17:04 
AnswerRe: how to make a font ? Pin
Wan--Vevi8-Sep-08 17:24
Wan--Vevi8-Sep-08 17:24 
GeneralRe: how to make a font ? Pin
Paul Conrad8-Sep-08 18:28
professionalPaul Conrad8-Sep-08 18:28 

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.