Solved

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

Posted on 2000-03-10
8
231 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
ID: 2606936
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
ID: 2607499
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
ID: 2607965
Nope. Sorry.
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 1

Expert Comment

by:snifong
ID: 2607966
Nope. Sorry.
0
 

Author Comment

by:giggs11
ID: 2608922
Adjusted points to 75
0
 

Author Comment

by:giggs11
ID: 2608923
pls help
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 2613374
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
ID: 2629755
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

809 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