|
The easiest way is probably to let the button draw itself then draw over the top of it - so, call DefWindowProc at the start of your owner draw handler then do your own drawing
|
|
|
|
|
Hey guys,
Sorry to be bugging everyone with silly questions, I am just wandering I have a project that I have used VC 6 to create, and I've just recieved a message from a client saying it doesn't work on the 64 bit version of Windows.
Is there a way of getting VC 6 to compile projects that work with 64 bit operating systems or am I stuffed. If not is there an emulator software you can use that will allow 32 bit apps to run on 64 bit systems.
Any help would be greatly appreciated.
All the Best
Danny
|
|
|
|
|
Are they running on the 64-bit Itanium or something? Unfortunately VC6 is unable to produce 64-bit compatible binaries.
If your client is on a pure 64-bit architecture then you may have to compile your project with Visual Studio 2005 or higher which supports both x86-64 and IA-64 depending on the edition.
Another possible solution is to use the free compiler which comes with Microsoft Windows SDK[^] which also supports x86-64 and IA-64. This option may become a problem... especially if your using MFC.
Best Wishes,
-David Delaune
|
|
|
|
|
I think you must first understand why your 32-bit app does not work on 64-bit systems.
And VC 6 does not have 64-bit compilers.
«_Superman_»
|
|
|
|
|
A thought I had after posting the thread. Could it be the target operating system is missing the mfc42.dll? My project does use MFC.
Danny
|
|
|
|
|
Ideally all the dependencies must be part of your application's installation.
But then it shouldn't have worked on the 32-bit system either.
Mfc42.dll is not part of the OS.
It is installed when you install Visual Studio.
«_Superman_»
|
|
|
|
|
|
|
How is that going to help with VC6?
Best Wishes,
-David Delaune
|
|
|
|
|
I saw it afterwards and I thought its not good idea to delete my reply but why 1?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hamid. wrote: I thought its not good idea to delete my reply but why 1?
Hello Hamid,
It wasn't me who down-voted your response. Want me to give 5 to bring it back up?
Best Wishes,
-David Delaune
|
|
|
|
|
No thanks but It was not bad link.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I was actually trying to code to open multiple files with no extensions those were inside a folder. I looked up for methods but I coudn't find. Please help me with this as soon as possible. Can I do so with turbo C++??
|
|
|
|
|
|
I was actually trying to code to open multiple files with no extensions those were inside a folder. I looked up for methods but I coudn't find. Please help me with this as soon as possible. Can I do so with turbo C++??
|
|
|
|
|
I have a problem with a 3 state check box (push style) with new common controls 6.0 vista look, no problem with older common controls. I have created a very simple application of one button if someone needs the code, where I want the check box(which really looks like a push button) to behave as 3 different state, ( ON -I set to a color), (OFF- I set it to another color), (INdeterminate- I want it to be Gray or something), works fine for ON & OFF, but 3rd state, somehow the text seems to get shifted or something on the button, it shows half gray, half red..... Anyone with similar problem...here is the meat of the code...Keep in mind, it works fine if I don't use it as tri-state, or if I don't use common controls 6.0 with the linker.
Thanks
void CColoredButton::OnClicked()
{
if(!m_IsEnabled){
SetCheck(FALSE);
return;
}
if(GetCheck()==2){
ModifyStyle(BS_BITMAP,0);
InvalidateRect(NULL);
}
else{
ModifyStyle(0,BS_BITMAP);
SetColoredCheck(GetCheck(),m_FontSize);
}
WPARAM wParam=MAKEWPARAM(GetDlgCtrlID( ),BN_DOUBLECLICKED);
GetParent()->SendMessage(WM_COMMAND,wParam ,(LPARAM)m_hWnd);
}
void CColoredButton::SetColoredCheck(int nCheck,int FontSize)
{
COLORREF Color = m_UpColor;
if(nCheck==1)
Color=m_DownColor;
if(nCheck==2)
Color=RGB(255,0,0);
CString Label=GetText(FALSE);
CRect Client;
GetClientRect(Client);
CClientDC dc(this);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
CFont* pFont = GetFont();
CFont MyFont;
m_FontSize=FontSize;
CBitmap* pOldBitmap = dcMem.SelectObject(&m_Bitmap);
CBrush brBackground(Color);
CBrush *OldBrush=dcMem.SelectObject(&brBackground);
dcMem.SetBkColor(Color);
dcMem.FillRect(Client, &brBackground);
if(!m_IsEnabled){
CBrush *PHalfBrush=dcMem.GetHalftoneBrush( );
if(PHalfBrush!=NULL)
dcMem.FillRect(Client, PHalfBrush);
}
CFont *OldFont=dcMem.SelectObject(pFont);
int OldBkMode = dcMem.SetBkMode(TRANSPARENT);
dcMem.DrawText( Label, Client, DT_CENTER | DT_VCENTER |DT_SINGLELINE );
dcMem.SetBkMode(OldBkMode);
dcMem.SelectObject(pOldBitmap);
dcMem.SelectObject(OldFont);
dcMem.SelectObject(OldBrush);
if(FontSize>0)
MyFont.DeleteObject();
dcMem.DeleteDC();
SetBitmap( HBITMAP(m_Bitmap) );
SetWindowText(Label);
SetCheck(nCheck);
}
sft
|
|
|
|
|
Sorry about the long code, In summary, THis is what I want
void CColoredButton::OnClicked() {
if(GetCheck()==2){
ModifyStyle(BS_BITMAP,0);
InvalidateRect(NULL);
}
else{
ModifyStyle(0,BS_BITMAP);
SetColoredCheck(GetCheck(),m_FontSize); }
......
When GetCheck() ==2 for the indeterminate state, it always worked where the button was pretty much disabled or Kindda grayed out, but with the new common controls, its not the case any more, the text somehow gets overlapped and shows 2 different colors... Any idea what the problem might be there, or how I can may be get around this?
sft
|
|
|
|
|
Hello All
I am planning to write an application using VC++ to find the free-meeting rooms in my office. All the meetings rooms are listed in outlook. what i am doing right now is to run thru all the meeting room one by one to find the free one for a perticular time. is there any way i can connect to
MSoutlook calender using VC++ program and search for a free room?
Thank you
|
|
|
|
|
I don't know if this is possible (I guess it is) but if it is possible, it would be done through automation. Google for "outlook automation" and you'll get plenty of examples.
I'm not an expert in automation, so it's the only help I'm able to provide...
|
|
|
|
|
Yes - you need to connect to Outlook through COM (use ProgID "Outlook.Application") and naviagte its object model.
Best way to investigate the Outlook object model is to use Outlook's VBA IDE - use the object browser or something like that.
BTW - it's really a lot easier with VB6 than C++...
|
|
|
|
|
Hi All,
Is there a way of limiting the size of the margins when printing.
At present I can't think of a better way than subclassing the pring dialog box and intercepting text input to the margin size edit boxes.
The reason for this is that our test team have complained that if they put a huge number into the text margin boxes it messes up the appearance of the document and so should be prevented. Can you believe it
Cheers
Tom
Philosophy: The art of never getting beyond the concept of life.
Religion: Morality taking credit for the work of luck.
|
|
|
|
|
I've done a bit of digging, and neither PRINTDLG or PRINTDLGEX have a margins member.
So these margins you are talking about are app dependent, so we'd need to know more about the context.
If this is a custom print box, then start looking at the code there...
Iain.
ps, Good surname...
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hi Iain,
The actual dlg box in question can be seen in IE. If you click on print preview, the window that comes up has a button which fires up a page setup dialog box. It is on this that the margins can be altered. Sorry for the lack of clarity.
ps. Best damn surname there is...
Cheers
Tom
Philosophy: The art of never getting beyond the concept of life.
Religion: Morality taking credit for the work of luck.
|
|
|
|
|
If you are discussing about the page Setup dialog that you use in your own application, i also think so, you may need to subclass the dialog.
First of all, obviously, if the margins are overbound it messes up, that is known to the user, do you need to correct it?
If you want to disable the margin fields, simply use PSD_DISABLEMARGINS flags in [PageSetupDlg Function^].
Or you can validate the margin data entry, by subclassing it. That is setting the hook procedure.
PAGESETUPDLG psd;
ZeroMemory(&psd, sizeof(psd));
psd.lStructSize = sizeof(psd);
psd.hwndOwner =
....
psd.Flags = PSD_INTHOUSANDTHSOFINCHES | PSD_MARGINS |
<code>PSD_ENABLEPAGESETUPHOOK</code>;
psd.lpfnPageSetupHook = (LPPAGESETUPHOOK)PageSetupHook;
if (PageSetupDlg(&psd)==TRUE) {
And in the hook procedure you can validate the text entry,
BOOL CALLBACK PageSetupHook(HWND hwndDlg, UINT uMsg, WPARAM wParam,
LPARAM lParam)
{
switch (uMsg)
{
case WM_INITDIALOG:
return (INT_PTR)TRUE;
case WM_COMMAND:
if ((LOWORD(wParam) == 1155
&& HIWORD(wParam) == EN_CHANGE)
{
You can completely customise the page setup dialog with your own dialog by create a dialog template resource by modifying the default template available in VC\PlatformSDK\Include\PrnSetup.Dlg by specifying the flags,
psd.Flags = PSD_INTHOUSANDTHSOFINCHES | PSD_MARGINS |
PSD_ENABLEPAGESETUPHOOK | <code>PSD_ENABLEPAGESETUPTEMPLATE</code>;
....
psd.lpPageSetupTemplateName = MAKEINTRESOURCE(IDD_PAGESETUP);
psd.lpfnPageSetupHook = (LPPAGESETUPHOOK)PageSetupHook;
psd.hInstance = hInstance;
see also [Customizing the Page Setup Dialog Box^]
|
|
|
|
|
Thank you so much Rajkumar,
First of all, to respond to your comment:
"First of all, obviously, if the margins are overbound it messes up, that is known to the user, do you need to correct it?"
I couldn't agree more. It's another completely ridiculous example user madness. Unfortunately, my inclination to tell the user not to set stupid values has been overruled in this case, so here I am.
My position is that the page setup dialog box is launched from IE. Therefore, I can either subclass IE's window or I can create my own one and replace the existing dialog box.
Is there any way of applying the approach you showed me to an existing Page Setup dialog box owned by IE. I’m working from an ActiveX control running in IE?
Many thanks
Cheers
Tom
Philosophy: The art of never getting beyond the concept of life.
Religion: Morality taking credit for the work of luck.
modified on Friday, January 16, 2009 5:33 AM
|
|
|
|