|
When i call the CDialog::OnOK(); function I get error :
C:\Documents and Settings\Administrator\Desktop\new_pdf_latest\pdf_latest\itagane_latest\itagane_latest\itagane\CTools\daishi.cpp(116) : error C2039: 'OnOK' : is not a member of 'CDialog'
How can I solve this error?
|
|
|
|
|
One possibility is deriving your dialog from CDialog
The other one is establishing it by yourself
//in header
//{{AFX_MSG(CDaishi)
virtual void OnOK();
//in cpp
void CDaishi::OnOK()
{
//do whatever you need
}
Forget about it. I didn't pay attention, you are not in MFC.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
modified on Wednesday, December 05, 2007 5:45:52 AM
|
|
|
|
|
And how can he derive his CDialog from MFC's CDialog?
I see a little naming conflict...
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.
|
|
|
|
|
I didn't realice...
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
/in header
//{{AFX_MSG(CDaishi)
void OnOK();
//in cpp
void CDaishi::OnOK()
{
//do whatever you need
CDialog::OnOk();
}
Remove the virtual keyword in the header.it will Work
|
|
|
|
|
Something is missing, could you please present the decalaration of your class!
"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
|
|
|
|
|
SOCKET s = socket(AF_INET,SOCK_STREAM,0);
after I successfully connect to server,I use send function to send data.
I use default buffer and i get default value is 8192. and i don't set s to nonblocking. as following is my code fragment:
char buf[100*1024]={0};
memset(buf,0x08,sizeof(buf));
int nRet = send(s,buf,sizeof(buf),0);
but this function successfully complete. according to my understand,this function should in blocking .
cys
|
|
|
|
|
my test environment is in LAN
|
|
|
|
|
Whts the value of iRet??
if it is SOCKET_ERROR find the error by using WSAGetLastError()
or if it equals the byte actual bytes sent then nothing wrong in it.
and as far as ur question goes i guess it is supposed to be blocking call
Thanks,
Sandip.
|
|
|
|
|
nRet 's value equals 102400. this socket is in blocking mode. Because the default buffer size is 8192 bytes, and i send 102400 bytes. Obviously, 102400 is bigger than 8192, so this i/o operation should be blocked, but the actual result is that this i/o operation completes immediately.
P.S. The environment of the test is "LAN".
Thanks
Cys
|
|
|
|
|
It blocks until data is all sent or error occurs.
|
|
|
|
|
VC_FOOD wrote: but this function successfully complete. according to my understand,this function should in blocking .
I didn't understand what are you asking for. 
|
|
|
|
|
this socket is in blocking mode. Because the default buffer size is 8192 bytes, and i send 102400 bytes. Obviously, 102400 is bigger than 8192, so this i/o operation should be blocked, but the actual result is that this i/o operation completes immediately.
P.S. The environment of the test is "LAN".
Thanks
Cys
|
|
|
|
|
This socket is in blocking mode. Because the default buffer size is 8192 bytes, and i send 102400 bytes. Obviously, 102400 is bigger than 8192, so this i/o operation should be blocked, but the actual result is that this i/o operation completes immediately.
P.S. The environment of the test is "LAN".
Thanks
Cys
|
|
|
|
|
The underlying network stack and driver were able to output the data before the return back into user-land, therefore your call completed with all bytes sent.
I've never found any relationship between the default buffer sizes and the amount of data I could send into or receive from the network stack. Just check the return values to see how many of the requested bytes were handled and deal with that situation.
Judy
|
|
|
|
|
Unless your computer is very very very slow I doubt send would ever actually block for a perceptible amount of time. Shouldn't be that hard to push some data from your buffer to the wires, the function doesn't need to wait for anything but your pc and 100KB on a 100Mbit card ... that's easy.
|
|
|
|
|
for example
try {
Bitmap bmp(path);
} catch () {
]
CMainFrame *pMF=(CMainFrame *)AfxGetMainWnd();
TCHAR Path[MAX_PATH];
TCHAR FullPath[MAX_PATH];
BROWSEINFO bi;
::memset(&bi,0,sizeof(bi));
bi.hwndOwner=m_hWnd;
bi.pszDisplayName=Path;
bi.lpszTitle=TEXT("Select a directory");
bi.ulFlags=BIF_DONTGOBELOWDOMAIN|BIF_EDITBOX|BIF_NEWDIALOGSTYLE
|BIF_NONEWFOLDERBUTTON|BIF_RETURNONLYFSDIRS|BIF_STATUSTEXT;
LPCITEMIDLIST pidl=SHBrowseForFolder(&bi);
if(::SHGetPathFromIDList(pidl,FullPath)) {
int len=_tcslen(FullPath);
CString s(FullPath);
s+=TEXT("\\*.jpg");
CFileFind ff;
BOOL b=ff.FindFile(s);
while (b) {
b=ff.FindNextFile();
CString FilePath=ff.GetFilePath();
WCHAR *p=FilePath.AllocSysString();
Gdiplus::Bitmap bmp(p);
Gdiplus::Bitmap *pThmb=(Gdiplus::Bitmap*)bmp.GetThumbnailImage(60,45);
HBITMAP hBmp;
pThmb->GetHBITMAP(Color::Black,&hBmp);
modified on Wednesday, December 05, 2007 4:15:58 AM
|
|
|
|
|
Have you verified value of FilePath is it valid file path??
i guess you also have to do following
CString FilePath=ff.GetFilePath();
FilePath = FilePath + "\\" + ff.GetFileName();
i am not sure about the "\\" it might be already there in GetFilePath.
Thanks,
Sandip.
|
|
|
|
|
Yes, the FilePath can't be wrong.
|
|
|
|
|
You are also not checking it for directory??
|
|
|
|
|
Not yet. But I set a breakpoint there to make sure the path is all right.
|
|
|
|
|
Hi,
am sundar.I have one doubt in vc++.How to connect the https web service in vc++?The webservice was developed in vc++.I have connected http site in vc++ and it was working.When i connect the https site,it displays the error in the screen.
I have done in asp.net.Its working fine.Please let me know what are the procedures to follow to connect the https site in vc++.
Anyhelp would be appreciated.
Regards,
R.Sundar
|
|
|
|
|
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
|
|
|
|