|
Just so anyone doesn't think I've posted a Yes or No question: How can I get around this?
|
|
|
|
|
http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvc/thread/6d37e2d1-7491-450f-a341-a81e7892dce1/
Found it!
|
|
|
|
|
Glad you've found the solution. My answer was going to be "spend money"!
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
I would be very grateful for any constructive comments to the snippet of code below:
time_t lTime
struct tm *tm
time(&lTime)
tm = localtime(&lTime)
It is found that tm->tm_hour agrees with my PC time except between the following dates when it is 1 hour behind:
8 Mar, 2009 2:00 am
15 Mar, 2009 2:00 am
I believe the issue is in TZSET.c and only manifests itself when the day of the 1st of the month of DST is a Sunday (like 2009).
I am using VS6 and have applied KB932509 with no results
Thanks
Peter
|
|
|
|
|
Member 3848094 wrote: KB932509
I can't get this on MS site? what is the KB about.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Sorry, my mistake
KB932590
Thanks
|
|
|
|
|
well, did you check your file version against what is listed on that KB?
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Yes.
Do you believe that this download should have fixed the issue?
|
|
|
|
|
I don't know. What else do you think it would do then?
Another thing you can check is, run dependency walker (or whatever it is called) and check the dll version you application using. I doubt this will turn anything, but you got nothing to loose.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Hello Peter
I am supporting some VC 6.0 code with localtime and am facing similiar results. I downloaded MSVCRT.DLL version 7.0.2600.3085 and it did not fix the problem.
Setting my time a week ahead fixes the problem.
Even stranger on several of my colleagues systems some VC6.0 applications work correctly and some don't (all call a shared DLL used internally calling localtime).
Very annoying but not a major issue for us as the application is currently only being used interanlly and we can live a week with it.
First Sunday of the month of DST sounds like an old problem resurfacing:
http://seclists.org/bugtraq/2001/Mar/0475.html
Good Luck
Don
|
|
|
|
|
Hi,
I'm looking for some inbuilt function that can provide me to get the Root Directory and the path of the Virtual directory - "Default Web site properties" contents. I have to fetch the Home Directory - Local Path.
Does ISAPI filter provide any help?
Regards,
Mayur M
|
|
|
|
|
what the each and every function in the code below is doing?
I need crystal clear answer for this.
POSITION pos=GetFirstDocTemplatePosition();
if(pos!=NULL)
{
CSingleDocTemplate * pSingeDocTemplate;
pSingeDocTemplate= (CSingleDocTemplate *)GetNextDocTemplate(pos);
pSingeDocTemplate->GetFirstDocPosition();
CDocViewCommunicationDoc *pDoc=(CDocViewCommunicationDoc *)pSingeDocTemplate->GetNextDoc(pos);
AfxMessageBox (pDoc->m_strDoc);
|
|
|
|
|
sarathbabununna wrote: POSITION pos=GetFirstDocTemplatePosition();
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
In addition to David's reply (which is good - read the documentation for the functions!), you should also look at the documentation page for CDocTemplate.
Your application could handle different kinds of document - for example .bmp, and .jpg. So each document type would have its own CDocument (ie, CMyJpgDocument), and its own CView class (ie, CMyBmpView). This information is called a template, and stored in a CMultiDocTemplate, or CSingleDocTemplate. Each of these is stored in the App object.
So your code is going through all templates, then iterating through all documents created from each template.
You have missed off a few brackets I think!
Try single stepping through the code, and reading the document pages for more information. It is all there.
Iain.
ps, I've never created an app with more than one kind of template, but the possibility exists!
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
I have written a simple application that has a horizontal scroll bar and an input field of type
CEdit. Here is the class definition for the main window.
class CMainWindow : public CFrameWnd {<br />
<br />
<br />
public:<br />
CMainWindow();<br />
<br />
protected:<br />
afx_msg int OnCreate( LPCREATESTRUCT );<br />
afx_msg void OnSize( UINT nType, int cx, int cy );<br />
<br />
afx_msg void OnPaint();<br />
afx_msg void OnHScroll( UINT nCode, UINT nPos, CScrollBar *pScrollBar );<br />
<br />
DECLARE_MESSAGE_MAP()<br />
<br />
private:<br />
<br />
int charWidth;<br />
<br />
int m_nPageWidth;<br />
int m_HorzScrollPos;<br />
<br />
CEdit input1;<br />
<br />
};
Here is the code that I use to create the window:
<br />
int<br />
CMainWindow::OnCreate( LPCREATESTRUCT lpcs )<br />
{<br />
if ( CFrameWnd::OnCreate( lpcs ) == -1 )<br />
return -1;<br />
<br />
<br />
TEXTMETRIC tm;<br />
CClientDC dc(this);<br />
dc.GetTextMetrics( &tm );<br />
<br />
charWidth = tm.tmAveCharWidth;<br />
<br />
input1.CreateEx( WS_EX_CLIENTEDGE, TEXT("edit"), NULL,<br />
WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL,<br />
150, 125, 60, 20,<br />
m_hWnd, (HMENU)500, NULL );<br />
return 0;<br />
}
Here is the code I use to paint the window:
void<br />
CMainWindow::OnPaint()<br />
{<br />
CPaintDC dc(this);<br />
dc.SetWindowOrg( m_HorzScrollPos, 0 );<br />
dc.TextOut( 150, 100,<br />
TEXT( "This is a very long string which I hope will take up most of the line" ), 69 );<br />
}
The code, mostly, works. However, I do have one issue. If I run the program and using the mouse I make the window small (in the horizontal direction) a horizontal scroll bar shows up. This is to be expected. I then use the mouse to move the scroll bar to the middle of the window. Now, I minimize the window and then maximize the window. After doing this, I would expect the text and the input field (of type CEdit) to be drawn aligned on the screen. However, this is not the case. The text is shifted to the right (at least relative to the input field). I do not understand why and I am hoping somebody here can tell me what I am missing.
Thanks
Bob
|
|
|
|
|
Hi,
I have created splitter window ,one of the window is of type CFrameWnd which
creates a CHtmlView in it ,so the problem is that whenever Navigate2() (or
Navigate()) is called in OnInitialUpdate() the page is displayed ,but if I
call it in any other function (created by me) and which is called from
CFrameWnd window it does not display anything although OnDocumentComplete()
gets called but nothing is displayed.
here is the code:
To Create the view inside CFrameWnd where CBrowserView is CHtmlView derived
class.
BOOL CBrowserFrame::OnCreateClient(LPCREATESTRUCT lpcs,CCreateContext*
pContext)
{
CCreateContext context;
pContext = &context;
pContext->m_pNewViewClass = RUNTIME_CLASS(CBrowserView);
pview = (CBrowserView *) CreateView(pContext, AFX_IDW_PANE_FIRST);
((CMainFrame*)GetParentFrame())->pBView=pview;
if (pview ==NULL)
return FALSE;
pview->Test();
pview->SendMessage(WM_INITIALUPDATE);
SetActiveView(pview, FALSE);
return CFrameWnd::OnCreateClient(lpcs,pContext);
}
In the CBrowserView:
void CBrowserView::OnInitialUpdate()
{
Navigate2("http://localhost");
CHtmlView::OnInitialUpdate();
}
void CBrowserView::OnDocumentComplete(LPCTSTR lpszURL)
{
MessageBox("OnDocumentComplete()");
CHtmlView::OnDocumentComplete(lpszURL);
}
void CBrowserView::Test()
{
Navigate("http://www.google.com");
} And I also want to draw something in this view is it possible using
CClientDC as I am not able to draw anything , and it seems as if the OnDraw()
function of a CHtmlView never gets called?
Please help me.
modified on Monday, March 9, 2009 11:38 PM
|
|
|
|
|
Hi,
I recently got a answer to a question regarding a CwinThread question
I was pointed to a article on the code project
the following is the URL wwww.codeproject.com/KB/threads/extended_thread_aspx
my question is regarding the following snipet of code from the Article
CThreadEx::CThreadEx (AFX_THREADPROC pfnThreadProc) : CWinThread (pfnThreadProc, NULL) {
m_bAutoDelete = FALSE;
// Undocumented variable. Need to set the thread parameters variable to this
m_pThreadParams = this;
}
The author uses a inilizer list to pass paramters to the base Class'es contructer I have no problem
With this
My problem is the next line of code m_pThreadParam = this
The author points out that this contructer isn't the one documented AFXWIN.H
However I found a more complete discription of the CWinthread in the following PPT
presentation below is the URL
ttp://74.125.47.132/search?q=cache:azRHOpLik8MJ:www.ecs.syr.edu/faculty/fawcett/handouts/cse778/Lecture7/Additional%2520Thread%2520Info/threads.ppt+MORE+ON+THREADS+BUKIN&hl=en&ct=clnk&cd=1&gl=us
Anyway on page 5 of the PPT presentation is a more complete descrption of the CWinThread
Class
and m_pThreadParams seems to be a private member of the base Class CWinThread Class
I haven't build the code in the article but I am wondering if it would work
|
|
|
|
|
The first URL you mentioned, I believe is wrong. That is, it starts off with 4 W's. However, even after deleting the extra "W", I could not get there. Are you sure you have the right URL?
Bob
|
|
|
|
|
BobInNJ wrote: Are you sure you have the right URL?
Did you not notice the mising extension:
http://www.codeproject.com/KB/threads/extended_thread.aspx[^]
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Sorry you are right
the second one the titled more on threads by Konstatin page 5 has a detailed listing CthredWin
private:
LPVOID m_pThreadParams; <--- is a private data member //generic parameters passed to starting function
AFX_THREADPROC m_pfnThreadProc; ,
HANDLE m_hThread;
Just cut and paste the link below
http://74.125.47.132/search?q=cache:azRHOpLik8MJ:www.ecs.syr.edu/faculty/fawcett/handouts/cse778/Lecture7/Additional%2520Thread%2520Info/threads.ppt+MORE+ON+THREADS+BUKIN&hl=en&ct=clnk&cd=1&gl=us
|
|
|
|
|
http://www.codeproject.com/KB/threads/extended_thread.aspx
Sorry this the First Link
Page 5 from the PPT presentation
CWinThread
class CWinThread : public CCmdTarget {
public:
CWinThread();
CWinThread(AFX_THREADPROC pfnThreadProc, LPVOID pParam);
BOOL CreateThread(DWORD dwCreateFlags = 0, UINT nStackSize = 0,
LPSECURITY_ATTRIBUTES lpSecurityAttrs = NULL);
virtual BOOL InitInstance();
virtual int Run();
virtual BOOL PreTranslateMessage(MSG* pMsg);
virtual BOOL PumpMessage(); // low level message pump
virtual BOOL OnIdle(LONG lCount); //return TRUE if more idle processing
virtual BOOL IsIdleMessage(MSG* pMsg); //checks for special messages
private:
LPVOID m_pThreadParams; <--- is a private data member
AFX_THREADPROC m_pfnThreadProc;
HANDLE m_hThread; // this thread's HANDLE
} Back to AfxBeginThread()
|
|
|
|
|
I use these two functions that I have copied from codeproject to use transparent static text and background in my application. But everytime I put a command button in my application the application seems to run for milliseconds and vanishes without me closing out. I am a beginner and any suggestion would be great thank you.
HBRUSH CTrialDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr;
if( nCtlColor == CTLCOLOR_STATIC )
{
pDC->SetBkMode(TRANSPARENT);
//pDC->SetTextColor(RGB(255, 0, 0));
hbr = (HBRUSH)GetStockObject( NULL_BRUSH );
}
else
{
hbr = CTrialDlg::OnCtlColor(pDC, pWnd, nCtlColor);
}
return hbr;
}
BOOL CTrialDlg::OnEraseBkgnd(CDC* pDC)
{
CBitmap m_bitmap;
BOOL rVal = FALSE; //CWizardPage_Base::OnEraseBkgnd(pDC);
if( m_bitmap.LoadBitmap( IDB_Background ) )
{
CRect rect;
GetClientRect( &rect );
CDC dc;
dc.CreateCompatibleDC( pDC );
CBitmap* pOldBitmap = dc.SelectObject( &m_bitmap );
pDC->BitBlt( 0, 0, rect.Width(), rect.Height(), &dc, 0, 0, SRCCOPY);
dc.SelectObject(pOldBitmap);
rVal = TRUE;
}
return rVal;
}
|
|
|
|
|
Astitva23 wrote:
else
{
hbr = CTrialDlg::OnCtlColor(pDC, pWnd, nCtlColor);
}
Shouldn't that be CDialog::?
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Yeah It should have been CDialog. Thanks for that.
But I have got another problem now. I am using arrays to display text through my static text and everytime I am displaying the next question, the text is overlayered above the previous one. Is there any function to flush the text...
thank you..
snippet of my code for displaying static text from array:
m_QUESTIONS.SetWindowText(Questions[counter]);
m_cAnswer1.SetWindowText(Answers[counter][0]);
m_cAnswer2.SetWindowText(Answers[counter][1]);
m_cAnswer3.SetWindowText(Answers[counter][2]);
m_cAnswer4.SetWindowText(Answers[counter][3]);
|
|
|
|
|
Astitva23 wrote: function to flush the text
Don't get your question fully. May be you are looking for a "setWindowText("")"? Guess
not. Ok dinner time. May be back in 30 mins.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|