|
What type of request do you want to sent to webservice, i mean GET/POST or something else
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
m using the 'Post type.am attaching the code.Please verify.The http is working in same code.Is there any credentials to pass the code?
HTTPMethod = _bstr_t( "POST" );
httpReq->open(HTTPMethod ,"https://gtl-334/XmlTesting/Service.asmx",noAsync,vUser,vPassword);
httpReq->setRequestHeader("Content-Type", "application/soap+xml");
CString szRequest;// = "<strUserName>";
//szRequest += "chaitanya";
//szRequest +="</strUserName>";
szRequest = "<?xml version=\"1.0\" encoding=\"utf-8\"?> \
<soap12:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap12=\"http://www.w3.org/2003/05/soap-envelope\"> \
<soap12:Body>\
<RetrieveKey xmlns=\"http://tempuri.org/\"> \
<serial>1001</serial>\
</RetrieveKey>\
</soap12:Body>\
</soap12:Envelope>";
//szRequest = "Chaitanya";
VARIANT vRequest;
vRequest.vt = VT_BSTR;
vRequest.bstrVal = szRequest.AllocSysString();
httpReq->send(vRequest);
BSTR strText;
_bstr_t bsResponse = httpReq->responseText;
|
|
|
|
|
Hi all,
I want to convert my LPCSTR value to char* how to do so.
Can anybody please help me in this.
Thanks in advance
|
|
|
|
|
LPCSTR is a const char pointer. Why do you want to remove the const ?
When asking a question, please be specific and tell exactly what you are trying to do. So, in which context do you want this conversion ?
|
|
|
|
|
if (and only if) you have this requirement because of a bad designed function prototype (and you cannot change it, e.g. you have a third party DLL), i.e. a function that in fact doesn't change input buffer but accepts char * as argument, then you can simply cast the pointer.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Use const_cast<char*> (variable).
Come online at:-
jubinc@skype
|
|
|
|
|
neha.agarwal27 wrote: I want to convert my LPCSTR value to char* how to do so.
will strcpy help?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Thats wrote: I want to convert my LPCSTR value to char* how to do so.
will strcpy help?
How could he know? Without seeing his problem clearly?
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Offcourse
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
HI...
you using unicode or muli-byte characters??
Best Regards
|
|
|
|
|
If u have compiled your program with UNICODE and _UNICODE defined, then LPTSTR will automatically become LPWSTR (Long pointer to a wide string) u cant assign this to char* but u can assign this to a variable of type wchar_t*.
after using wchar_t* use swprintf() to get proper output.
|
|
|
|
|
Did you read his message ? He was talking about LPCSTR and not LPTSTR.
|
|
|
|
|
Cedric Moonen wrote: LPTSTR.
you forget to bold T i.e. LPTSTR
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ohh sorry then If you use T2A macro, it will work in UNICODE and MBCS.
please go through T2A macro
|
|
|
|
|
Why would it be usefull to use the T2A macro ? A LPCSTR is a const char*.
I think you should read some documentation about the different string types to better understand the different namings.
|
|
|
|
|
correct
then why she wants to do that?
|
|
|
|
|
Probably because the compiler complains about the constness.
|
|
|
|
|
neha
can u mention what exactly u wanna do and where u r facing problem
eplain the scenario
|
|
|
|
|
hi
i need to set transparent color for a perticular color so that when i load bit map the color will be transparent...
i am working with mfc tool bar controls
how to set default transparent color for a perticular color
please let me know
thanks in advance
|
|
|
|
|
What are you doing exactly ? Where are you using that bitmap and how do you 'display' it ?
|
|
|
|
|
thanx for the reply
i have a bit map lets say smily having red color arrond the smily
i wanna put that bit map on the tool bar button
but i dont wanna disply the red color
i know we can make that red color as transparent color so that it wont be displyed ... but how to set red color as transparent color
|
|
|
|
|
|
For button bitmaps in an MFC toolbar, you can use a masked
imagelist to hold the bitmaps.
m_ToolBarImageList.Create(IDB_BITMAP1, 16, 1, RGB(0x00,0xFF,0x00));
...
m_ToolBar.GetToolBarCtrl().SetImageList(&m_ToolBarImageList);
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanx a lot it works fine
|
|
|
|
|
I wrote a class CCamCtrl. I use a Custom message WM_CAPTURE_IMAGE and used message mapping. A dll is to post message. I think dll does not post messsage, sothat OnCaptureData(WPARAM wParam, LPARAM lParam ) event can't be called.
Are there any problem in my code or in dll.
here i mention that dll works well for dialog based application.
Can anyone help me?
Thanks in Advance
Mazhar
header file
class CCamCtrl : public COleControl
{
//some code
///
///
// Message maps
//{{AFX_MSG(CCamCtrl)
afx_msg void OnCaptureData(WPARAM wParam, LPARAM lParam );
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
in cpp i wrote
BEGIN_MESSAGE_MAP(CCamCtrl, COleControl)
//{{AFX_MSG_MAP(CCamCtrl)
ON_MESSAGE(WM_CAPTURE_IMAGE,OnCaptureData)
ON_WM_SHOWWINDOW()
ON_WM_LBUTTONDOWN()
ON_WM_TIMER()
//}}AFX_MSG_MAP
ON_MESSAGE(OCM_COMMAND, OnOcmCommand)
ON_OLEVERB(AFX_IDS_VERB_PROPERTIES, OnProperties)
END_MESSAGE_MAP()
|
|
|
|