__stdcall ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

__stdcall ?

Owen Corpening
I am writing some installation code, and wanted to include logging in it. Do
I have to install lib4cxxd.dll before I can use it?

Do I just add it to the PATH? or LIBPATH?

The code used in a .msi must be __stdcall, does that have an effect? I
haven't crossed this bridge before. Here is my code:

extern "C" UINT __stdcall ValidateActuateiServerSettings(MSIHANDLE hInstall)
{
char ServerPort[MAX_PATH];
DWORD ServerPortLen = MAX_PATH;
BasicConfigurator::configure();
LoggerPtr rootLogger = Logger::getRootLogger();

LOG4CXX_INFO(rootLogger, "Entering ValidateActuateiServerSettings");
MsiGetProperty (hInstall, "ISERVERPORT", ServerPort, &ServerPortLen);
MsiSetProperty (hInstall, "PORTBUSY", ServerPort[0] == '1' ? "1" : "0");
LOG4CXX_INFO(rootLogger, "Exiting ValidateActuateiServerSettings");

return ERROR_SUCCESS;
}



Reply | Threaded
Open this post in threaded view
|

Re: __stdcall ?

Owen Corpening
The only way I have gotten it to work is by copying log4cxxd.dll to
system32.

"Owen Corpening" <[hidden email]> wrote in message
news:d5nqph$e2f$[hidden email]...
> I am writing some installation code, and wanted to include logging in it.
Do
> I have to install lib4cxxd.dll before I can use it?
>
> Do I just add it to the PATH? or LIBPATH?
>
> The code used in a .msi must be __stdcall, does that have an effect? I
> haven't crossed this bridge before. Here is my code:
>
> extern "C" UINT __stdcall ValidateActuateiServerSettings(MSIHANDLE
hInstall)

> {
> char ServerPort[MAX_PATH];
> DWORD ServerPortLen = MAX_PATH;
> BasicConfigurator::configure();
> LoggerPtr rootLogger = Logger::getRootLogger();
>
> LOG4CXX_INFO(rootLogger, "Entering ValidateActuateiServerSettings");
> MsiGetProperty (hInstall, "ISERVERPORT", ServerPort, &ServerPortLen);
> MsiSetProperty (hInstall, "PORTBUSY", ServerPort[0] == '1' ? "1" : "0");
> LOG4CXX_INFO(rootLogger, "Exiting ValidateActuateiServerSettings");
>
> return ERROR_SUCCESS;
> }
>
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: __stdcall ?

carnold-3
Likely that you will have to link with a static library.  You shouldn't
place log4cxx.dll in system32 since we have not reached the point of
promising binary compatibility between versions.  Since a .msi is
likely a DLL itself (though I haven't checked that), the path is
controlled by the calling application, in this case "Microsoft
Installer" and the location of the .msi file is immaterial.  You
shouldn't be using the "d" (debug) version either.  There are some open
bugs with static linking on Microsoft, basically some appenders that
were expected to be forced into the link are dropped for some reason.

I suspect that the only thing that is required to be __stdcall are the
methods exposed in the .msi to be used by Microsoft Installer.  The
calling conventions in method calls within the .msi file should not be
important.


On May 9, 2005, at 7:27 PM, Owen Corpening wrote:

> The only way I have gotten it to work is by copying log4cxxd.dll to
> system32.
>
> "Owen Corpening" <[hidden email]> wrote in message
> news:d5nqph$e2f$[hidden email]...
>> I am writing some installation code, and wanted to include logging in
>> it.
> Do
>> I have to install lib4cxxd.dll before I can use it?
>>
>> Do I just add it to the PATH? or LIBPATH?
>>
>> The code used in a .msi must be __stdcall, does that have an effect? I
>> haven't crossed this bridge before. Here is my code:
>>
>> extern "C" UINT __stdcall ValidateActuateiServerSettings(MSIHANDLE
> hInstall)
>> {
>> char ServerPort[MAX_PATH];
>> DWORD ServerPortLen = MAX_PATH;
>> BasicConfigurator::configure();
>> LoggerPtr rootLogger = Logger::getRootLogger();
>>
>> LOG4CXX_INFO(rootLogger, "Entering ValidateActuateiServerSettings");
>> MsiGetProperty (hInstall, "ISERVERPORT", ServerPort, &ServerPortLen);
>> MsiSetProperty (hInstall, "PORTBUSY", ServerPort[0] == '1' ? "1" :
>> "0");
>> LOG4CXX_INFO(rootLogger, "Exiting ValidateActuateiServerSettings");
>>
>> return ERROR_SUCCESS;
>> }
>>
>>
>>
>>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: __stdcall ?

Owen Corpening
<whew> now if only I can get static linking with say a FileAppender working
....

So far <separate thread above> I haven't ever gotten a log file to actually
get written from within my app, tests work fine of course. And this is with
putting the file in system32, which I am forced to do on my evaluation
machine until I get static linking with non-debug lib figured out.

thanks though

owen

"Curt Arnold" <[hidden email]> wrote in message
news:[hidden email]...

> Likely that you will have to link with a static library.  You shouldn't
> place log4cxx.dll in system32 since we have not reached the point of
> promising binary compatibility between versions.  Since a .msi is
> likely a DLL itself (though I haven't checked that), the path is
> controlled by the calling application, in this case "Microsoft
> Installer" and the location of the .msi file is immaterial.  You
> shouldn't be using the "d" (debug) version either.  There are some open
> bugs with static linking on Microsoft, basically some appenders that
> were expected to be forced into the link are dropped for some reason.
>
> I suspect that the only thing that is required to be __stdcall are the
> methods exposed in the .msi to be used by Microsoft Installer.  The
> calling conventions in method calls within the .msi file should not be
> important.
>
>
> On May 9, 2005, at 7:27 PM, Owen Corpening wrote:
>
> > The only way I have gotten it to work is by copying log4cxxd.dll to
> > system32.
> >
> > "Owen Corpening" <[hidden email]> wrote in message
> > news:d5nqph$e2f$[hidden email]...
> >> I am writing some installation code, and wanted to include logging in
> >> it.
> > Do
> >> I have to install lib4cxxd.dll before I can use it?
> >>
> >> Do I just add it to the PATH? or LIBPATH?
> >>
> >> The code used in a .msi must be __stdcall, does that have an effect? I
> >> haven't crossed this bridge before. Here is my code:
> >>
> >> extern "C" UINT __stdcall ValidateActuateiServerSettings(MSIHANDLE
> > hInstall)
> >> {
> >> char ServerPort[MAX_PATH];
> >> DWORD ServerPortLen = MAX_PATH;
> >> BasicConfigurator::configure();
> >> LoggerPtr rootLogger = Logger::getRootLogger();
> >>
> >> LOG4CXX_INFO(rootLogger, "Entering ValidateActuateiServerSettings");
> >> MsiGetProperty (hInstall, "ISERVERPORT", ServerPort, &ServerPortLen);
> >> MsiSetProperty (hInstall, "PORTBUSY", ServerPort[0] == '1' ? "1" :
> >> "0");
> >> LOG4CXX_INFO(rootLogger, "Exiting ValidateActuateiServerSettings");
> >>
> >> return ERROR_SUCCESS;
> >> }
> >>
> >>
> >>
> >>
> >
> >
> >
>
>