|
thanks, ic at last
one is the other who absorbs the thoughts of others
|
|
|
|
|
Hello guys
I know that this is the wrong forum, but I didnt find an ASP forum
See the ASP code below
Set s = server.CreateObject("WScript.Shell")
s.Run "d:\jjj.bat"
Works fine for me.
But when I replace jjj.bat with c:\winnt\notpade.exe what happens is that notepad gets spawned [I can see it in the task manager] but it never gets shown
so I replaced the line with this line :-
s.Run "c:\winnt\notepad.exe",3,false
3 stands for maximized and false means return immediately
Now what happens is the same.
Notepad gets spawned but the window doesnot pop up visibly on the server running IIS 5.0 and what's even worse is that despite giving false s.Run never returns with the result that we get a hanging ASP !!!
What do I do to resolve this?
Of course I am not at all interested in notepad.
But for some reason I need to use ASP to start a GUI program on the IIS machine.
I tried the above code on a win98 machine running PWS and successfully had notepad upon the screen
But win2K and IIS is not allowing me to do that.
So the question is this -
How do we spawn a GUI program using ASP and return, allowing the GUIprogram to finish on its own.
Regards and apologies for using the wrong forum,
Nish [ASP-program-spawning newbie]
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Ahhhhh! What are you doing spawning GUI apps from IIS process? (that is a rhetorical questions).
I've never tried nor I will ever attempt to try to do what you are describing, but here are the few things to try/consider:
On properties of your web site in IIS under Home Directory tab there is a setting for Application Protection. Default setting is "Medium (Pooled)" you can try switching to "Low (IIS Process)".
Also everything you launch from IIS process is running under IUSR_MACHINENAME account. Does this account have sufficient permissions to run Notepad.exe or your GUIApp?
I believe that by default IIS does not let you launch "out-of-process" (I know we are not talking COM here but could not find a better term) processes. I know how to overcome this with COM, but I am not sure in your case. So if nothing else works you might want to turn your GUIApp into an out-of-process COM exe and then you will be able to Server.CreateObject it from ASP and make it do whatever you need. If your GUIApp is not something you wrote then you might want to create a separate out-of-process app that will in turn launch your GUIApp...
Boy, what a mess... I strongly recommend to find some other way of doing what you are doing. I have been supporting out-of-process COM component that is called from ASP for a while and it is a nightmare you do not want to have in your life - trust me.
I am sorry, if I am not much help...
|
|
|
|
|
Hi Konstantin
Thanks. I think the fact that all apps spawned will be running as IUSR_MACHINENAME has something to do with this state of affairs. But what was puzzling was that when I tried to terminate these spawned instances using task-manager I got an access-denied message despite running as administrator which is amazing. I finally right-clicked on the process in the task-list,clicked debug, then VS debugger jumped up,clicked stop and exited VS and then checked task-manager again to find that the app had gotten killed. Amazing sequence of events.
Thanks once again,
Nish [running as IUSR_MACHINENAME ]
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Hi,
Is there any way to resize the animation control in such a way that the animation is not clipped but resized?
Thanks Krishnan
|
|
|
|
|
If I have a class that is inherited by several other classes, should i use exceptions to differentiate between errors from the individual classes, even thought the rest of the classes just return error codes?
Stephen Caldwell
Blackfission, CEO
http://blackfission.myip.org:81
|
|
|
|
|
I would like to know how do draw a Transparent Bitmap using Memory Dc Throught the entire code...And not screen dc at all ...........Then later when the Transparent Bitmap is in the Memory dc ...I am interested in doing this cox i would like to store the transparent BItmpa for late use.....Transfer it to The Screen Dc............
Is It possible to do This..........???
|
|
|
|
|
I think I've seen this before... Please only ask your questions once.
YOu can store your bitmap with a colour key ( presumably it comes this way ), and then draw it when you need to. You can use TransparentBlt if W95 compatibility does not matter to you, if it does I have code at www.wdj.com, Sept 2001, I'm sure a variation on it exists here somewhere as well.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I would like to know how do draw a Transparent Bitmap using Memory Dc Throught the entire code...And not screen dc at all ...........Then later when the Transparent Bitmap is in the Memory dc ...I am interested in doing this cox i would like to store the transparent BItmpa for late use.....Transfer it to The Screen Dc............
Is It possible to do This..........???
|
|
|
|
|
The only way to draw a transparent image is to merge it with the image it is being drawn onto, using masks or similar to fill in the 'transparent' area with the image it is being drawn over.
But until you get to have a 'screenDC' ( i.e. a DC you're drawing to ), you're not going to draw it at all in any case. Until that point, why would you want to keep it in a DC ? ( You can do, of course, as a colour keyed image, but how can you draw it transparently until you have something to draw it onto ? ).
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
The reason y i want to store it in Memory DC...Is becoz I wnat to Store the Bitmap for later use ...........This was I will not have to go thru the same code and perform the mask again and again evrytime the user wants to display the transparent image ..Hence it speed things up..............Yes later while displaying the image i will Just StretchBLT this Transparent imgae to the Screen DC ............Is there a way i can get my transparent Image in a CBitmap Object ......and Letr can copy it to the Screeen Dc ???
|
|
|
|
|
Is English not your first language ? Your posts are very annoying to try and read.
There is no such *thing* as a transparent bitmap in GDI, only a bitmap with a mask color which will be used to define transparency. Have you done any transparent drawing yet ? If so, how ? Both transparentBlt and the Win95 compatible solutions around the place use a mask color, which your stored bitmap quite plainly can ( and will ) have.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Hi.
Under what situation should one use auto_ptr instead of plain pointer? I am in a situation where I cannot decide on using auto_ptr or pointer. I like auto_ptr because I trust that if something goes wrong at run-time, auto_ptr will help eliminate possible memory leaks. When do you recommend using auto_ptr?
Thanks,
Kuphryn
P.S. auto_ptr declaration cannot be in a switch:
switch (variable)
{
case 1 : auto_ptr<class> temp(new class); // illegal
...
}
|
|
|
|
|
>Under what situation should one use auto_ptr instead of plain pointer?
> [...] I like auto_ptr because I trust that if something goes wrong at
> run-time, auto_ptr will help eliminate possible memory leaks.
You generally use auto_ptr objects when using exception handling, so that if/when an exception is thrown, it will free it's contained pointer (the auto_ptr gets destructed as the stack is unwinding).
A little known/respected fact about auto_ptr implementations: they normally call "delete" on the contained pointer, when they are destructed. But what if the contained pointer should have been deleted with "delete[]" ? Depending on if your RTL/compiler treats "delete" and "delete[]" differently, you may or may not have a problem.
> P.S. auto_ptr declaration cannot be in a switch:
Perhaps your syntax is incorrect. This ia a bad example, but compiles for me (barring warnings):
<br />
switch( DWORD dwValue = 1 )<br />
{<br />
case 1:<br />
{<br />
std::auto_ptr< char > cpChar( new char );<br />
}<br />
}<br />
Peace!
-=- James.
|
|
|
|
|
Okay. Thanks.
I think I figure out the essense of auto_ptr. auto_ptr is a quick and easy exception handling for class objects.
Here is a performance question. I always make sure all classes I use are secure from memory leak. I implement exception handling when dealing with many standard library functions that could return errors, i.e. new. Anyways, is it better to use auto_ptr and let the class handles unexpected run-time errors, or is it better to make sure the class is completely error proof (as much as possible)?
Kuphryn
|
|
|
|
|
i set a breakpoint in the first line of OnDraw Function
but the program won't step into it
one is the other who absorbs the thoughts of others
|
|
|
|
|
I'm just starting to use GDI+...
In the "good old days" I always created a HDC in memory, did all the drawing on it, anf finally BitBlt'ed it to the "real" HDC that actually shows on the screen. This way there was never any flickering when repainting the screen.
Now I have a good question: How do I do that with GDI+?
Do I really have to make a HDC in memory, create a Graphics object that uses my memory-HDC, and then finally BitBlt() from my memdc to my screendc, or is there a smarter way to do it in GDI+?
I really don't want to draw directly on the screen, I need to draw all my graphics in memory, and then copy it all to the screen at once (no flicker).
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
You'd associate a graphics object with your screen DC, create another to contain a Bitmap in order to draw on it, and then use DrawImage ( I'm going by memory here, I might be getting names wrong ) to draw that bitmap onto the Graphics object containing your screen DC.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Thanks a lot Christian,
I'l try that (why didn't I think of that my self )
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
hi to all the great developers out there!
what could be the reason for a program to crash at the last statement i=e, return 0?
the message is something like the instruction at location xxxx tried to reference memory at location xxxx. the memory could not be written.
please help, i'm stuck!
imran.
|
|
|
|
|
Probably something in a destructor that is being called as scope ends.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
It's straight C ? If it were me, I'd start commenting things out until I found which bit is causing the problem. How big is the function ? Can you post some code ?
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
You're *sure* it's not a stack overflow then ?
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
If you can localize the problem to a specific function (by selectively commenting out other stuff), go ahead and post the code (and the sample data you feed it). It should be relatively easy to spot the problem.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
// ahum, sorry!
/*
ok ravi, YOU asked for it!!! nah, looks scary but ain't. just look at the function tryRule, or, the one that calls it, readStrings. rest is just file reading and formatting stuff. i'm sure you'll see the cause of the problem.
************************************
these four lines have to be placed as a text file, say grammar.txt
S -> Saabb | ccc | $
S -> kTk
T -> pppter
T -> pppalter
*************************************
these two lines may be put in another text file, say strings.txt
gyrwweweweerrw
kpppalterkaabb
******************************************
this is the code. command line parameters are
1. the grammar file,
2. the strings file
3. any file for getting the results.
******************************************
*/
#include <iostream.h>
#include <fstream.h>
#include <string.h>
#include <stdlib.h>
int countGrammarLines(char*);
void readGrammar(int, char**, char*);
void readStrings(char**, char*, char*);
bool tryRule (int, char**, char *, char* &);
int countGrammarLines(char* grammarFile)
{
int count=0;
char line[100];
char *token;
token = new (char) (100);
ifstream fin(grammarFile, ios::nocreate);
if (!fin) {
cout << grammarFile << ": File not found" << endl
<< "Exiting the application!" << endl;
exit(0);
}
while (!fin.eof()) {
fin.getline(line, 100, '\n');
count++;
token = strtok(line, "|");
while (token != NULL) {
count++;
token = strtok(NULL, "|");
}
--count;
}
fin.close();
return count;
}
void readGrammar(int count, char** rules, char* grammarFile)
{
char line[100];
char *token;
ifstream fin(grammarFile, ios::nocreate);
if (!fin) {
cout << grammarFile << ": File not found" << endl
<< "Exiting the application!" << endl;
exit(0);
}
for (int i=0; i<count; i++) {
fin.getline(line, 100, '\n');
token = strtok(line, "|");
*(rules[i]) = *token;
strcpy (rules[i]+1, token+5);
if (*(rules[i] + strlen(rules[i])-1) == ' ')
*(rules[i] + strlen(rules[i])-1) = '\0';
token = strtok(NULL, "|");
while (token != NULL) {
i++;
*(rules[i]) = line[0];
strcpy (rules[i]+1, token+1);
if (*(rules[i] + strlen(rules[i])-1) == ' ')
*(rules[i] + strlen(rules[i])-1) = '\0';
token = strtok(NULL, "|");
}
}
fin.close();
}
void readStrings(int count, char** rules, char *stringFile, char *resultFile)
{
char *line = new (char) (100);
int strCount = 1;
bool result = false;
ifstream fin(stringFile, ios::nocreate);
ofstream fout(resultFile);
if (!(fin)) {
cout << stringFile << " : File not found" << endl
<< "Exiting the application!" << endl;
exit(0);
}
while (!fin.eof()) {
fin.getline(line, 100, '\n');
for (int i=0; i<count; i++) {
fout << strCount++ << ". ";
if (*rules[i] == 'S') {
if (tryRule (count, rules, (rules[i]+1), line)) {
result = true;
break;
}
}
}
fout << (result ? "accepted" : "rejected") << endl;
cout << (result ? "accepted" : "rejected") << endl;
}
fin.close();
fout.close();
}
bool tryRule (int count, char** rules, char *rule, char* &str)
{
char *temp;
char *newrule = new (char) (2 * strlen(str));
bool result = false;
while (*rule == *str && *rule != 0 && *str != 0) {
rule++;
str++;
}
temp = str;
if (*rule == 0 && *str == 0)
return true;
else if (*rule == '$')
return tryRule (count, rules, ++rule, str);
else if (*rule >= 'A' && *rule <= 'Z') {
for (int i=0; i<count; i++) {
if (*rules[i] == *rule && (strlen(rules[i]) + strlen(rule)) <= 3 + strlen(str)) {
strcpy (newrule, rules[i]+1);
strcat (newrule, rule+1);
result = result || tryRule (count, rules, newrule, str);
if (result)
break;
else
str = temp;
}
else
result = false;
}
}
return result;
}
int main(int argc, char *argv[])
{
char **rules;
int count;
count = countGrammarLines(argv[1]);
rules = new (char*[count]);
for (int i=0; i<count; i++)
rules[i] = new (char) (100);
readGrammar(count, rules, argv[1]);
readStrings(count, rules, argv[2], argv[3]);
return 0;
}
|
|
|
|
|