|
void CMFCTest8Dlg::OnBnClickedButton1()
{
CFrameWnd* cfw = new CFrameWnd();
RECT rect;
rect.bottom =300;
rect.right =300;
rect.top=0;
rect.left=0;
LPRECT lprect=(LPRECT)new LPRECT();
this->GetWindowRect(lprect);
//cfw->Create(L"hi",L"hi",SW_NORMAL,(*lprect),this->GetWindow(1),0,0,0);
cfw->Create(L"hi",L"Ex04a Text Output",WS_CHILDWINDOW,CRect(20,30,350,140));
cfw->ShowWindow(SW_NORMAL);
cfw->UpdateWindow(); // Error here
}
Debug trace:
<br />
BOOL CWnd::ShowWindow(int nCmdShow)<br />
{<br />
ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));<br />
<br />
if (m_pCtrlSite == NULL)<br />
return ::ShowWindow(m_hWnd, nCmdShow);<br />
else<br />
return m_pCtrlSite->ShowWindow(nCmdShow); <---Threw erro here<br />
}<br />
286? WOWW!
|
|
|
|
|
_8086 wrote: cfw->Create(L"hi",L"Ex04a Text Output",WS_CHILDWINDOW,CRect(20,30,350,140));
Whats this API is returning ? I thing this call is failed. And probably, you need to set parent here.
|
|
|
|
|
_8086 wrote: ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));
This should probably be using the logical AND operator (i.e., you want to assert that both conditions are true, rather than just one of them).
_8086 wrote: return m_pCtrlSite->ShowWindow(nCmdShow); <---Threw erro here
What error?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: _8086 wrote:
ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));
This should probably be using the logical AND operator (i.e., you want to assert that both conditions are true, rather than just one of them).
He is refering to CWnd::ShowWindow code.
|
|
|
|
|
prasad_som wrote: He is refering to CWnd::ShowWindow code.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
That's an unusual way of creating a pointer to a RECT. May I ask why you did not write?
LPRECT lprect = new RECT();
I'm just curious.
Tom
Philosophy: The art of never getting beyond the concept of life.
|
|
|
|
|
Tom,
your code also has the benefit of allocating a RECT struct for the GetWindowRect() function to write into - his code allocates a pointer only (a RECT** that he casts to a RECT*) - so GetWindowRect() will corrupt something when it writes to it.
Peter.
|
|
|
|
|
Does it look better now?
CFrameWnd* cfw = new CFrameWnd();
cfw->Create(L"hi",L"Ex04a Text Output",WS_CHILDWINDOW,CRect(20,30,350,140));
cfw->ShowWindow(SW_NORMAL);
cfw->UpdateWindow();
what's wrong with this? Plz help.
286? WOWW!
|
|
|
|
|
I suspect that the Create call is failing - did you take Prasad's advice and check the return value?
If it is failing, carefully check the documentation and your parameter list. In particular, have you registered a windows class called "hi"?
Peter.
|
|
|
|
|
Dear all
i am developing a dll that will contain some data which has to be protected from reverse engineering,
is there is any ideas to achieve this ?
Thanks
MiNa
|
|
|
|
|
MinaFawzi wrote: protected from reverse engineering,
What do you mean by reverse engineering?
Love is like pi - natural, irrational and very important
- Lisa Hoffman
|
|
|
|
|
What do you need ?do you have any problem ?
|
|
|
|
|
You just posted your 4444th Message. Cheers
Absence is to love what wind is to fire; it extinguishes the small, it enkindles the great
- Comte Debussy-Rabutin
|
|
|
|
|
Oh yeah its round 4444 at 1 years,6 months I was tring to say good answers to people and I hope my answers was helpfuls;P
|
|
|
|
|
MinaFawzi wrote: a dll that will contain some data which has to be protected from reverse engineering
What do you mean by this?
Do you really mean hardcoded data inside the DLL, or are you talking about code?
Either case I would say that it's not possible to create a water proof protection against reverse engineering since all code can be disassembled.
What you need to decide is how hard you want to make it for anyone that wants to reverse engineer your DLL.
If you actually mean data one way is to not align data in byte boundaries. Use bit fields that encapsulates the data you're using and don't use the first and last bits. This will however make your DLL slower since a lot of illusive code will be created to use the data.
Another way is to store the data outside the DLL, e.g. on a memory stick.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
MinaFawzi wrote:
Dear all
i am developing a dll that will contain some data which has to be protected from reverse engineering,
is there is any ideas to achieve this ?
try armadillo[^]
|
|
|
|
|
|
brahmma wrote: Clickety Police - Link not working!
too much police roaming here these days
|
|
|
|
|
For ABOUTBOX in my applicaion.
I have use IDD_DIALOGBAR as about box in that dialogbar. I have set the following property.
Border:Thin
Center:True
Style :Overlapped
most of things are false.
the code is below
whenuser click on hyperlink it call from here
case IDC_STATIC_ABOUT:<br />
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWndStatic, About);<br />
break;<br />
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);
HDC hdc;
HBRUSH hBrush = NULL;
RECT rc;
PAINTSTRUCT ps;
switch (message)
{
case WM_INITDIALOG:
return (INT_PTR)TRUE;
case WM_PAINT:
hdc = BeginPaint(hDlg,&ps);
GetClientRect(hDlg, &rc);
hBrush = CreateSolidBrush(RGB(69,13,24));
FillRect(hdc, &rc, hBrush);
EndPaint(hDlg, &ps);
DeleteObject(hBrush);
break;
case WM_CTLCOLORSTATIC:
hBrush = CreateSolidBrush(RGB(69,13,24));
SetTextColor((HDC)wParam,RGB(255,255,255));
SetBkMode((HDC)wParam,TRANSPARENT);
return (LRESULT) hBrush;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
DeleteObject(hBrush);
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
}
break;
}
if(hBrush != NULL)
DeleteObject(hBrush);
return (INT_PTR)FALSE;
}
Now how can i set the icon/logo of my company with titlebar I also want titlebar,
can any one give me the idea for that?
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
amitmistry_petlad wrote: Now how can i set the icon/logo of my company with titlebar I also want titlebar,
can any one give me the idea for that?
Send the WM_SETICON and WM_SETTEXT messages.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
,need to refresh page quite often, especially , if you are around.
|
|
|
|
|
amitmistry_petlad wrote: Now how can i set the icon/logo of my company with titlebar I also want titlebar,
can any one give me the idea for that?
Use WM_SETICON .
::SendMessage(m_hDlg, WM_SETICON, FALSE, (LPARAM)hIcon);
|
|
|
|
|
hi i am having four butoons with bitmap image on them. i have to change the image when mouse moves over it. i cant understand the mouse event and i dont know how to change the image. how to code this please help me
|
|
|
|
|
you have to override WM_MOUSEMOVE and check that the mouse is over your control. if so, then you set the bitmap exactly like you set the first one...
|
|
|
|
|
how we know that the mouse is over our control?
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|