|
Here is the register
void RegWnd::RegChildWindow(HINSTANCE hInstance, char *ClassName, WNDPROC WndProc, LPCTSTR MenuName)
{
wcc.cbSize = sizeof(WNDCLASSEX);
wcc.style = CS_VREDRAW|CS_HREDRAW|CS_DBLCLKS;
wcc.lpfnWndProc = WndProc;
wcc.cbClsExtra = 0;
wcc.cbWndExtra = 0;
wcc.hInstance = hInstance;
wcc.hIcon = static_cast<hicon>(LoadImage( hInstance,
MAKEINTRESOURCE(IDI_MAIN),
IMAGE_ICON,
255,
255,
LR_DEFAULTCOLOR));
wcc.hCursor = LoadCursor(NULL, IDC_ARROW);
wcc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcc.lpszMenuName = MenuName;
wcc.lpszClassName = ClassName;
wcc.hIconSm = static_cast<hicon>(LoadImage( hInstance,
MAKEINTRESOURCE(IDI_MAIN),
IMAGE_ICON,
16,
16,
LR_DEFAULTCOLOR));
}</hicon></hicon>
here is the create
HWND CreateChild(HINSTANCE hInstance,
LPCTSTR ClassName,
LPCTSTR WndName,
HWND parent,
DWORD dStyle = WS_OVERLAPPEDWINDOW|WS_CHILD,
DWORD dXStyle = 0L,
int xPos = CW_USEDEFAULT,
int yPos = CW_USEDEFAULT,
int Width = 400,
int height = 400);
|
|
|
|
|
Try adding the WS_CLIPSIBLINGS style to the child windows.
Also, you may find adding the WS_CLIPCHILDREN flag to the parent window
results in more pleasing updates during resizing (the children won't flicker).
You may get better results using overlapped windows as child windows if you
use the Multiple Document Interface[^].
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
well im trying to stay form MDI thats the whole point of this exercise
those two did how ever stop the issue now it keeps the window behind the other till i let go, presumably need to put a refresh on the WM_LBUTTONDOWN but thats an issue i can ignore for now thank you for your help mate
|
|
|
|
|
Hi
I want to create directory in hierarcy. For example I want to create c:\Test\Temp directory. Both test and temp directory do not exist.
Thanks
|
|
|
|
|
and what have you tried so far to achieve this ?
have you searched MSDN ?
|
|
|
|
|
I bet what he's looking for is an obscure function called something like ::DoMySpecialThingRightNow() instead of an intuitive name like ::CreateDirectory() ....
I mean, who would ever think of that...
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
certainly
|
|
|
|
|
Well CreateDirectory is useless. He actually needs CreateDirectoryHierarchy ...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
CreateDirectory does not create directory hierarchy. I would have to create each directory in hierarchy. I got solution. MakeSureDirectoryPathExists creates directory hierarchy.
Thanks
|
|
|
|
|
Hi,
Actually CreateDirectory does not create all directories in hierarchy. I solved this problem by using MakeSureDirectoryPathExists.
Thanks.
|
|
|
|
|
|
Hi,
I got the solution. I use MakeSureDirectoryPathExists API. Thanks for your response.
|
|
|
|
|
There's a lot of hard ways to do it...
I prefer simple:
::SHCreateDirectory(NULL, L"c:\\Test\\Temp");
*edit* While easy, I just noticed SHCreateDirectory[Ex] is deprecated.<br />
<br />
Bummer.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I used 'SHCreateDirectory' but got 'SHCreateDirectory': undeclared identifier. CreateDirectory API does not suite to my requirement becuase it creates directory only if parent directory exist. I got MakeSureDirectoryPathExists API which fulfil my requirements. Thanks for your help.
|
|
|
|
|
Can you more explain because your answer is easy and you can saw some answers of friends?
|
|
|
|
|
Hi Hamid,
Actually I want to create directory hierarcy using one api. CreateDirectory does not create directory hierarchy. I got MakeSureDirectoryPathExists API. If fulfils my requirement.
Thanks
|
|
|
|
|
Please find the code below
Using System.IO;
//for creating the directory
Directory.CreateDirectory("c:\\Test");
Directory.CreateDirectory("c:\\Test\\Temp");
Cheers!!
Brij
|
|
|
|
|
Hi,
I was looking for WIN32 API. I got MakeSureDirectoryPathExists API. Thanks for your help.
|
|
|
|
|
I am trying to read binary data from a TCP socket using recv() but getting return value as -1 for recv() and errno as WSAECONNABORTED (10053). recv() is reading if server is sending data in character format but when I try to read binary data it fails, I also tried to read into a structure defined for the binary data that I am supposed to recieve but also no luck. Please help me as I have already taken a month to debug and now I am left with nearly no time and having no clue that why I am unable to read binary data into a character array and wat other way I can do it.
char recvbuf[512];
int msgtype;
for(;;)
{
//Reading Message
bytesRecv = recv(conn, recvbuf, 512, 0);
s.Format("Message %s", recvbuf);
m_list.AddString(s);
}
modified on Wednesday, October 1, 2008 7:48 AM
|
|
|
|
|
You should use WSAGetLastError on recv failure, shouldn't you?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Sockets don't know the difference between binary and text data.
Sockets work with bytes and that's it. All data is binary on a socket.
Your problem is with your socket implementation, not the data type.
Is the sender sending exactly 512 bytes? If not, then why are you
trying to recv 512 bytes?
What happens if recv only gives you 1 byte? do you have code to recv
the other 511 bytes?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am working on an application where i want to schedule a task(for example like opening notepad or windows media player)by setting the time, date and day. All i know is that it is possible using thread... but how??? i just want to have an idea for approaching such application.
|
|
|
|
|
You don't need a thread function to achieve this unless you want to do it that way .
See here[^]. You can make use of the scheduled task functionality provided from MS
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
modified on Wednesday, October 1, 2008 7:32 AM
|
|
|
|
|
Hello everyone,
In the poi command Windbg document it is mentioned below. My question is I want to find some samples to learn this command, but failed.
Does anyone have any ideas to make a simple sample. My confusion is after reading this document, I am not sure whether poi works similar to dereference address pointer for value or works similar to mov (no dereference), just a value copy.
--------------------
poi
Pointer-sized data from the specified address. The pointer size is 32 bits or 64 bits. In kernel debugging, this size is based on the processor of the target computer. In user-mode debugging on an Itanium-based computer, this size is 32 bits or 64 bits, depending on the target application. Therefore, poi is the best operator to use if you want pointer-sized data.
--------------------
thanks in advance,
George
|
|
|
|
|
Hai all,
I use two dialog boxes in my project which has a number of buttons with bitmaps loaded. I use F3 and F4 to navigate between the dialog boxes.
But while navigating after about 30 times the dialog shows "Debug Assertion". On debugging it goes to ASSERT(m_bitmap.m_hObjet != NULL).
In the PretranslateMessage()
Dailog1 *dlg1;
this->ShowWindow(SW_HIDE);
OnCancel();
dlg2->DoModal();
Dailog2 *dlg2;
this->ShowWindow(SW_HIDE);
OnCancel();
dlg1->DoModal();
Please any one help me.
Thanks and Regards
Bhanu
|
|
|
|