|
Pure hobby... for now
Cheers!
Marc
|
|
|
|
|
I do both, but I couldn't see doing anything else as a job. I love programming.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I love programming as a hobby, and am currently looking to do it as a job. I have just finished uni see and getting that first job is harder than I thought.....
Alan.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
I've created a resizable MFC dialog and when resizing (WM_SIZING) the contents don't appear in their places at all. In fact, everything becomes a gray resizing rectangle. When the operation is done, the stuff comes up as it should allways be.
Do you know how to make the toys visible all the time?
rechi
|
|
|
|
|
I think, calling the all Child controls Invalidate and Update will do it!
|
|
|
|
|
How can I alter the width of a treelist or treeview control header dynamically on the fly. I tried the following but it doesn't seem to work.
void CAdjustHeaderColumns::AdjustColumnTreeWidth(int mColns, CString mCName, CNewTreeListCtrl &mtree)
{
CRegKey reg;
CString g_registry;
g_registry.Format("%s%s", REG_ROOTDIR, COLDIR);
CNewTreeListCtrl* pTreeHeader = (CNewTreeListCtrl*) mtree.GetDlgItem(0);
ASSERT(pTreeHeader);
CString mWidth;
CString mDWidth;
LV_COLUMN lvc;
lvc.mask = LVCF_WIDTH;
//Get the Column info and fill the HDITEM structure
HDITEM hdi;
hdi.mask = HDI_WIDTH;
for (int i = 0; i < mColns; i++)
{
pTreeHeader->GetItem(i, &hdi)
m_dwdth.Format("%sHDW%d", mCName, i);
m_wdth.Format("%sHW%d", mCName, i);
if (reg.Open(HKEY_CURRENT_USER, g_registry) == ERROR_SUCCESS)
{
reg.Read(m_dwdth, mDWidth);
reg.Read(m_wdth, mWidth);
}
if (mWidth.IsEmpty() || mWidth == "0")
mWidth = mDWidth;
if (mWidth != mDWidth)
{
TRACE("[%d] is width", atoi(mWidth) );
hdi.cxy = atoi(mWidth);
pTreeHeader->SetItem(i, &hdi);
}
}
}
Thank-you
Sincerely,
RAH
|
|
|
|
|
I'm writing an MDI app and I'm having trouble getting File->New to create _MY_ Doc/View, not the generic blank CDocument/CView. I had this working and somehow I broke it and I'm stumped as to why. I've researched, compared code, etc.
In my InitInstance() I have:
<br />
CMultiDocTemplate *pDocTemplate = new CMultiDocTemplate(<br />
IDR_TEXTTYPE,<br />
RUNTIME_CLASS(MEditDoc),<br />
RUNTIME_CLASS(CMDIChildWnd),<br />
RUNTIME_CLASS(MEditView)<br />
);<br />
AddDocTemplate(pDocTemplate);<br />
<br />
MMainFrame *pMainFrame = new MMainFrame;<br />
if (!pMainFrame->LoadFrame(IDR_MAINFRAME)) return(FALSE);<br />
<br />
m_pMainWnd = pMainFrame;<br />
<br />
pMainFrame->ShowWindow(m_nCmdShow);<br />
pMainFrame->UpdateWindow();<br />
I have the ID_FILE_NEW message handled by my MMainFrame class. I also tried having it handled by my MApp class, but no change. The handler looks like:
<br />
void MMainFrame::OnFileNew() {<br />
CMDIChildWnd *pChildFrame = new CMDIChildWnd;<br />
<br />
LPCTSTR lpszEditClass = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW,<br />
LoadCursor(NULL, IDC_ARROW), (HBRUSH)(COLOR_WINDOW+1), NULL);<br />
<br />
pChildFrame->Create(lpszEditClass, _T("Edit"), WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW,<br />
rectDefault, this);<br />
}<br />
Any ideas?
|
|
|
|
|
I have a project where debugging is checked under Link, I am bulging the debug version, and i'm ising the Microsoft format for debug info. Still, when my program crashes, it doesn't have any symbols, function names or line numbers.
Is there something I can do to fix it?
|
|
|
|
|
Make sure "C++->General->Debug Info:" and
"Link->Debug->Debug Info" also are correct.
/Magnus
|
|
|
|
|
this is a dumb question, but I am lost totally.
I have make a *.chm file using Microsoft HTML Help Workshop, and now I want to display it in my SDI application when user click on menu item Help -> Help Topics... so in my CMainFrame, I add the function:
void CMainFrame::OnHelpTopics()
and in its body, I add
AfxGetApp()->HtmlHelp(NULL, HH_HELP_TOPIC);
But when I tried to compile it, I was told that HtmlHelp is not a function of CWinApp. How come? it's a member function according to MSDN. Did I miss anything?
Anybody please help me!
|
|
|
|
|
Are you using VC6? HtmlHelp isn't available for VC6 from CWinApp.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Ah, yes, I am using VC6. I succeed using WinHelp to display the *.hlp file, but I think the style is not so nice as the *.chm one. Is there any way I can do it? Or I have to switch to VC7?
|
|
|
|
|
You don't have to switch to vc7 - just override WinHelp method in your mainframe class. Here's the piece from old program (written using vc6) using HtmlHelp:
void CMainFrame::WinHelp(DWORD dwData, UINT nCmd)
{
CWinApp* pApp = AfxGetApp();
ASSERT_VALID(pApp);
ASSERT(pApp->m_pszHelpFilePath != NULL);
CWaitCursor wait;
if (IsFrameWnd())
{
CFrameWnd* pFrameWnd = (CFrameWnd*)this;
pFrameWnd->ExitHelpMode();
}
SendMessage(WM_CANCELMODE);
SendMessageToDescendants(WM_CANCELMODE, 0, 0, TRUE, TRUE);
CWnd* pWnd = GetTopLevelParent();
pWnd->SendMessage(WM_CANCELMODE);
pWnd->SendMessageToDescendants(WM_CANCELMODE, 0, 0, TRUE, TRUE);
HWND hWndCapture = ::GetCapture();
if (hWndCapture != NULL)
::SendMessage(hWndCapture, WM_CANCELMODE, 0, 0);
TRACE0("*** HtmlHelp(");
DWORD dwHtmlData = 0;
UINT nHtmlCmd;
switch (nCmd)
{
case HELP_CONTEXT:
TRACE0("Context");
nHtmlCmd = HH_HELP_CONTEXT;
dwHtmlData = dwData;
break;
case HELP_CONTENTS:
TRACE0("TOC");
nHtmlCmd = HH_DISPLAY_TOC;
break;
default:
TRACE0("other");
nHtmlCmd = HH_DISPLAY_TOC;
}
CString strHelpFile = ...;
TRACE("): %s %x %d (wh:%d)\n", strHelpFile, dwHtmlData, nHtmlCmd, nCmd);
if (NULL == ::HtmlHelp(m_hWnd, strHelpFile, nHtmlCmd, dwHtmlData))
{
AfxMessageBox(AFX_IDP_FAILED_TO_LAUNCH_HELP);
}
}
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Thank you for the code, but when I tried to compile, VC6 complains that
HH_HELP_CONTEXT: undeclared identifier
HH_DISPLAY_TOC : undeclared identifier
HtmlHelp : is not a member of '`global namespace''
HtmlHelp : undeclared identifier
should I include any *.h or some library to my project? Thank you a lot in advance!
|
|
|
|
|
You should include htmlhelp.h (best place would be stdafx.h) and link with htmlhelp.lib.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Got it. I have my *chm displayed when F1 is pressed.
One more question. (bear with me please) I have to give the full path of the chm file, even though it is in the same directory of the *exe. is there any way I can bypass this?
|
|
|
|
|
Here is the code I use. It is a subroutine.
static void GetHtmlHelpFileName (HINSTANCE hInstance,
LPTSTR pszHelpFile, int nMaxChar)
{
TCHAR szBuff [_MAX_PATH];
::GetModuleFileName (hInstance, szBuff, _MAX_PATH);
LPTSTR pszExt = _tcsrchr (szBuff, '.');
_ASSERTE (pszExt != NULL);
_ASSERTE (*pszExt == '.');
*pszExt = 0;
_tcscat (pszExt, _T (".chm"));
_tcsncpy (pszHelpFile, szBuff, nMaxChar);
pszHelpFile [nMaxChar - 1] = 0;
return;
}
Given the HINSTANCE (NULL for main image), it will fill the string with a help file name by replacing the extension with ".chm".
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
... and here's mine. Of course, this one uses MFC:
CString CMyApp::GetHtmlHelpFileName()
{
CString strHelpFile = m_pszHelpFilePath;
strHelpFile.Replace(".HLP", ".CHM");
return strHelpFile;
}
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
it works like charm. Thank you so much!
|
|
|
|
|
It could be that complicated. I've been always using:
<br />
WinExec("HH.exe whatever.chm", SW_SHOW);<br />
And that's it...
|
|
|
|
|
It worked well when I execute "HH myhelp.chm" in winDOS environment. But I have to give the full path of the chm file when I coded in program. I cannot use a string variable in the double quotes. If I only put myhelp.chm there, it will tell me that that file cannot be opened, while the return error code is not ERROR_FILE_NOT_FOUND.
Anyway, it turns out that this line of code will do in CMainFrame::OnHelpTopics :
::HtmlHelp(this->m_hWnd, szBuff, 0, HH_DISPLAY_TOPIC);
where szBuff has the file name and its full path name.
|
|
|
|
|
Made a little tray utility, which when double clicked displays
the dialog window. It concludes of three tabs -
history, configure and about.
Well, when the dialog window opens, the history is just plain gray.
when I tab onto the configure and back to the history I can see
its contents.
Tried to change the order of the tabs to:
about, history, configure
same problem apeared - about page is totaly gray. only when I switch
back to it from one of the other tabs, the contents are displayed to me.
some one know what might be the problem ?
do I need some call to a function when showing a dialog brought up
from its tray form ?
I appriciate your help,
thanks in advance.
Kieth
life with out an f is a lie
|
|
|
|
|
How about checking for the restore condition in the size handler and then setting active tab to the one you want? Or maybe just forcing a repaint on restore.
|
|
|
|
|
I've installed the WinXP debug symbols, they work fine with VS.NET but VS 6.0
cannot load the debug symbol. Do you know if there is any incompatibility
or what do I need to do to let VS 6.0 to load the symbols ?
|
|
|
|
|
How do i round a number to the nearest integer?
|
|
|
|
|