Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

visual c++ scheduling for GUI

Status
Not open for further replies.

dabby21

Advanced Member level 4
Joined
Aug 8, 2011
Messages
114
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
Philippines
Activity points
2,232
anyone have any idea on using visual c++ as a scheduler?
 

anyone have any idea on using visual c++ as a scheduler?

If I understood correctly then you are trying to say that you want to execute a piece of code in a definite fashion with a set priority (after windows kernel) like a schedular (because visual c++ generaly uses windows schedular).
Please let me know that my understanding is correct or wrong. If mine is right then Yes it is possible. Use MFC(Microsoft Foundation Classes) and there you can directly right threads using CreateThread(). :!:
 

hi saubhik,

thanks for replying, yeah, just like a timer on a cellphone, you want to set a specific time for certain alarms. what i want to do is ill have this visual c++ as my GUI inorder for the user to schedule certain On/Off home appliances via USB. honestly im new to visual c++, and i will proposed this idea on my project design. And since im studying the microchip solution provided via HID USB that microchip provides, its a no choice for me but go with visual c++.
 

Hi dabby21,
you actually want a configurable timer which can be given time value from GUI. Declare a variable input from GUI and define a timer using the following snippet

// timerId = SetTimer(timerInstanceData,variableTime,NULL);
and OnTimer()

else you can use functions like
StartTimer(timeDuration)
StopTimer(timerID)
 
Hi saubhik,

yeah, your right sir, ive been working on a research regarding this, and ive read one book that tell about timers, with the same snippet that you gave. and so far ive understand it, but i have a question, does this timer the same as the desktop/ computer has? i mean if the desktop time is 11:00 am, and you set the timer for 1:00 pm, does the timer will work accordingly?
 

Nice question ...yes it will , because you are (Timer class) actually considering the CPU ticks , and not generating any other way to do this. :) ....
but heres a drawback ... if in between timer running you set the time of Desktop timer as fast or slow (Time wise) , it will not give any effect on the alarm code .... there your alarm will ring at wrong time(which is actually right as per the CPU ticks but your desktop time will be different)...
Can think for an exception handler too about this ....:)
 
Using the Timer Control - YouTube

saubhik

ive just watched this video sir, well explained by the author. i think some modifications will work on my project like this one. do you mind sir to share me some links for better understand the timer sir? anything will do. thanks for the time :)
 

Dabby21 , nice to see that you are really trying hard to know about inner details of the timer concept ... will write you back when will have any good document with me .....:)
 

hi saubhik,

yes, ive been reading even books on school just to manage and understand well what will i do with my project, but i have this questions running on my head sir. Can I used an array when setting an alarm? i mean, just like a phone, specifically a sony ericson phone, as i have this, the alarm clock system with this phone, you can set the alarms simultaneously, i mean more than 1 alarms can be set. ive been searching with some articles regarding this, but unfortunately cant found one. hope you have any idea regarding this saubhik. till then.
 

Dabby ....don't call me 'Sir' please...consider me as one of your friend...:)
Yes,you can take more than one timer simultaneously and use them. There is no restriction for that. yeah... your timer indexes can be put in an array easily .....
By the way... a small joke...mine is also Sony Ericsson one...hahaha :twisted:
 
hi again,

thanks for a soon reply.

ive found this article but theres an error on this one. I thought my project is done with this but i want to make a new one and i think its not a visual c++ and this is out dated but the whole idea of my plan is on this article.

please do take a look.

C++ Calendar Alarm Class with Repeat Capability - CodeProject
 

Dabby ....don't call me 'Sir' please...consider me as one of your friend...:)
Yes,you can take more than one timer simultaneously and use them. There is no restriction for that. yeah... your timer indexes can be put in an array easily .....
By the way... a small joke...mine is also Sony Ericsson one...hahaha :twisted:

Hi Dabby ,

Even you can use system.Threading and make the code using threads where the UI controls can be threaded also....using Timer class is also possible but operations become slow when no of tasks increases
refer the article - Multithreading in .NET - CodeProject
Good luck....
 
hi milind.a.kilkarni.

maybe my solution for my project is multi threading. thanks for sharing this link. ill study this one and hope i will be on the right track
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top