|
T.RATHA KRISHNAN wrote: How do I resolve this error?
Did you try here?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I want to create a sidebar for windows xp using vc++. Sidebar is similar to vista sidebar.
I tried google to get idea, but everybody giving details about gadgets not side bar.
Anybody have any details about how to create a sidebar ?
|
|
|
|
|
|
|
Hi all,
i have written a code to download a webpage using WinInet api's. My code is as follows
InternetCanonicalizeUrl(site,sCompareURL.GetBufferSetLength(MAX_BUFFER_SIZE),&dwLen,ICU_BROWSER_MODE);
HINTERNET Ihandle = InternetOpen("Internet Explorer6.0.2900.2180", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, NULL);
HINTERNET hFile = InternetOpenUrl(Ihandle,site,NULL,0,0,0);
BOOL bRet = InternetReadFile(hFile, szBuffer, MAX_BUFFER_SIZE, &nSize);
if(!bRet || nSize <= 0)
break;
szBuffer[nSize] = '\0';
m_sHtml += szBuffer;
This code is working fine, but i want to implement time out in this, i.e i the specified page is not download in specified time then time out shold be displayed. How can i implement this?
Thanks in advance
|
|
|
|
|
You may try to set an option via InternetSetOption[^]
(the INTERNET_OPTION_RECEIVE_TIMEOUT flag looks promising, but I never made a test).
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I know that if use the SMTP protocol, I should use the socket to create link with server.
And then
HELO SERVER
USER
PASS
but if I donot use the socket and I want to achieve the SMTP protocol , how should I do ?
Can someone give me suggestion?
|
|
|
|
|
Translate in to metaphor:
I know that to send a mail I have to plug to the network and then send it.
But if I don't use any network and I want to achieve the sending on the mail how should I do?
Frankly ... Or you use an SMTP service library (that use the socket internally, so it is not proper to say you're "not using socket") or ... try concentrate a lot, may be telepathy will work!
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Pigeons are quite effective.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I'll try an answer: Write a socket client that implements at least RFC 5321 and RFC 4954, both protocols are typically needed to be able to send emails.
Alternatively use a networking library that offers an SMTP client/example (e.g. libcurl, PichatCore, QT), the code to send an email could look like this:
CClientSmtp client;
client.SetRequestServer("mail.example.com", 25, "example.com");
client.SetRequestEnvelope("sender@example.com", "receipient@example.com");
client.SetRequestData("Subject:Test email\n\nHi! I am hungry, please send some pizza.");
client.Request();
You need to decide if you want to implement everything yourself or take an existing C++ library. First will teach you a lot about networking protocols, later gives you the result right away. Hope this helps!
/M
|
|
|
|
|
Hi,
If I have today date. How can I get date before 7 or 10 days?
My means to say Using number of days, how to calculate preoius date from the current date?
|
|
|
|
|
Take a look at the documentation of COleDateTime and COleDateTimeSpan.
|
|
|
|
|
what is the format of time you are having? If in MFC its easy to use CTime and CTimeSpan classes.
psuedo code:
CTime curTime(...);
CTimeSpan span(7, 0,...);
Ctime newTime = curTime - span;
|
|
|
|
|
Plz tell me how to do that?
If I want to get date before 7 days from current date?
How to do that?
|
|
|
|
|
Wow, you really need glasses because he even provided a code snippet showing exactly how to do it...
|
|
|
|
|
Bijo Pulikkottil wrote: If I have today date.
Based on what? Is it a CTime object? Is it a time_t variable? If you have the number of seconds since some epoch, can't you just subtract 86400 * 7 seconds?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi all,
i m using to Excel automation to read and write excel files.
i write excel file like this.
CoInitialize(NULL);
{
Excel::_ApplicationPtr XL;
HRESULT hr;
try
{
XL.CreateInstance(L"Excel.Application");
_variant_t var((long)DISP_E_PARAMNOTFOUND,VT_ERROR);
XL->Workbooks->Add(Excel::xlWorksheet);
Excel::_WorksheetPtr pSheet = XL->ActiveSheet;
Excel::RangePtr pRange = pSheet->Cells;
Excel::RangePtr pBeginRange = pRange->Item[1][1];
Excel::RangePtr pEndRange = pRange->Item[1][1];
Excel::RangePtr pTotalRange = pSheet->Range[(Excel::Range*)pBeginRange][(Excel::Range*)pEndRange];
wchar_t wsz1[] = L"C";
wchar_t wsz2[] = L"D";
BSTR bstr1;
bstr1 = SysAllocString(wsz1);
BSTR bstr2;
bstr2 = SysAllocString(wsz2);
SAFEARRAYBOUND rgsabound[2] = { 0 };
rgsabound[0].cElements = 1;
rgsabound[0].lLbound = 0;
rgsabound[1].cElements = 1;
rgsabound[1].lLbound = 0;
VARIANT arr;
arr.vt = VT_ARRAY | VT_BSTR;
arr.parray = SafeArrayCreate(VT_BSTR,2,rgsabound);
long index[2];
index[0] = 0;
index[1] = 0;
hr = SafeArrayPutElement(arr.parray,index,bstr1);
pTotalRange->PutValue2(&arr);
VariantClear(&arr);
SysFreeString(bstr1);
SysFreeString(bstr2);
XL->Visible = true;
}
catch(_com_error &error)
{
cout << "COM error " << endl;
}
}
CoUninitialize();
when i write excel file i received this error
0x800706F7
"the stub received bad data"
please tell me how can i solve it.
thanks in advance.
|
|
|
|
|
if you have #imported the correct dlls and olbs for the installed version of Excel, everything seems fine.
|
|
|
|
|
This happens when i run application on Office 2010 Beta version.while i run application on office 2007 its working fine.
|
|
|
|
|
Hi sir,
I want to create a DSN Name and set a path for that.
I am using "SQLConfigDataSource" function for this.
It is not giving any error and running properly.But it is not writing to DNS.
Here ia wat i am doing
SQLConfigDataSource(NULL, ODBC_ADD_SYS_DSN, _T("Microsoft Access Driver (*.mdb)\0"), _T("DSN=SAMPLEE\0DBQ=D:\\SAMPLE.mdb\0"));
Am i doing right???or any other stuff need to be done.
Thanks
Raj
|
|
|
|
|
Did you check the return value?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I tried with this
bool aDSNCreated = false;
aDSNCreated = SQLConfigDataSource(NULL, ODBC_ADD_SYS_DSN, _T("Microsoft Access Driver (*.mdb)\0"), _T("DSN=SAMPLEE\0DBQ=D:\\SAMPLE.mdb\0"));
printf("%d",aDSNCreated );
aDSNCreated value is zero.
what i am doing wrong??
Thanks
Raj
|
|
|
|
|
From MSDN[^]:
When SQLConfigDataSource returns FALSE, an associated *pfErrorCode value can be obtained by calling SQLInstallerError. The following table lists the *pfErrorCode values that can be returned by SQLInstallerError and explains each one in the context of this function.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi sir.
CPallini wrote: an associated *pfErrorCode value can be obtained by calling SQLInstallerError
I am not getting how to get the errorcode.I am trying as below
bool aDSNCreated = false;
RETCODE retcode= SQL_SUCCESS;
aDSNCreated = SQLConfigDataSource(NULL, ODBC_ADD_SYS_DSN, _T("Microsoft Access Driver (*.mdb)\0"), _T("DSN=SAMPLEE\0DBQ=D:\\SAMPLE.mdb\0"));
printf("%d",aDSNCreated );
if(aDSNCreated == false)
{
retcode = SQLInstallerError(2, NULL,NULL,100,NULL);
}
I am not getting wat paramaters to send and return the error code..
please help me out.
Sorry i know its a very silly question.
Thanks
Raj
|
|
|
|
|
I would do:
BOOL isDSNCreated;
isDSNCreated = SQLConfigDataSource(NULL, ODBC_ADD_SYS_DSN, _T("Microsoft Access Driver (*.mdb)\0"), _T("DSN=SAMPLEE\0DBQ=D:\\SAMPLE.mdb\0"));
if (isDSNCreated == FALSE)
{
CHAR szError[SQL_MAX_MESSAGE_LENGTH];
DWORD dwError;
WORD cbError;
RETCODE retcode;
retcode = SQLInstallerError(1, &dwError, szError, SQL_MAX_MESSAGE_LENGTH-1, &cbError);
}
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|