|
Do you work for the MPAA or RIAA by any chance?
You can pick your friends, and you can pick your nose, but you can't pick your friend's nose.
|
|
|
|
|
no i don't work for any of those.
it's because someone at some office paid for some educational video or something (i'm not sure about details), and fears that if he gives it to his employees it will end up being copied all over the place and stuff liked that.
so, he asked if there was anything that could be done.
now, i was thinking about some shell extenstion perhaps, there is something that can intercept when you try to copy a file and then check for a file name and delete it.
_ra
|
|
|
|
|
You can,
Bundle the media into an executable which plays the media and destroys itself thereafter. (Self destruction isn't easy, but not impossible either ) Of course that doesn't prevent people from making copies of it before each run. To avoid this you can hide some information in the guest computer, in the registry or somewhere indicating that this program has been run and in the next run self-destroy without playing the movie.
And besides all the buzz: Since you have given the data to someone, this person logically can do anything with it, hence s/he owns it.
|
|
|
|
|
How about using Windows Media Player/Authoring and DRM ?
, but it may be able to do what you want. I have no experience with this, so I cannot help you any further.
Bruce Duncan, CP#9088, CPUA 0xA1EE, Sonork 100.10030 Blackadder: Baldrick, have you no idea what irony is? Baldrick: Yeah, it's like goldy and bronzy only it's made of iron.
|
|
|
|
|
Is it possible to use an std::basic_string<TCHAR> as a write buffer ?
I seek for the equivalent of GetBuffer, ReleaseBuffer like in CString.
If not I have to use a TCHAR buf[1024]; works also but is not so nice.
|
|
|
|
|
strstreambuf (<strstream>)
|
|
|
|
|
Hi,
I've got a dialog with a simple listbox on it and I want my dialog class to be notified when the user rightclicks on the listbox.
TN061 says to add ON_NOTIFY to the message map:
ON_NOTIFY(NM_RCLICK, IDC_LIST1, OnListRightClick)
and add a handler function with this prototype:
afx_msg void OnListRightClick( NMHDR * pNotifyStruct, LRESULT * result );
That's what I did, but it doesn't seem to work. The handler function is never called.
Anyone?
Thanks,
ren.
|
|
|
|
|
Hello,
are you sure, that you enabled the notification of parents?
And if so, is the dialog window the parent?
To enable notification, you have to open your diolog resource and have a look at the proprties of your list control. The format tab has in the middle of the options a boolean value for notification. Make sure that this one is activated.
Hope this helps
G. Steudtel
Even dwarves started small.
|
|
|
|
|
Thanks but no luck,
The Notify property was enabled and the dialog is indeed the parent. (I checked with: m_cMyListCtrl.GetParent()->m_hWnd == this->m_hWnd )
|
|
|
|
|
Make sure the object ID is correct and refers to the corresponding list object. Recheck.
Kuphryn
|
|
|
|
|
I have seen this 'failure to comply' before.
Even after quadruple checking everything.
I ended up catching the right click in the control and 'manually' posting the message to the parent. Now it works fine.
A little extra work to make a derived CListBox that catches the right-click, but that is what I really needed.
C++/MFC/InstallShield since 1993, breathing air since 1963
|
|
|
|
|
Hello,
In MDI project i want to know how many child window are open.
There is variable ? i already try get_accChildCount but it doesn't work .
thx
|
|
|
|
|
use WM_MDINEXT to enum mdi windows
|
|
|
|
|
I tried to "steal" this message for my CDialog class even though its not in the classwizrad for my cdlg class. SO i did:
void CRemote::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
lpMMI->ptMinTrackSize = CPoint(640,460);
lpMMI->ptMaxTrackSize.x = min(lpMMI->ptMaxTrackSize.x, 1228);
lpMMI->ptMaxTrackSize.y = min(lpMMI->ptMaxTrackSize.y, 900);
CMDIFrameWnd::OnGetMinMaxInfo(lpMMI);
}
============
E:\tests\Remote.cpp(63) : error C2248: 'OnGetMinMaxInfo' : cannot access protected member declared in class 'CWnd'
but the same thing works when this code in my my MainFrame class...
Can I do this ? What needs changed? If not, howe to restrict size of CDlg?
Appreciate your help,
ns
|
|
|
|
|
You need to call:
CDialog::OnGetMinMaxInfo(lpMMI) not CMDIFrameWnd::OnGetMinMaxInfo(lpMMI) , and don't forget ON_WM_GETMINMAXINFO() in your message map.
By the way, is your dialog resizable?
ÿFor the bread of God is he who comes down from heaven and gives life to the world. - John 6:33
|
|
|
|
|
yes. it is resizable. Thanks. Finally why didnt the Cwizard have this in its available trappable messages for my CDialog class? For that reason I didnt think that CDialog had a OnGetMaxMinINfo function....
Many thanks!
Appreciate your help,
ns
|
|
|
|
|
Hi,
the class wizard has a message for GetMinMaxInfo. Just change the message filter from Dialog to Window.
I don't know, why they filtered this message out for dialogs. Probably because dialogs usually are not resizeable.
G. Steudtel
Efen dwarves started small.
|
|
|
|
|
Thats really cool.....setting filter as "Window" instead of "dialog" . I really thank you because I dont have to put in the stuff myself in the maps.....
Appreciate your help,
ns
|
|
|
|
|
Hello,
i want to show a ContextMenu when the user click(right) on a tab (of a CTabCtrl). I tried to handle the OnNMRclickTab - Message but I had no sucess (no mouse coordinates and no information about the Tab which has been clicked...)
How can I solve that problem?
|
|
|
|
|
Did you try: WM_CONTEXTMENU (afx_msg void OnContextMenu ( CWnd* pWnd, CPoint pos ))?
I didn't try it though but I don't see any reason why it shouldn't work.
ÿFor the bread of God is he who comes down from heaven and gives life to the world. - John 6:33
|
|
|
|
|
|
Hi,
how can I reactivate the one and only view of the one and document in a SDI app?
A little explanation why I must do this: I have a standard SDI application and added a ControlBar with an embedded CEditView latetly. The problem is, that this EditView will activate itself within the MainFrame if you click on it. I need the possibility to reactive the View of the main document programatically if I want to do some view dependant processing, for example closing the app. Closing the app e.g. will query the active view wether the underlying document has changed. If I have the wrong view active (e.g. the CEditView), this message is send to the wrong document.
As a second example: The CEditView is a LogConsole for my application. If I have activated the CEditView, e.g. with a mouseclick I want to reactivate the main SDI view with the ESC key like the Output Control bar in the Visual Studio. But how do I find the document to send the Acitvation command to?
In a MDI application there is the MDIGetActive() window, i think, but there seems to be no such window handle in a SDI application.
I thought about hooking somewhere into the InitialUpdateFrame or OnCreateClient procedure, and safe the created view from there. But I'm sure wether this is safe, also when I have opened different documents.
Thanks for any ideas.
Dirk
|
|
|
|
|
...Why in the world are you using CEditView???...
Sounds like all your problems would go away if you just switch to plain edit. CEditView is there to support view & document stuff, you seems to not want either? ( You are using SDI, EditView stuffed in control bar most likely has some other document )
So either use plain Edits or switch to MDI and limit it to single document, remove windows menu, get rid of close view.
Brian
|
|
|
|
|
Hi,
because the CEditView can do FindText out of the box.
I know, you can always implement that yourself, but why should I. Only because MFC does a tight coupling between Views and the Frame?
There are thousands of reasons, why someone does this or that. I tried converting my application to an MDI app. With the result, that this is as much trouble, than sticking with an SDI app.
Views are the same thing than Controls. Only that they have an attached document (which is no problem), and that they talk to the frame directly (which is a problem). There is no bad thing about using Views as Controls. Thing for example at the CScrollView. I can think of a lot of Controls that could need scrolling capabilites. Why shouldn't I use a CScrollView as the base class for such controls.
And now think of a CFrameView that has these CScrollView derived controls on them. Boom, you get the same problem if you click on this control.
I would have derived my controls from a CScrollCtrl if there was one, but there wasn't.
I would have used a CEditCtrl that can do FindText, if there was one, but there wasn't
Dirk
|
|
|
|
|
This is what I did and it doesnt crash but is it safe etc? I am going to put this in my OnSize to find out what the width and height of the window are so I can pinpoiint the exact dimensions when the dlg looks best. Then I'll make onsize restrict it to these minimum dimensions when its resized. I think I'l get cx, cy which are height and width, so I dont need CRect, but I was wondering if there is a more direct way of outputting two simple integers rather than formatting them into a string...
thanks
void CTestsView::OnButtonwrite()
{
CFile cFile("E://testWrite.txt", CFile::modeCreate|CFile::modeWrite);
CRect cRect;
GetClientRect(&cRect);
int width = cRect.Width();
int height = cRect.Height();
CString pos;
pos.Format("widthe %d height %d", width, height);
int bufLength = pos.GetLength() + 1;
LPCTSTR lP = pos.GetBuffer( bufLength);
cFile.Write(lP, bufLength);
cFile.Close();
pos.ReleaseBuffer();
}
|
|
|
|