|
Obviously, Look at MFC\SRC\CTLREG.CPP line 502...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
Thanks for your posting. Is there anyway that
I can put the break point here?
Shin
|
|
|
|
|
This time it's real. I figure out all!!
No problem registrying the ocx.
Thank you very much!!!!!
|
|
|
|
|
I have a Windows VC++ SDI Application that gathers and process data.
All I want to do is generate a report from data I have collected!!!.
I want to be able to generate a report when I select ‘Generate Report’. (And NOT File -> New)
I also want to be able to Print the report.
I have now idea how to do it.
Please help me.
|
|
|
|
|
Hi,
probaly the easiest approach is before saving your data, you transform the data into a CStringArray. That is for every data you need report you transform this data into a textual representation (CString) and add it to the array.
Then you may store the array into a file. If you take care that a line is not too long, then you may also print that array line by line. Do a heighth calualtion and divide the paper length by this height to get the number of pages to print.
Your application framework should alredy have the appropriate Print(Preview) functions installed.
If you do NOT want to select File New, rename it.
Regards
G. Steudtel
|
|
|
|
|
No it's worse that that, I don't understand how I can get the code to write text to the screen.
I think you need to pretend that I don't understand VC++!!!
|
|
|
|
|
|
Hi guys. Can anyone tell me how I can restrict certain users from having access to certain buttons on my dialog? Since this is a one-off, I'd simply like to have the button in question require a password to activate?
Thanks
Paul
Paul
|
|
|
|
|
If the button in question is on a dialog, then you can simply call the button's EnableWindow() method in the dialog's OnInitDialog() method.
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
m_SomeButton.EnableWindow(...);
return TRUE;
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
What I would do is, say you have a button that performs some functionality that requires a password. In yoru button handler, it might go something like this:
void SomeWindow::Button1Click()
{
Pop up a dialog asking for username/passwordd.
if(!DoSomeFunction(username, password))
{
AfxMessageBox("Nice try, buddy!");
}
}
..
bool DoSomeFunction(username, password)
{
check username and password
If incorrect, return false
Else do the forbidden function and return true
}
You can tweak this as necessary. Somebody else suggested just using EnableWindow(FALSE) on the button. That isn't good because somebody who really wants that functionality (and who can resist trying to hack into something, just because it is password protected?) can use an external program to send Windows messages to enable and click the button. If you have the password check in the function doing the restricted functionality, you can't crack it except by knowing the password or disassembling the code.
If your nose runs and your feet smell, then you're built upside down.
|
|
|
|
|
I hadn't thought of that, thanks.
|
|
|
|
|
I have a question regarding the closing of a CView during a paint message.
I want to send a close message to a view during its OnDraw(CDC*) method. Is it guaranteed that the OnDraw method will finish before the view processes the close message if I send it using PostMessage in my OnDraw code?
Thanks in advance.
|
|
|
|
|
Yes. PostMessage appends the message to the queue of posted messages. SendMessage waits for a response (turns into a recursive call on the same thread).
|
|
|
|
|
OK, thank you. That was what I have expected.
|
|
|
|
|
hey
I have come across an application were i need to change the color of the PUSH Button at run time...
Eg:
I have got some hardware interface like KeyBoard were i'll Depict the KeyBoard in my MFC. If i click the key on my Keyboard of my hardware then I have to dynamically show the change in the MFC also.
so how do i do...
venky
|
|
|
|
|
CButton::SetState in the OnKeyDown and OnKeyUp handlers, I expect.
|
|
|
|
|
Maybe this can help you.
Here is an example I used for a text box.
Override WM_CTLCOLOR message
HBRUSH CMyProgramView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
INT nIDCtl = pWnd->GetDlgCtrlID();
switch(nIDCtl)
{
case IDC_TEXT_BOX:
if (!m_strTextBox.IsEmpty())
{
pDC->SetBkColor(RGB(255, 255, 255));
CBrush br;
br.CreateSolidBrush(RGB(255, 255, 255));
hbr = (HBRUSH)br;
br.Detach();
}
break;
}
return hbr;
}
|
|
|
|
|
Hello,I am interrested in "Windows Media Player Technorogy".
There is "prevent screen capture by user" .
The WMP play a MPEG file.
The user push "Print Screen" key,and copy to clipboad.
but the part of picture in clipboad is black.
I want to realize that function.
I researched around "WM_PRINT" and callback function.
but I can't.
Is there any solution?
|
|
|
|
|
Is it the reaction to WM_COPY? Or is WMP constantly checking the clipboard?
BTW. This is one of the reasons why I never use WMP - sorry Redmond!
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
I want to create the below function.
for example,
My Aplication draw only the circle.
The user push the "print screen" key.
But The picture of my aplication's view is black.
And,,,
I think that WMP doesn't constantly chacking the clipboad.
|
|
|
|
|
One of possible soultion that I'm coming with would be:
1. register one of your hidden windows as ClipBoard viewer, so when capture happens you'll get WM_DRAWCLIPBOARD message (see SetClipboardViewer());
2. on receiving WM_DRAWCLIPBOARD you may look into content and somehow figure out if bitmap(metafile) is something coming from your drawing window (based on size for example and or some other specific features) or maybe empty clipboard always when there is bitmap/metafile in it;
3. If it's you -- post message to your main wnd that will empty clipbrd...
...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
This is not actually something WMP does intentionally, it is just an artifact of using overlay surfaces from the video driver. You can do this yourself using DirectDraw. You can't do it with GDI.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Thank you for replies.
I want to try method of replies.
Thank you!!
|
|
|
|
|
I use regsvr32 to register my dll,but it only register for the user that I register in its account,not gor all user. Any idea?
Mazy
No sig. available now.
|
|
|
|
|
Mazdak wrote:
...but it only register for the user that I register in its account,not gor all user.
How are you verifying this?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|