|
Hi,
I have a MDI APP with three dialog that cannot move and that intersect with each other. They must be in a specified z-order. Is it possible to do that? Actually, when I click on one of them, the clicked dialog get focus and become on top of the other two. So I would like my dialog to act so that if I click on one of them, he get focused but dont become on top of the other two.
Thanks!
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Try playing with DeferWindowPos()
~RaGE();
|
|
|
|
|
Does anybody can give me link to the guides/articles/tips of creating owner drawn controls (like ButtonST).
|
|
|
|
|
|
Thanks
|
|
|
|
|
I'm trying to create an MDI app, I want any child windows to be automatically Maximised at all times.
I've overidden the Create function and removed the style WS_SYSMENU and added the style WS_MAXIMIZE. (see bellow)
The window wtill doesn't display maximised though?
What am I missing?
Cheers
BOOL CSegmentationFrame::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CMDIFrameWnd* pParentWnd, CCreateContext* pContext)
{
dwStyle ^= WS_SYSMENU ;
dwStyle |= WS_MAXIMIZE ;
return CMDIChildWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, pContext);
}
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
try moving your functionality into PreCreateWindow.
virtual BOOL CSegmentationFrame::PreCreateWindow( CREATESTRUCT& cs )
{
cs.style ^= WS_SYSMENU;
cs.sytle |= WS_MAXIMIZE;
return CFrameWnd::PreCreateWindow( cs );
}
That may help you out. Is kinda hard to tell w/o seeing more of your source. The style could be getting overriden somewhere else.
Joseph Dempsey
joseph_r_dempsey@yahoo.com
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."
--anonymous
|
|
|
|
|
Cheers, but that doesn't work either.
The only other code I have in the class is the OnCreateClient function. Its displaying a splitter window as bellow:
BOOL CSegmentationFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
CRect cr;
GetClientRect( &cr);
DWORD dwStyle = WS_BORDER | WS_CHILD | WS_VISIBLE;
if ( !m_mainSplitterWnd.CreateStatic( this, 2, 1 ) )
{
MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}
if ( !m_topSplitterWnd.CreateStatic( &m_mainSplitterWnd, 2, 4, dwStyle ,m_mainSplitterWnd.IdFromRowCol(0,0) ) )
{
MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}
if ( !m_botSplitterWnd.CreateStatic( &m_mainSplitterWnd, 1, 2, dwStyle ,m_mainSplitterWnd.IdFromRowCol(1,0) ) )
{
MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}
for (int row = 0; row < 2; row ++)
{
for (int col = 0; col < 4; col ++)
{
if ( !m_topSplitterWnd.CreateView( row, col, RUNTIME_CLASS(CSliceView), CSize(cr.Width()/4, cr.Height()/3), pContext ) )
{
MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}
}
}
if ( !m_botSplitterWnd.CreateView( 0, 0, RUNTIME_CLASS(CSegmentationForm), CSize(cr.Width()/2, cr.Height()/3), pContext ) )
{
MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}
if ( !m_botSplitterWnd.CreateView( 0, 1, RUNTIME_CLASS(CHistogramView), CSize(cr.Width()/2, cr.Height()/3), pContext ) )
{
MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}
return true;
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
It works now if i just use
cs.style = WS_CHILD | WS_VISIBLE | WS_MAXIMIZE;
in PreCreateWidow.
Cheers
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
another solution which works well is the following:
void CChildFrame::ActivateFrame(int nCmdShow)
{
// TODO: Modify this function to change how the frame is activated.
nCmdShow = SW_SHOWMAXIMIZED;
CMDIChildWnd::ActivateFrame(nCmdShow);
}
|
|
|
|
|
Hi
I want to secure the network data wich is send between a client and server. What's the best method to accomplish this? Like encryption algorithm, key exchanging etc.
Thanks!
|
|
|
|
|
_Theo_ wrote:
I want to secure the network data wich is send between a client and server. What's the best method to accomplish this? Like encryption algorithm, key exchanging etc.
I would just go w/ SSL ( TLS now I think ). If you don't want to do it all yourself i think there are some articles here on CP that have pre-written socket classes that support it.
Joseph Dempsey
joseph_r_dempsey@yahoo.com
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."
--anonymous
|
|
|
|
|
I have changed the font of all my property pages. But still the application is showing the default font
I saw in MSDN this :
CPropertySheet now always changes its font to the default font. Even if the font of the property pages is changed in the resource editor, property pages will be displayed at run-time with the system font. If it is necessary to change the font, call SetFont in OnInitDialog and then do an appropriate MoveWindow to resize the sheet and move and resize all controls on the page
But i dont know how to begin with
can someone help
|
|
|
|
|
I have a member function Junk::GetIPAddress() which returns u guessed it an IPAddress, as it can be slow I would prefer to spawn a new thread. Assuming this is the correct approach - unfortunately error C2664 persists.
error C2664: '_beginthread' : cannot convert parameter 1 from 'void (void *)' to 'void (__cdecl *)(void *)'
void GetIPAddress( void *dummy );
void ClassName::OnTimer(UINT nIDEvent)
{
if (nIDEvent == m_PopTimer)
_beginthread( GetIPAddress), 0, NULL);
}
void ClassName::GetIPAddress( void *dummy )
{
m_IPAddress = do_Something(); /* _endthread implied */
}
Any help greatly appreciated - u guys have been a great help
Regards
Bonnie
|
|
|
|
|
normally you cannot put a member function of your class to the _beginthread as a parameter. It is because the members of your class have calling convention __thiscall , but as compiler reminds you, he needs __cdecl .
solution - make your function static and put a this as a parameter (what you have as a dummy). Then you can cast the parameter from void* to ClassName* and call required method.
<br />
class ClassName<br />
{<br />
public:<br />
static void stGetIPAddress( void* dummy )<br />
{<br />
((ClassName*)dummy)->GetIPAddress();<br />
}<br />
<br />
void GetIPAddress( void *dummy )<br />
{<br />
m_IPAddress = do_Something(); <br />
}<br />
<br />
};<br />
<br />
<br />
_beginthread( stGetIPAddress, 0, this);
|
|
|
|
|
a little error...;) for the GetIPAdress
no argument is required for this method...
void GetIPAddress()
{
m_IPAddress = do_Something();
} is correct...
When you use this technic you must be careful for critical sections...
Regards,
Hello World!!!
from Raphaël
|
|
|
|
|
Ah, sorry. I just copy it from the original and forgot to remove that .
|
|
|
|
|
i found some code on MSDN and i need to apply it to my application.
the belowe code is example of IWMEncSource::SetInput on MDSN.
this is preparation for encoding data which is form video capture card and sound card.
so the client who connect to the encoder can see what u a seeing
HRESULT hr;
IWMEncoder* pEncoder;
IWMEncSource* pAudSrc;
IWMEncSource* pVidSrc;
.....
// Specify live stream capture from the installed
// audio and video cards.
hr = pVidSrc->SetInput(L"DEVICE://Default_Video_Device");
hr = pAudSrc->SetInput(L"DEVICE://Default_Audio_Device");
// Initialize the encoder engine.
hr = pSrcGrp->PrepareToEncode(VARIANT_TRUE);
but i would like to take data from file like mpg , avi or asf instead of live.
is it possible just to change input file.
help me!!! plz
|
|
|
|
|
|
Hi world,
When I throw an exception I'll want to use a function (or a MACRO) which give me the line number where the throw was detected... for example:
throw SLD_Exception(error_code, "error message", THE_LINE_NUMBER);
...if this line is the 86th, then THE_LINE_NUMBER must return 86...
Is this possible??? How to do that???
(I don't use MFC... and don't want to use it...)
Thanks in advance!
Hello World!!!
from Raphaël
|
|
|
|
|
Try __LINE__ for the source code line. __FILE__ might also be of interest - this is the source filename.
Hope this helps!
|
|
|
|
|
Thank you... that work fine...
Hello World!!!
from Raphaël
|
|
|
|
|
is there some easy (or not way to download file
from net, when i have url to it?
I'm interesting in C or C++ implementation on non
blocking sockets
(or simple idea how 2 do it)
Pawel
|
|
|
|
|
hehe
i reply to myself
If anybody will be interesting, here are quite nice articles about blocking & non-blocking sockets.
1) http://klement.dstorm.net/rpg/socktut/x1152.html
2) http://www.developerfusion.com/show/28/8
Take care
|
|
|
|
|
i have made tabs in SDI, now i want to make tabs inside the tab which is displayed on my SDI.
refer me the code or website, where i can get appropriate help.
thanx
Reply me soon
|
|
|
|