Solved

ISAPI Redirect Exception

Posted on 2000-02-17
8
293 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Change owner from userA to server Local Administrators 7 71
if loop in java 3 165
move a line in eclipse 3 109
isEverywhere  challenge 19 86
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
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.

726 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