Raveesh Kumar B
unread,Jun 22, 2009, 9:57:51 AM6/22/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ws4d-gs...@googlegroups.com, ravees...@gmail.com
Hi,
I am developing WSD Printer Client using WS4D-gSOAP stack(I am using the latest trunk sources) on Windows platform using Visual Studio 2008.
I have developed the Client based on Air Conditioner example given as sample program in the tool kit.
The code compiles and runs fine as expected in with the default VC options generated by Cmake and compiled as C Code.(i.e "Project->Properties->Configuration Properties->C/C++->Advanced->Compile As->Compile as C code(/TC)") .
As I am planning to extend my Printer client APIs with C++, I had to change the "Project settings" to "Compile as C++ code" option.
(i.e "Project->Properties->Configuration Properties->C/C++->Advanced->Compile As->Compile as C++ code(/TP)") ). But with this,
program compiles but crashes at runtime at the following statement.
XAddrs = (char *) dpws_resolve_addr(&dpws, &device, NULL, 10000);
Following is the call stack at the time of crash
wsd-client.exe!soap_serialize_string(soap * soap=0x00e610b8, char * const * a=0x00000123) Line 12240 + 0x5 bytes C
wsd-client.exe!soap_serialize_wsa__Relationship(soap * soap=0x00e610b8, const wsa__Relationship * a=0x00000123) Line 8758 + 0xd bytes C
wsd-client.exe!soap_serialize_PointerTo_wsa__RelatesTo(soap * soap=0x00e610b8, wsa__Relationship * const * a=0x00290004) Line 10753 + 0xf bytes C
wsd-client.exe!soap_serialize_SOAP_ENV__Header(soap * soap=0x00e610b8, const SOAP_ENV__Header * a=0x00290000) Line 4249 + 0x10 bytes C
wsd-client.exe!soap_serializeheader(soap * soap=0x00e610b8) Line 27 + 0x13 bytes C
wsd-client.exe!soap_send___wsd__Resolve(soap * soap=0x00e610b8, const char * soap_endpoint=0x004f40d0, const char * soap_action=0x004f26f4, wsd__ResolveType * wsd__Resolve=0x00e60fe0) Line 243 + 0x9 bytes C
wsd-client.exe!wsd_resolve_async(soap * soap=0x00e610b8, const char * MsgId=0x0029a250, const char * Address=0x0029a3d8, unsigned long timeout=10000, ws4d_alloc_list_s * alist=0x00e610a8) Line 1675 + 0x14 bytes C
wsd-client.exe!ws4d_discoveryctx_resolve(dpws_probectx * ctx=0x00e6108c, unsigned long timeout=10000) Line 233 + 0x24 bytes C
wsd-client.exe!dpws_resolve_addr(dpws_s * dpws=0x00e8fdf8, ws4d_epr * epr=0x00e8fecc, ws4d_tc_int * tc=0x00298e48, unsigned long timeout=10000) Line 1585 + 0x10 bytes C
Following is the function in dpwsC.c, where the crash occurs.
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_string(struct soap *soap, char *const*a)
{
soap_reference(soap, *a, SOAP_TYPE_string);
}
In case of C code, the pointer "a" is NULL.
In case of C++ code, the pointer "a" is filled with some junk address. So, the program crashes saying Access violation reading location <junk address>, as it is trying deference pointer "a" in soap_reference()
Could you please guide me in knowing, what is wrong here or what are the things I need to take care when developing WSD Printer Client in C++?.
Thanks
Raveesh