Solved, problem existed between keyboard and chair.
The code I use to register to the OpenSLP service is included in a DLL, 
I linked correctly against the DLL but forgot to replace it with the one 
in the folder where my executable is located.

Sorry for the inconvenience.

Regards,
Gerard


On 12/22/2011 11:38 AM, Gerard van den Bosch wrote:
> Yes this was switched on by default, just installed VS2008Express and
> opened the project file.
> Switched it off manually and it only gave a warning and compiled.
>
> Ok, this is the code that works under Linux with V1.2.1:
>
> void xmlpcp_db::MySLPRegReport(SLPHandle hslp, SLPError errcode, void
> *cookie)
> {
>       *(SLPError *)cookie = errcode;
> }
>
> void xmlpcp_db::xmlpcp_registerservice(QString service, QString address,
> quint16 port)
> {
>       SLPError err;
>       SLPError callbackerr;
>       SLPHandle hslp;
>
>       /* Register service locally */
>       this->iLastSubscriptionID = 1;
>       this->iSubscribersAmount = 0;
>       this->sService = service;
>
>       /* Register service to the SLP server */
>       err = SLPOpen("en",SLP_FALSE,&hslp);
>       if(err != SLP_OK)
>       {
>           qDebug()<<  "Failed to open SLP handle";
>           return;
>       }
>
>       this->sSLPUrl =
> "service:"+service+"://"+address+":"+QString::number(port);
>       err =
> SLPReg(hslp,this->sSLPUrl.toAscii().data(),SLP_LIFETIME_MAXIMUM,0,"",SLP_TRUE,MySLPRegReport,&callbackerr);
>       if((err != SLP_OK) || (callbackerr != SLP_OK))
>       {
>           qDebug()<<  "Error registering service to SLP";
>           return;
>       }
>
>       SLPClose(hslp);
>
>       emit sendLog("Registered service: "+service);
> }
>
> Regards,
> Gerard
>
> On 12/22/2011 11:30 AM, Hird Matthew wrote:
>> Ah sorry, my bad, I made that change recently but have no way to test on
>> windows. I'll commit your patch, thanks. I'm guessing it only actually
>> failed as you've got 'treat warnings as errors' switched on? If you switched
>> that off, it'd just be a warning?
>>
>> Could you email the code you're trying to use to register your own service?
>> My company blocks pastebin unfortunately.
>>
>> Does this code work under linux?
>>
>> cheers
>> Matt
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Gerard van den Bosch [mailto:ger...@de-haardt.com]
>> Sent: 22 December 2011 09:57
>> To: Hird Matthew
>> Cc: openslp-users@lists.sourceforge.net
>> Subject: Re: [Openslp-users] OpenSLP windows problem
>>
>> Matthew,
>>
>> Thanks for your reply, I have build the latest revision from the repository.
>> At first it wouldn't compile(VS express 2008) due to this:
>> ..\..\slpd\slpd_process.c(204) : error C2220: warning treated as error - no
>> 'object' file generated
>>     ..\..\slpd\slpd_process.c(204) : warning C4018: '>' : signed/unsigned
>> mismatch
>>
>> Fixed this error with a small change:
>> Index: slpd_process.c
>> ===================================================================
>> --- slpd_process.c    (revision 1688)
>> +++ slpd_process.c    (working copy)
>> @@ -201,7 +201,7 @@
>>               size_t currentPosFromStart = (*sendbuf)->curpos -
>> (*sendbuf)->start;
>>
>>               /* check to make sure we're growing by at least the size of the
>> tmp buffer */
>> -          *sendbuf = SLPBufferRealloc( (*sendbuf),
>> ((*sendbuf)->allocated + ((tmp->end - tmp->start)>   grow_size?(tmp->end -
>> tmp->start):grow_size)) );
>> +          *sendbuf = SLPBufferRealloc( (*sendbuf),
>> ((*sendbuf)->allocated + ((size_t)(tmp->end - tmp->start)>
>> grow_size?(tmp->end - tmp->start):grow_size)) );
>>               if (*sendbuf == 0)
>>               {
>>                  retVal = SLP_ERROR_INTERNAL_ERROR;
>>
>> When I add a server manually now with the slptool tool it continues to
>> exist, however registering my own application still fails.
>>
>> Regards,
>> Gerard
>>
>> On 12/21/2011 03:50 PM, Hird Matthew wrote:
>>> Gerard
>>>
>>> I'm not sure why your windows version doesn't work but if you don't
>>> mind compiling from source, I would step up to the latest revision
>>> (1688) for both from the repository if I was you -
>>> http://sourceforge.net/scm/?type=svn&group_id=1730
>>>
>>> The problem you are having with services disappearing is because there
>>> is a pid watch facility enabled on the daemon. As soon as the pid
>>> disappears from the process table, any services associated with it are
>>> removed. You can either switch it off via the slp.conf file or step up
>>> to the latest revision as I believe somebody has put a patch in to
>>> stop this happening from slptool.
>>>
>>> cheers
>>> Matt
>>>
>>>
>>> -----Original Message-----
>>> From: Gerard van den Bosch [mailto:ger...@de-haardt.com]
>>> Sent: 21 December 2011 12:51
>>> To: openslp-users@lists.sourceforge.net
>>> Subject: [Openslp-users] OpenSLP windows problem
>>>
>>> Hello,
>>>
>>> I have made a server application in Qt, in order to automatically
>>> discover the server I've implemented code that talks with the OpenSLP
>>> API and registers the server. This code works fine on Linux but I am
>>> having troubles to get it running on Windows (XP).
>>>
>>> I have a small version difference, the version of SLPD on my Linux
>>> machine is 1.2.1 and the one on my Windows version is 2.0.0, I assumed
>>> the interface would stay the same so this wouldn't be a problem.
>>>
>>> On both OS's I compiled against SLP.h and on Linux linked with -lslp
>>> and with Windows I have linked against slp.dll.
>>>
>>> I have adapted the code from the openslp.org site, my code can be
>>> found
>>> here: http://pastebin.com/dak6YGnE
>>>
>>> The weird thing is also when I register a dummy service by hand with
>>> the slptool it disappears within a few seconds. I've also tried to run
>>> slpd.exe in debug mode but nothing showed up.
>>>
>>> Can anyone point me where this might be going wrong?
>>>
>>> Regards,
>>> Gerard
>>>
>>>
>>> ----------------------------------------------------------------------
>>> ------
>>> --
>>> Write once. Port to many.
>>> Get the SDK and tools to simplify cross-platform app development.
>>> Create new or port existing apps to sell to consumers worldwide.
>>> Explore the Intel AppUpSM program developer opportunity.
>>> appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev
>>> _______________________________________________
>>> Openslp-users mailing list
>>> Openslp-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/openslp-users
>>>
>>> This email, including any attachment, is a confidential communication
>>> intended solely for the use of the individual or entity to whom it is
>>> addressed. It contains information which is private and may be
>>> proprietary or covered by legal professional privilege. If you have
>>> received this email in error, please notify the sender upon receipt,
>>> and immediately delete it from your system.
>>>
>>> Anything contained in this email that is not connected with the
>>> businesses of this company is neither endorsed by nor is the liability of
>> this company.
>>> Whilst we have taken reasonable precautions to ensure that any
>>> attachment to this email has been swept for viruses, we cannot accept
>>> liability for any damage sustained as a result of software viruses,
>>> and would advise that you carry out your own virus checks before opening
>> any attachment.
>>
>> This email, including any attachment, is a confidential communication
>> intended solely for the use of the individual or entity to whom it is
>> addressed. It contains information which is private and may be proprietary
>> or covered by legal professional privilege. If you have received this email
>> in error, please notify the sender upon receipt, and immediately delete it
>> from your system.
>>
>> Anything contained in this email that is not connected with the businesses
>> of this company is neither endorsed by nor is the liability of this company.
>>
>> Whilst we have taken reasonable precautions to ensure that any attachment to
>> this email has been swept for viruses, we cannot accept liability for any
>> damage sustained as a result of software viruses, and would advise that you
>> carry out your own virus checks before opening any attachment.
>>
>
>
> ------------------------------------------------------------------------------
> Write once. Port to many.
> Get the SDK and tools to simplify cross-platform app development. Create
> new or port existing apps to sell to consumers worldwide. Explore the
> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
> http://p.sf.net/sfu/intel-appdev
> _______________________________________________
> Openslp-users mailing list
> Openslp-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openslp-users



------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Openslp-users mailing list
Openslp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openslp-users

Reply via email to