|
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
|
|
|
|
|
I have a dialog box with various buttons and controls on it, as well as a static text box which is used as a placeholder, and in code it creates a propertysheet where the static text box is. I set my desired tab order, with the static text box as #13 in the tab order. But instead of tabbing off the #12 order (a button) and going to the propertysheet's active tab/page, it goes to the #14 control (a listview), then, at the end of the ta order sequence, ends up on the propertysheet. Is there a way I can set the tab order so that the tab order is properly set, so that the propertysheet is #13 in the tab order? Thanks!
|
|
|
|
|
Check out CWnd::SetWindowPos() - I think that might do the trick!
|
|
|
|
|
I looked up SetWindowPos in MSDN, and tried a few things, but none of them affected the tab order from the dialog controls to the propertysheet, and the propertysheet is last in the tab order.
Here is the code I use to create the propertysheet dynamically, IDC_PPS_MAIN is a dialog resource, m_ppsMain is a CPropertysheet object. This code is ran in a dialog in its OnInitDialog() function:
<br />
m_ppsMain.Create(this, WS_CHILD | WS_VISIBLE, 0);<br />
m_ppsMain.ModifyStyleEx(0, WS_EX_CONTROLPARENT);<br />
m_ppsMain.ModifyStyle(0, WS_TABSTOP);<br />
<br />
CRect rcSheet;<br />
GetDlgItem(IDC_PPS_MAIN)->GetWindowRect(&rcSheet);<br />
ScreenToClient(&rcSheet);<br />
m_ppsMain.SetWindowPos(NULL, rcSheet.left- 7, rcSheet.top - 7, 0, 0,<br />
SWP_NOZORDER | SWP_NOSIZE);<br />
<br />
m_ppsMain.SetActivePage(1);<br />
m_ppsMain.SetActivePage(2);<br />
m_ppsMain.SetActivePage(3);<br />
m_ppsMain.SetActivePage(4);<br />
m_ppsMain.SetActivePage(0);<br />
|
|
|
|
|
Make sure that the property sheet/pages have the 'control' style set. This style (DS_CONTROL) tells Windows to include them in the tab order of their parent window.
Software Zen: delete this;
|
|
|
|
|
Anybody know about mirring the display driver? Can we assiciate the mirror driver with virtual deskop. I meant no other driver need to active in virtual desktop. Is it possible?
vikrams
|
|
|
|
|
Just a question about good practice.
Is it reasonable to rely upon the order of destruction of a group of objects within another object? Especially in regard to exception safety and readablity.
Specifically. I'm using CComPtr's to attempt to make some of my DirectShow code as exception safe as possible. I've realized that just releasing the interfaces that occurs in the CComPtr's destructors aren't enough if an exception is thrown, and that the whole filter graph needs to be torn down first.
I'm going to put the tear down operation in an another class, and instantiate it on the stack, but I need the destructor of that object to be called before all of the CComPtr's destructors are called.
I ?think? destructor order is controlled by declaration order, but in general is relying upon that fact good practice?
Any help would be appreciated.
Andrew
|
|
|
|
|
walker_andrew_b wrote:
I ?think? destructor order is controlled by declaration order, but in general is relying upon that fact good practice?
It's specified by the language so it's probably not unreasonable
Not everyone knows that so if your code absolutely relies upon it, a comment to that effect is probably in order.
Software is everything. It also sucks. Charles Fishman [^]
Awasu 1.0.3 (beta)[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
walker_andrew_b wrote:
I ?think? destructor order is controlled by declaration order,
Yes, it is. More specifically, order of creation (just in case you're using pointers to allocate memory dynamically).
walker_andrew_b wrote:
is relying upon that fact good practice?
It's smart, but how will you remember that two weeks from now. If the workaround is difficult, use this by all means, but COMMENT IT!
Vikram.
-----------------------------
1. Don't ask unnecessary questions. You know what I mean?
2. Avoid redundancy at all costs.
3. Avoid redundancy at all costs.
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|