Solved

can isapi produce the same thing like the normal program do?

Posted on 2000-03-10
8
228 Views
Last Modified: 2010-04-02
i'm using visual c++ to do isapi. i'm sending 4 parameter to this dll file and try to use it to control my motor at parallel port. it need certain sequence to produce the correct move of motor. the problem happen when the isapi file receive the parameter and process it nicely and produce an output, which i only get the final processing parameter at parallel port.

i've used sleep() function to send the sequence accordingly to make the motor move like i've done in the normal dialog based program. it works fine. but the isapi finish process all the looping and produce one output at parallel port. is there any way to make it run like what happen in dialog based program. is the placing of command and function play a role here. pls advise. thanks.
0
Comment
Question by:giggs11
8 Comments
 
LVL 1

Expert Comment

by:snifong
Comment Utility
Can you ellaborate a little bit.  I don't understand. What does "...my motor at parallel port." mean?  What does "...final processing parameter at parallel port." mean?
0
 

Author Comment

by:giggs11
Comment Utility
a stepper motor need a sequence like 0001 .. 0010 .. 0100 .. 1000 ......... to move to desired place. the problem i'm facing now is isapi only send the final sequence. that mean the motor wouldn't move. i loop the function and send the sequence accordingly will make the motor move smoothly with the help of sleep(). do u have any idea to do that. it works fine under normal dialog based program. thanks
0
 
LVL 1

Expert Comment

by:snifong
Comment Utility
Nope. Sorry.
0
 
LVL 1

Expert Comment

by:snifong
Comment Utility
Nope. Sorry.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:giggs11
Comment Utility
Adjusted points to 75
0
 

Author Comment

by:giggs11
Comment Utility
pls help
0
 
LVL 9

Expert Comment

by:ShaunWilde
Comment Utility
instead of sleeping have you tried posting a timer message and then processing each step on the return?



0
 

Accepted Solution

by:
chuckle earned 75 total points
Comment Utility
You question is a bit unclear:
1. Are the parameters recieved by the ISAPI DLL all at once?
2. How are you sending the parameters to the motor? Windows messaging? COM? API calls?

but I think I can help you:

How good of an understanding of ISAPI do you have? A clear understanding of ISAPI and how IIS processes requests might help you out. A good place to start (which you have probably already found)
http://msdn.microsoft.com/isapi/msdnlib.idc?theURL=/library/devprods/vs6/visualc/vccore/_core_internet_server_api_.28.isapi.29_.extensions.htm


It sounds like you might need to implement a worker thread pool in the ISAPI DLL. ESPECIALLY if you are going to sleep during the processing of the request.

Worker threads will allow your ISAPI DLL to recieve responses from the web server and spawn off workers to control the motor. The workers will make sure all of the parameters make it to the motor in the proper order.

There is an excellent article on MSDN about how to implement worker threads.
http://support.microsoft.com/support/kb/articles/Q185/5/18.ASP

If you are building a high performance web application you might want to refine the worker thread concept with a thread pool. There is an excellent article and example on Microsoft's MSDN at:
http://support.microsoft.com/support/kb/articles/Q197/7/28.ASP

Both article are clear and well written and my humble attempts to explain things to you would pale in comparison.

-ece
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now