Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: VC7 compile/build problems (was DNSServiceQueryRecord)



Hey there Eric.

Try doing this:

void DNSSD_API reply_callback(
         DNSServiceRef sdref,
	DNSServiceFlags flags,
	DNSServiceErrorType error,
	const char* name,
	const char* regtype,
	const char* domain,
	void* context)
{
....
}


Your project has a default calling convention of __cdecl. The APIs you're calling have a calling convention of __stdcall. That's why the compiler was complaining. The change above should do the trick.


Take care,

Scott

On Jul 24, 2004, at 10:16 PM, Eric Wing wrote:

So is there a better way to avoid these compile/build
problems without modifying the dnssd.h header? Perhaps
there's a different way to write function pointer code
than what I'm doing? My stuff is pretty boring though:

void reply_callback(
	DNSServiceRef sdref,
	DNSServiceFlags flags,
	DNSServiceErrorType error,
	const char* name,
	const char* regtype,
	const char* domain,
	void* context)
{
	fprintf(stderr, "In RegisterReply callback: flags=%d,
error=%d\n\tname=%s\n\tregtype=%s\n\tdomain=%s\n",
flags, error, name, regtype, domain);
}

dns_error = DNSServiceRegister(
			&service_ref,
			0,  						  * if there is a conflict */
			0,
			"Mytalk",
			"_http._tcp.",
			NULL,
			NULL,
			chosen_port,
			0,
			NULL,
			reply_callback,
			NULL
		);

If not, I would be happy to send my modified header
file for inclusion into the standard code base if the
changes are deemed correct.

I'm using Visual Studio .NET 2003. I'm using the
Rendezvous SDK technology preview. (I didn't build
this myself.) The dnssd.h header version is 1.22 which
seems .01 less than my CVS version (which talks about
FreeBSD fixes), so I'm expecting (hoping) my stuff to
be current enough without me having to build it.

Thanks,
Eric
_______________________________________________
rendezvous mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/rendezvous
Do not post admin requests to the list. They will be ignored.
_______________________________________________
rendezvous mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/rendezvous
Do not post admin requests to the list. They will be ignored.


References: 
 >VC7 compile/build problems (was DNSServiceQueryRecord) (From: Eric Wing <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.