ok where should i put them for what i want to do?
Main Topics
Browse All Topicsok ive asked a few questions now but this is towards the end of my journey... Thanks for everyone that has helped.. truly i could have not done this without the community support:
ok basically when i compile the code below im getting 2 errors
1. Invalid Token Class ':' in class struct interface member declaration (line 70)
2. invalid token '(' in class struct interface memeber in line 72
ok now my part 2 of the question...
basically i want those 2 if commands at hte begining to run, if it comes up true i want it to then go down to the next setup (incoming:) goto place i setup...
then i want those 2 if commands to run...
if true then bam (and cycle that for 100 times to check if true)
if after 100 times still not true go to false, popup message and exit applicaiton?
is this setup correctly for that.. also for those errors thanks!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
you can reference labels only within the function, not between them
if you need to jump to that place then simply call _PhoneIncomingCall_Changed
in general, it should go to _PhoneIncomingCall_Changed
the other issue i am having is that the program will go to the second if statement automatically
so for example when the if phonecaltalking = true it works fine and connects / deconnects the call, but once hte call is disconnected it goes straight to the if phonecalltalking= false and brings up themessage...
first off, if the first if worked iw ant that to skip over that if statement go and straight to the next line of code...
second... whenever the text pops up either in phonecalltalking=false
or phoneincomingcal=false it will never go away. So if i press ok the on the text box it just stays there and does not exit the text box, so the application never exits...
one last thing (sorry for being nosy)...
in the if phoneincomingcall=true its not pressing down on the Yes or green button. Iits just staying put not answering the incomign call..
i have some cprog.exe questions but i will ask in anotehr post... thanks for al who are answering!
it seems right now it automatically goes to the second (the 3 n 4th) if statements when for example if the second one (phonecalltalking=false) then the app should exit
also if the phonecalltalking = true, then it closes the phone... but then since the phone is closed it reads phonecalltalking=false.. i dont want it to do that, only read the false if the true is not satisfied, once the true is satisfied go to the next set of if commands...? is that makes sense?
well, I do believe in books :) , open ANY tutorial, printed or online, PLEASE ! :)
but seriously, until you understand the basics, it is kind of pointless to do anything else.
for instance, with the code you've posted, it has 2 callbacks defines and assigned (for Talking and IncomingCall changes) which will be called by SNAPI core when appropriate properties have been changed. So when you end the call (in 1st callback) you should see it arrives to your code in 2nd one.
Now regarding ifs - you can always use
if ()
{
}
else if ()
{
}
else if ()
{
}
... and so until you checked all conditions you wanted, ie 2nd "else if()" is checked only if 1st is not true etc.
yea ive tried that before.. with the else if statements but it still goes to the second (phonecalltalking) regardless, so after the first concept is true or false it still goes to the false statement and popups up the "testing" box...
also it does not go to the second void or if statements..
i tried the goto commands but it did not work, and ive tried else if statements a nd it still goes to the second one..
i have the Microsoft mobile developer handbook and i have read it .. but i am still confused which is why i am asking on this forum? (;
unless u have another place better to ask?
well, let's see what you are doing in that code :)
first, you cancel the call, right? the very next iteration step will find Talking = false, won't it? So it's no surprise it goes to the "else if" block
second method is quite the same. Since each property you use is boolean, so if() {} else {} would do in this very case
ok im somewhat slow but i was under the impression that if i use if, else if that only if the if statement is not satisfied (ok that sounds bad...)
ok basically the if =true then it should run what is in the { } and then go to the next Void segment (the phoneincomingcall)
if the 'if' statement is false, then it goes toelse if, the popup message and exits app on the ok button of the message box....
but i do not want it to go to the else if statement if the first "if=true" statement is satisfied? does that clear it up?
the code is currently not doing that.
>>ok basically the if =true then it should run what is in the { } and then go to the >>next Void segment (the phoneincomingcall)
you are wrong here, it goes to the next iteration in the loop, so Talking is now FALSE and therefore it exits the application. just as you have written in the code.
let me guess basing on your previous posts that you intended to combine these 2 functions, so perhaps it is worth doing it in new thread (I omit all inter-thread UI stuff for simplicity now):
// Somewhere in the code, eg in Load event handler of the form put this
Thread thr = new Thread(new ThreadStart(tapiMonitorThr
thr.Start();
...
// then define this function
void tapiMonitorThread()
{
// put your loops here
}
ok... but still that does not solve the prolem of the next if statement..
i get creating a new thread? to check for what?
because if the true passes just like u said it checks for the false (which happens because the true drops the calll)...
so how is a new thread giong to change anything. That true false relationship is problematic?
or maybe im not understanding?
well, this is binary situation :) as either I don't understand what you want or you don't :)
have you tried to run the code under debugger? you could see where it goes and when.
as for the thread, it would allow you to put all 4 conditions in the same function, so you'd have a common loop and could check there all "ifs" you ever wanted :)
but wouldnt a goto command work>?
so like at hte bottom of the if statement (this code should be very basic) so if first = true
then goto the second if true command
if the if is false popup message and end program
if the if is true then false, pop up another box and close program...?
that is it?
right my quewstion shouldnt that be accomplished with just some basic code.. my question is what is that code ?
( i feel dense lol)..
goto can't jump between functions - that's it.
so if you want all 4 blocks to be available at one place - put them into one function and call it from somewhere, doesn't matter will it be a thread, _PhoneCallTalking_Changed(
you could remove for() loops, so then it would cancel phone call in Talking handler, then probably it would go to IncomingChanged handler since the call it terminated, and you get approximately what you want (in my interpretation, of course :) )
one thread it enough, put all if/else in one thread, loop forever or exit by some condition.
perhaps you could write down what you need in some pseudo-code, so it will be clearly stated. I have a feeling you won't need all those ifs. The latest code is kind of controversial, because eg when you terminate the call, PhoneIncomingCall property automatically becomes false, doesn't it? Well, it may take some short time, but finally it does.
ok i will write it down kind of ... this style it will help you under stand what iw ant..
ok program starts...
void _PhoneCallTalking_Changed(
{
for (int i = 0; i <= 8; i++)
{
if (SystemState.PhoneCallTalk
{
//F4 = red buton (hangup)
keybd_event(Keys.F4, 0, KEYEVENTF_KEYDOWN, 0);
keybd_event(Keys.F4, 0, KEYEVENTF_KEYUP, 0);
System.Threading.Thread.Sl
that loops 8 times or so...
then it that is satisfied it goes to this....
void _PhoneIncomingCall_Changed
{
System.Threading.Thread.Sl
for (int i = 0; i <= 20; i++)
{
if (SystemState.PhoneIncoming
{
keybd_event(Keys.F4, 0, KEYEVENTF_KEYDOWN, 0);
keybd_event(Keys.F4, 0, KEYEVENTFF_KEYUP, 0);
System.Threading.Thread.Sl
Application.Exit();
ok now if the program was not satifised (the phonecalltalking==false) then it goes to this..
else (SystemState.PhoneCallTalk
{
MessageBox.Show("TESTING12
System.Threading.Thread.Sl
Application.Exit();
and if the phonecalltalking==true and the phoneincomingcall==false then it goes to
else if (SystemState.PhoneIncoming
{
MessageBox.Show (" Could Not Recieve Server Connection");
Application.Exit();
that is the entire application.. (besides the first part stated earlier)...
well, after 1st iteration when you execute
if (SystemState.PhoneCallTalk
{
//F4 = red buton (hangup)
keybd_event(Keys.F4, 0, KEYEVENTF_KEYDOWN, 0);
keybd_event(Keys.F4, 0, KEYEVENTF_KEYUP, 0);
System.Threading.Thread.Sl
}
the property value of SystemState.PhoneCallTalki
Am I missing something? Why do you need to loop 8 times?
the loop needs to be that way to see if the call has gone out..
so like sometimes it takes a while for the call to connect .. so if its not connect that needs to loop..
if it connects.. then great goes onto second part of code, if not it fails and does text box..
how do i change it though to work like my previous post... its obviously not setup that way but how do ichange that?
I think you don't need to loop at all if you can reliably terminate the call.
these handlers will be called when properties change their values (assuming SNAPI works as expected).
so suppose incoming call is received => it should hit the code in IncomingCall_Changed() where you can terminate it.
the same is true for Talking_Changed()
this seems much more on the track. im going to build it in a few hours .. just one more question
i can see in the incomingcall part you said to "terminate incoming call"
i want hte incomign call to be picked up..
so ok my next post (question/topic) will be about cprog.exe, but basically when the system sees an incoming call.. to hit the left soft key or accept the call... (and go straight to the dialer menu with the phone connected...) so the incoming call i do not want ot "edn call" but accept call automatically? does the script do that.. i think it does but in your description it says it doesnt?
since you're using Keys.F4 in each function then it will terminate the call, not accept it.
probably it was a reason for my confusion before :)
I think I've posted a link in one of your earlier questions where there was a key code for green button.
From winuserm.h of WM6 SDK file:
#define VK_TSOFT1 VK_F1 // Softkey 1
#define VK_TSOFT2 VK_F2 // Softkey 2
#define VK_TTALK VK_F3 // Talk
#define VK_TEND VK_F4 // End
#define VK_THOME VK_LWIN // Home
#define VK_TBACK VK_ESCAPE // Back
#define VK_TACTION VK_RETURN // Action
#define VK_TRECORD VK_F10 // Record
#define VK_TFLIP VK_F17 // Flip
#define VK_TPOWER VK_F18 // Power
#define VK_TVOLUMEUP VK_F6 // Volume Up
#define VK_TVOLUMEDOWN VK_F7 // Volume Down
so you should use Keys.F3 when you want to simulate a click on anwer button.
correct, this is what I'm trying to get at :)
each handler is called when the property has been changed, eg from 0 to 1 or vice versa, from 1 to 0.
so, when you first enter to _PhoneCallTalking_Changed(
correct that is wht problem i have had the whole time...
i want it to skip from block one of the code.. If its True.. so if the first part is satisfied when then it automatically goes to the second void. THat false box with testing" is then will NEVER come up if the true pops up.. SO if True
then go to the second set of information automatically too that point...?
that is the ENTIRe problem i have been having lol... telling the code that if the first part is satsified then skip over that Else if statement of the false box (no matter what) and go to the second void...
how do i do that?
Business Accounts
Answer for Membership
by: cookrePosted on 2009-10-03 at 16:43:43ID: 25487559
} <---- marks the end of the method
eep(4000);
these are not in a method
Incoming:
continue;
System.Threading.Thread.Sl