|
Can anyone help me with this ? I tried resizing controls like buttons and edit box using the CWnd function SetWindowPos. There this function needs a valid HWND which i found that controls don't have. Anyone have a solution? I would great apprieciate it...
Nyon
|
|
|
|
|
Are you talking about the first parameter of CWnd::SetWindowPos()? You only use that if you are changing the Z-order of the control (in dialogs, Z-order determines the tab order of the dialog's controls). Just pass NULL for that parameter, and be sure to include the SWP_NOZORDER flag to indicate you're not changing the Z-order.
--Mike--
==================
The original message was:
Can anyone help me with this ? I tried resizing controls like buttons and edit box using the CWnd function SetWindowPos. There this function needs a valid HWND which i found that controls don't have. Anyone have a solution? I would great apprieciate it...
Nyon
|
|
|
|
|
No. I know what the first parameter of SetWindowPos() functions do. What I mean was in the SetWindowPos() function, they check if the control that was calling this function a valid window. In fact, they do an assertion check
ASSERT(::IsWindow(m_hWnd));
and i found out that this value is NULL for all controls. Thus I was asking if anyone know a workaround for this or has any solutions. Thanks.
==================
The original message was:
Are you talking about the first parameter of CWnd::SetWindowPos()? You only use that if you are changing the Z-order of the control (in dialogs, Z-order determines the tab order of the dialog's controls). Just pass NULL for that parameter, and be sure to include the SWP_NOZORDER flag to indicate you're not changing the Z-order.
--Mike--
================== The original message was: Can anyone help me with this ? I tried resizing controls like buttons and edit box using the CWnd function SetWindowPos. There this function needs a valid HWND which i found that controls don't have. Anyone have a solution? I would great apprieciate it...
Nyon
|
|
|
|
|
Sorry, I found the solutions for this. Thanks Anyway.
Nyon
==================
The original message was:
No. I know what the first parameter of SetWindowPos() functions do. What I mean was in the SetWindowPos() function, they check if the control that was calling this function a valid window. In fact, they do an assertion check ASSERT(::IsWindow(m_hWnd)); and i found out that this value is NULL for all controls. Thus I was asking if anyone know a workaround for this or has any solutions. Thanks. ================== The original message was: Are you talking about the first parameter of CWnd::SetWindowPos()? You only use that if you are changing the Z-order of the control (in dialogs, Z-order determines the tab order of the dialog's controls). Just pass NULL for that parameter, and be sure to include the SWP_NOZORDER flag to indicate you're not changing the Z-order.
--Mike--
================== The original message was: Can anyone help me with this ? I tried resizing controls like buttons and edit box using the CWnd function SetWindowPos. There this function needs a valid HWND which i found that controls don't have. Anyone have a solution? I would great apprieciate it...
Nyon
|
|
|
|
|
Hello -
I've some problems to create an Enhanced Metafile out of a Aldus Placeable Metafile. The following code works very well for Win98, but, for some reason, in WinNT all "text" output is painted upside-down and backwards. Besides, the bounding rectangles are misaligned.
Does anyone have some tip?
The code is the following:
// Aldus Pleaceable Metafile header
struct APMFILEHEADER
{
DWORD dwKey;
WORD hmf;
SHORT left;
SHORT top;
SHORT right;
SHORT bottom;
WORD inch;
DWORD dwReserved;
WORD checksum;
BYTE data[1];
};
...
// pData is a BYTE* to a memory buffer where the
// source file contents were loaded
const APMFILEHEADER* pApmH = (const APMFILEHEADER*)pData;
METAFILEPICT mfp;
mfp.hMF = NULL;
mfp.xExt = pApmH->right - pApmH->left;
mfp.yExt = pApmH->bottom - pApmH->top;
mfp.mm = MM_HIENGLISH;
// Construct a Enhanced Metafile from the
// Windows Metafile bits, usign the
// Aldus Placeable metrics
HENHMETAFILE hEmf = ::SetWinMetaFileBits(
dwSize - offsetof(APMFILEHEADER,data),
pApmH->data,
NULL,
&mfp );
Thanks in advance.
- Thales
|
|
|
|
|
Hi there,
I do have a problem by making the title of a groupbox to act like a button (also by coloring
it - there is no way to change color by SetFont()). Is there any way to notify an event
as LButtonUp? Do you know any class derivated from CButton which can handle this
problem? Or do you have any other suggestions?
Thank you in advance,
ruedi
|
|
|
|
|
Hi All!
I have a big problem with docking layout. As You know docking controls are docked by the same way (rectangle layout): i.e. VERTICAL docking controls are between HORIZONTAL - see the picture below.
---------
| T |
|-------| T - top
| | | | L - left
|L| |R| R - right
| | | | B - bottom
|-------|
| B |
---------
I have just one question to You...
Is there the way to modify rectangle layouts to HORIZONTAL docking controls are between VERTICAL (see the picture below)?
---------
| | T | |
| |---| | T - top
|L| |R| L - left
| | | | R - right
| |---| | B - bottom
| | B | |
---------
I'll be pleased for any idea
Beast regards,
Yuri.
|
|
|
|
|
Take a look here:
http://ftp.datamekanix.com/sizecbar/faq.html#dockbarlayout
==================
The original message was:
Hi All!
I have a big problem with docking layout. As You know docking controls are docked by the same way (rectangle layout): i.e. VERTICAL docking controls are between HORIZONTAL - see the picture below. --------- | T | |-------| T - top | | | | L - left |L| |R| R - right | | | | B - bottom |-------| | B | --------- I have just one question to You... Is there the way to modify rectangle layouts to HORIZONTAL docking controls are between VERTICAL (see the picture below)? --------- | | T | | | |---| | T - top |L| |R| L - left | | | | R - right | |---| | B - bottom | | B | | ---------
I'll be pleased for any idea
Beast regards, Yuri.
|
|
|
|
|
Hello,
how can I translate VBA-constructs like
Array(Array(1, 2), Array(2, 2), Array(3, 1))
to Visual C++?
This is important to use the Excel-method "Workbooks.OpenText(..., FieldInfo, ...).
Who can help?
Thanks
Andreas Jäger
PMC
|
|
|
|
|
Hi Andreas!
You must use SAFEARRAYs. You can create a SAFEARRAY where each element is another SAFEARRAY and in this second array each element is integer.
Regards,
Alex Gorev,
Dundas Software.
==================
The original message was:
Hello,
how can I translate VBA-constructs like Array(Array(1, 2), Array(2, 2), Array(3, 1)) to Visual C++? This is important to use the Excel-method "Workbooks.OpenText(..., FieldInfo, ...). Who can help?
Thanks Andreas Jäger PMC
|
|
|
|
|
Hi everybody,
i have a dialog with a treectrl and several other controls like combo and listboxes,
and i want that if you doubleclick a treenode/item that his related control in the
dialog gets the focus. The treenode stores a pointer to his related control.
I tried pControl->SetFocus() in the OnDblClk handler but it doesn't work.
Need help.
TIA, Chris
|
|
|
|
|
Hi Chris,
Its' not clear to understand your need. What I guess was you want to set a focus to
child control. Get a window handle of that control using pControl->GetSafeHwnd()
which will return HWND, Using this handle get a pointer ot that window using
FromHandle(). Use this returned pointer to set the focus of that window. This should
work. If not, feel free to mail me.
==================
The original message was:
Hi everybody, i have a dialog with a treectrl and several other controls like combo and listboxes, and i want that if you doubleclick a treenode/item that his related control in the dialog gets the focus. The treenode stores a pointer to his related control. I tried pControl->SetFocus() in the OnDblClk handler but it doesn't work.
Need help.
TIA, Chris
|
|
|
|
|
If anyone knows how would one write a program in visual c++ that changed the sound output of the microphone ... to create effects like changing your voice thru the speakers ?
|
|
|
|
|
The MSDN code example "DCOM" states that it only works when both machines are running NT. Why will it not work if both machines are running Win9x?
|
|
|
|
|
Hi!
The problem is that Windows NT version 4.0 supports DCOM by default,
but Windows 95 does not. To make it work on W95 you have to download
DCOM95.EXE and DCM95CFG.EXE available from Microsoft Web Site at:
http://www.microsoft.com/oledev
Read more about it in MSDN "HOWTO: Use Win95 as a DCOM Server".
Regards,
Alex Gorev,
Dundas Software.
==================
The original message was:
The MSDN code example "DCOM" states that it only works when both machines are running NT. Why will it not work if both machines are running Win9x?
|
|
|
|
|
Hi,
Does anyone know how to hide a dialog based app. when it's started. I've tried to ShowWindow(SW_HIDE) in OnInitDlg(), but it doesn't work. Is there a way to hide the dialog? Would overloading the DoModal() be a solution? Or is there an easier way?
Thanks in advance!
Christian
|
|
|
|
|
In the initinstance of the app it should be calling DoModal, you can just comment that out.
C. Zieler
==================
The original message was:
Hi,
Does anyone know how to hide a dialog based app. when it's started. I've tried to ShowWindow(SW_HIDE) in OnInitDlg(), but it doesn't work. Is there a way to hide the dialog? Would overloading the DoModal() be a solution? Or is there an easier way?
Thanks in advance!
Christian
|
|
|
|
|
I have created a modeless sheet and controls at run time. I have created controls with WS_TABSTOP as options.
But I dont see tab working. I get beep sound when I press tab. Can anyone guide me???????
Bhaskar
|
|
|
|
|
I have a view with complex dawing that takes a while. When I resize the window, Windows tries to draw, draw, draw, and it makes the whole sizing thing really hateful, even on a fast machine. What I absolutely cannot figure out, is how to turn off updating until the window resizing is *finished*. I can find no message for "user released the mouse, resizing is done". It seems like this ought to be straightforward, but this is Windows, right? Anyone know how to do this?
|
|
|
|
|
LockWindowUpdate( ) doesn't allow the window to be moved, but I don't know if that automatically means the window also cannot be sized.
|
|
|
|
|
Modify the window's class not to have the CS_HREDRAW and CS_VREDRAW styles set.
|
|
|
|
|
This doesn't do anything. I assume you mean to set these in the AfxRegisterWndClass() command. I tried doing that in both the CView class and the CMDIChildWnd class. Neither place did I notice any effect. The IOnSize message gets called anyway every time the frame window size changes a little bit.
Is there another place to set these flags to get the desired effect?
Mike Newberry
==================
The original message was:
Modify the window's class not to have the CS_HREDRAW and CS_VREDRAW styles set.
|
|
|
|
|
I was wondering if somebody can explain why the following doesn't work:
class base
{
public:
virtual void fn(int nData) ( /* Do Something */ };
virtual void fn(char * pszData) { /* Do Something */ };
}
class derived : public base
{
public:
virtual void fn(char * pszData) { /* Do Something */ };
}
void MyFunction
{
derived myderived;
int nData = 5;
myderived.fn(nData);
}
The compiler complains about myderived.fn(nData). It says....
"error C2664: 'fn' : cannot convert parameter 1 from 'int' to 'char *'. ...."
Why doesn't it just use the base class fn(int nData)????
Am I doing something wrong or is this C++ behaviour?
Thanks in Advance
Chris Mancini
|
|
|
|
|
Polymorphism only kicks in if you are accessing your C++ object through a pointer. This is what you need to do:
{
derived myDerived, *pDerived;
int nData = 5;
pDerived = &myDerived;
pDerived->fn(nData);
}
==================
The original message was:
I was wondering if somebody can explain why the following doesn't work:
class base { public: virtual void fn(int nData) ( /* Do Something */ }; virtual void fn(char * pszData) { /* Do Something */ }; }
class derived : public base { public: virtual void fn(char * pszData) { /* Do Something */ }; }
void MyFunction { derived myderived; int nData = 5;
myderived.fn(nData); }
The compiler complains about myderived.fn(nData). It says.... "error C2664: 'fn' : cannot convert parameter 1 from 'int' to 'char *'. ...."
Why doesn't it just use the base class fn(int nData)???? Am I doing something wrong or is this C++ behaviour?
Thanks in Advance Chris Mancini
|
|
|
|
|
You have actually overrided the function 'fn' and using it as a overloaded function. Check it out.
Regards,
Prabhat
==================
The original message was:
I was wondering if somebody can explain why the following doesn't work:
class base { public: virtual void fn(int nData) ( /* Do Something */ }; virtual void fn(char * pszData) { /* Do Something */ }; }
class derived : public base { public: virtual void fn(char * pszData) { /* Do Something */ }; }
void MyFunction { derived myderived; int nData = 5;
myderived.fn(nData); }
The compiler complains about myderived.fn(nData). It says.... "error C2664: 'fn' : cannot convert parameter 1 from 'int' to 'char *'. ...."
Why doesn't it just use the base class fn(int nData)???? Am I doing something wrong or is this C++ behaviour?
Thanks in Advance Chris Mancini
|
|
|
|