Hi. I posted a while back about an interop question sending a string
from C++ to C#. I got the executable for that working just fine. Now,
I'm going to change it to an ISAPI dll so we can use this program
through our web server and it seems to be getting some kind of error
when it runs its main function. This function runs just fine in the
executable. Is there something special I have to do when I'm trying to
run my C# dll through a C++ DLL instead of a C++ executable?
Furthermore, what if I'm trying to run it through an ISAPI dll?
Thanks,
Kyle
P.S. If you need more information, just let me know. I will post
everything I can.
Sorry for another post. Here is some more information:
The ISAPI dll seems to fail specifically in the call to the C# dll
through COM. I have it output something to the *pCtxt both before the
call and after the call and I see everything, except for that which I
need to see!
What I did in the C# dll is translate an HTML webpage into an input
file for our program. I used a Writer class for writing out the XML
for our input, so it creates the file right away. I couldn't figure
out how to get the information back out of the C# dll to the C++ ISAPI
dll, so instead, the ISAPI dll is supposed to go grab the file that
was created and stream that back to our server, which then sends that
information to our actual program. It is not creating that file with
the C++ ISAPI dll. It does, however, create that file with the C++
executable. The annoying thing is that they have the exact same code
except how I pass the input to the C# dll, because with the ISAPI dll,
I have to go through an LPCSTR instead of using the executable args.
Could you tell me, is there something wrong with the following?
void CTranslationISAPIExtension::Default(CHttpServerContext* pCtxt,
LPCTSTR pstrInput)
{
const char* Input = pstrInput;
// Initialize COM.
HRESULT hr = CoInitialize(NULL);
// Create the interface pointer.
ITranslatorPtr Trans( __uuidof( Translator ) );
Trans->Process( _bstr_t( CComBSTR( Input ) ) );
// Uninitialize COM.
CoUninitialize();
After that, I go look for the file and stream it back out, but it
doesn't find the file because it's not there. Thanks again for any
help,
Kyle
On Feb 19, 10:37 am, "Kyle Szklenski" <kyle.szklen...@gmail.com>
wrote:
> Hi. I posted a while back about an interop question sending a string
> from C++ to C#. I got the executable for that working just fine. Now,
[quoted text clipped - 10 lines]
> P.S. If you need more information, just let me know. I will post
> everything I can.