Article View: borland.public.cppbuilder.database.multi-tier
Article #1875CGI works, ISAPI dll doesn't ! (Need urgent help)
From: sokolovda
Date: Wed, 16 Dec 1998 00:00
Date: Wed, 16 Dec 1998 00:00
62 lines
2972 bytes
2972 bytes
I wrote a CGI application that use TClientDataSet and TRemoteServer to gain
access to a database via simple application server (I used AdHoc Demo server
from C++ Builder Client/Server). It works excellent: CGI application, makes
SQL statements using its request, sets AdHoc's TQuery->SQL property via AdHoc
server's SetSQL function, ClientDataSet gets query's result...
This is a portion of my code:
__fastcall TMyWebModule::TMyWebModule(TComponent* Owner) : TWebModule(Owner)
{
RemoteServer->
AppServer.Exec(Function("SetDatabaseName") << "myBDEalias"
<< "");
srvr.Bind(LPDISPATCH(RemoteServer->AppServer));
}
...
somewhere in WebModuleMyAction onAction EventHandler
srvr.SetSQL(myWideString)
...
After making a CGI I decided to convert it to an ISAPI dll. I added my
WebModule to repository, created new Web Server Application / ISAPI/NSAPI dll,
deleted its default Web Module and added Web Module from repository. I did not
forget to #include any files (such as *_tlb.h etc.). New dll builded
successfully. But it does NOT work!!! When I start
http://localhost/scripts/mydll.dll I recieve an
INTERNAL SERVER ERROR 500
Exception: EOleSysError
Message: CoInitialize has not been called.
I've read a lot of articles in delphi-related newsgroups and have tried to
call CoInitialize(NULL) in some places like:
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
{
try
{
CoInitialize(NULL);
Application->Initialize();
Application->CreateForm(__classid(TwmMyWM), &wmMyWM);
Application->Run();
CoUninitialize();
}
catch (Exception &exception)
{
}
return 1;
}
or
__fastcall TMyWebModule::TMyWebModule(TComponent* Owner) : TWebModule(Owner)
{
CoInitialize(NULL);
...
}
but IIS 3.0 on NT Server SP4 continue to produce error message.
What can I do with this??
------
Thanks for any help.
D. Sokolov
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Technical Details
Message-ID:
<7590rs$uie$1@nnrp1.dejanews.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcd2b,68d8eef2ecb969e5,start X-Google-Attributes: gidfcd2b,public X-Google-Thread: 10f0c8,68d8eef2ecb969e5,start X-Google-Attributes: gid10f0c8,public From: sokolovda@my-dejanews.com Subject: CGI works, ISAPI dll doesn't ! (Need urgent help) Date: 1998/12/16 Message-ID: <7590rs$uie$1@nnrp1.dejanews.com> X-Deja-AN: 422961334 X-Http-Proxy: 1.1 cache1.dol.ru:3128 (Squid/2.1.PATCH1), 1.0 x9.dejanews.com:80 (Squid/1.1.22) for client 194.87.5.21, 194.87.5.56 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Wed Dec 16 19:15:11 1998 GMT Newsgroups: borland.public.cppbuilder.database.multi-tier,borland.public.cppbuilder.internet X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)