Static linking of a DLL in a service application?

S

seppuku

Hello!

I wrote a service application, which fills a exported class from a dll
with data from a access database and sends this filled class in a loop
to a server.

First, I linked the dll dynamically and exported the class through a
function:

// Telegram, Export
extern "C" __declspec(dllexport) TTelegram* CreateTelegram()
{
return new Telegram;

}

Both, the service application and the dll include a header file, in
which the class is abstract.

This way, I can install and start the service application without
problems, but the memory is increasing immense and that's the main
problem.

So i tried and linked the dll in a test application statically and
exported the class like the example in the C++Builder 5 Developer's
Guide:

__declspec(dllexport) class TTelegram
{
....

};

This way, the memory isn't increasing so fast (but still, it is and I
don't know why...) and so I linked the DLL in the service application
statically, too.
I can install the service, but if i like to start it, it says: "Error
193: 0xc1" and in the Eventlog (or Eventhistory, don't know the english
word for it) of Windows it says: "This application is not a valid
Win32 application..."

Could it be, that the service doesn't find the dll? But I put it in the
start directory of the application and in the windows/system32
directory.
 
J

Jack Klein

Hello!

I wrote a service application, which fills a exported class from a dll
with data from a access database and sends this filled class in a loop
to a server.

You need to ask this in a group like
or one of Microsoft's
support groups in the family.

It is off-topic here, because neither services nor DLLs are defined by
the C++ language, they are Windows specific mechanisms.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,696
Latest member
BarbraOLog

Latest Threads

Top