Solved

ISAPI Redirect Exception

Posted on 2000-02-17
8
289 Views
Last Modified: 2013-11-20
Hi, I have written an ISAPI extension dll that host active scripting.  It seems to be working well, except for one thing.  When I redirect to a URL using...

pCtxt->ServerSupportFunction(HSE_REQ_SEND_URL,(LPVOID)(LPCSTR)st,NULL,NULL);

the very next time the extension handles a request and tries to fire an ActiveX event I get an unhandled exception (type unkown?).  If I do not do the redirect then the exception is never thrown. Can anyone help?  I can supply some more code if necessary.
0
Comment
Question by:perrizo
  • 3
  • 3
  • 2
8 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 2533005
'(LPVOID)(LPCSTR)st' looks a bit suspicious - of what type is 'st' and what's the prototype of the method?
0
 
LVL 1

Author Comment

by:perrizo
ID: 2533014
st is a CString.  I have used this format in another extension that was not an Active Scripting host and it seemed to work fine.  Do you think this is a problem?
0
 
LVL 86

Expert Comment

by:jkr
ID: 2533160
I think it looks like a candidate, but maybe not - at least there seems to be no information how long the string is...
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 11

Expert Comment

by:mikeblas
ID: 2533412
jkr> at least there seems to be no information how long the string is...

Sure there is! The string is null-terminated!

..B ekiM
0
 
LVL 11

Accepted Solution

by:
mikeblas earned 400 total points
ID: 2533418
Please provide the code you're using to fire the event in the script, perrizo. Without seeing anything, it seems most likely that the IDispatch you're using to fire the event has become invalid. Maybe you're still holding on to the dispatch from the previous instance of the scripting engine.

..B ekiM
0
 
LVL 86

Expert Comment

by:jkr
ID: 2534778
>>Sure there is! The string is null-terminated!

Ooops, you're right... <blushing>

Well, the only excuse could be that I thought of it as

[in, out, string, size_is(...)]
0
 
LVL 1

Author Comment

by:perrizo
ID: 2552464
Mikeblas, You were correct... close at least.  It sent me in the correct direction.  Seems that when you call SetScriptSite VBScript.dll remembers which thread you called it from and only accepts messages from that thread.  Funny thing was that when you do a redirect IIS always issues the next call on a different thread but, most of the time on a simple WriteClient IIS tends to issue the next call on the same thread.  The problem/feature is outlined in KB article...

http://support.microsoft.com/support/kb/articles/q222/8/37.asp

Just thought you might find it interesting... thanks!
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 2552890
Great!  Good luck with your project.

..B ekiM
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maven archtype selection in eclipse 1 57
Hibernate methods 2 71
sum28 challenge 31 111
scoreUp challenge 14 61
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

813 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

10 Experts available now in Live!

Get 1:1 Help Now