🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
1 messages
1 total messages Started by sokolovda Wed, 16 Dec 1998 00:00
CGI works, ISAPI dll doesn't ! (Need urgent help)
#1875
Author: sokolovda
Date: Wed, 16 Dec 1998 00:00
62 lines
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    
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads