|
Try this[^]
cheers,
Chris Maunder
|
|
|
|
|
That's absolutely spot on Chris. Thanks loads
Cheers
James
|
|
|
|
|
Hi, I play this game that is DirectX based. It allows you to press Alt+Tab to switch to desktop. At that time the game is minimized, if you press the button in the taskbar the game goes back to fullscreen. When you rightclick the button in the taskbar you get nothing. Now what i want to do is to somehow write a small application so that when the game is minimized i can run some code to make the game maximize in a window(with a caption and all) and so that it doesn't take up the entire screen and i can drag it around. I already tried FindWindow to get the handle and then SetWindowPos() but the game doesn't allow this. What would be the best way to handle this? (and most likely to work)
Many thanks in advance!
Kuniva
--------------------------------------------
|
|
|
|
|
The game probably requires full screen. You may not be able to override that. Check in the DirectX documentation.
Gary R. Wheeler
|
|
|
|
|
Well in my knowledge there's always a way to override things, even if you have to start modifying the directx engine
Thanks anyways
Kuniva
--------------------------------------------
|
|
|
|
|
A directX program must explicitly support windowed mode in order for it to run proprerly. It is possible that your game requires page flipping that is only supported in full-screen exclusive mode, in that case there is no way for you to force it to run in windowed mode.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
In my CMyDocument class I've created a private CObList of some objects. How can I easily get access to this data in a safe way in my View class and dialog, created form my View class? In D.Kruglinski's book there's an example in Chapter 16 but the document there returns a pointer to the private data. But in Deitel's book "C++: How to Program" (Chapter 6.15) the authors do not recommend to return a reference or a pointer to the private data as it destroys the class incapsulation.
Could you give me some piece of advice on this point?
|
|
|
|
|
Add public member functions that set/get the private information. That way, you preserve the encapsulation. The member functions should not return pointers but copies of the objects, so that users of the class can not modify the objects without the class' knowledge.
Gary R. Wheeler
|
|
|
|
|
Thanks for the tip, but how can I return a copy of a CObList object? Wouldn't it be too memory-consuming?
|
|
|
|
|
Hello,
I would like to develop a screen saver creator. There's some articles on the net about program a screen saver. Do you have any idea how to create the screen saver on runtime?
Thanks!
|
|
|
|
|
Hi all,
How can i prevent a restricted user from uninstalling an installed program, say Crystal Reports in a Windows 2000 machine?
With regards
|
|
|
|
|
You probably cannot prevent them from deleting the files, but you can remove the links in the registry to the uninstall program. This would keep the application from appearing in the Control Panel 'Add/Remove Programs' applet.
On Windows 2000, the registry key to look under is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
Gary R. Wheeler
|
|
|
|
|
Hi all,
I am writing code on Pocket PC 2002 using EVC mfc. Can anyone tell me how to create a dialog that is not full screen?
Thanks in advance.
|
|
|
|
|
on the PocketPC platforms, CDialog has a member BOOL m_bFullScreen or something like that. In your CMyDialog::OnInitDialog, or constructor, set m_bFullScreen = FALSE;
hth,
Wes
CPUA - # 0xd00d
Sonork ID 100.14017 wtheronjones
|
|
|
|
|
I found out that when you put in a blob manually into Access as an ole object and it says its a bitmap object (in the database field), then an extra 78 bytes of ACcess header info are added at the start of the bmp. So to extract the bmp you chop off the first 78. But now, I have found out how to put in an image by code into Access. this way the field says its a .ong binary data -still an ole object though. However, its got a different header because chopping off 78 bytes doesnt retreive the original bmp. SO the question is, does anyone know the size of the header when its of type .ong binary data? Hopefully its the first n bytes and not embedded somewhere in the middle or after the bmp header info...
Any ideas on how I can get this info?
Thanks,
ns
|
|
|
|
|
Call be a fool and laugh, if y want, but is there a simple way that I can see the elements of a CArray in the MSC++ de bugger?
Ta
Dave.
|
|
|
|
|
If it's anything like a vector, you should be able to drop down the element and get the memory address of your data at least. Then if it's text you can use the memory viewer.
I'll add my obligatory comment on CArray - it's a pile of crap. Consider using std::vector instead.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
and I'll second that, usedthe std container classes vector/list/map etc. free of charge as well i might add.
Normski. - the next bit of code is self modifying ... jmp 0xCODE
|
|
|
|
|
David Carkeet wrote:
Call be a fool and laugh, if y want, but is there a simple way that I can see the elements of a CArray in the MSC++ de bugger?
Yes there is. In the "Watch" window(if you don't see it just right click in the debugger and it will bring up the option), type the name of the array and all the values will be listed. What I do is insert a breakpoint at the place after the array is filled and then start the debugger. Once you have reached the breakpoint type the array's name in the "Watch" window and then presto, your elements will be listed. Hope that helps.
|
|
|
|
|
Well, teach a mangy old dog new tricks. I didn't know the Watch window was that smart!
Thanks!
Gary R. Wheeler
|
|
|
|
|
I had an edit control and I didnt want it, so I replaced it with a richedit, called it the same thing, went into the gray afx areas and commented out the CEdit entry, the wizard had put in a CRichEdit entry. ANd went about my merry way> it devastated the project completely!!!
SO I took a fresh copy, made the old edit control invisible, put in a richedit, called it something else and it works okay.
I see that what I did was not safe.
Is this safe? -->
If i just wanted to get rid of a control and didnt want invisible control clutter in my design view. Could I just cut it out and hope the wizard takes care of it? Of course all references to it (not in the gray afx areas - I learned my lesson) have to be removed. I am extremely nervous about removing anything now and I have a graveyard of invisble controls in my formview...
Thanks,
ns
|
|
|
|
|
While removing app/class wizard generated code can cause problems, it's OK to do so if you know what you're doing (i.e. if you remove everything you need to remove, nothing more and nothing less).
In general, if you want to perform surgery on the code when removing a control, go ahead and remove *all* references to the control. Then (I suspect this is what caused unhappiness), do View | Resource Symbols and remove all unused resources from the list. The list will explicity identify these bad boys. Finally, do a Build | Rebuild All. This will allow the compiler to catch any references to the deleted controls.
A common error is to delete the control IDC_Foo, but forgetting to delete code, like this (which will compile, since you didn't clean out the resources):
CEdit* pEdit = (CEdit *) GetDlgItem (IDC_Foo);
pEdit->DoSomething();
Of course, if you'd used an ASSERT , a debug run would catch this.
CEdit* pEdit = (CEdit *) GetDlgItem (IDC_Foo);
ASSERT (pEdit != NULL);
pEdit->DoSomething();
PS: You mistakenly checked the "Display this message as-is (no-HTML) box (in your popup menu question).
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Make sure you add a call to AfxInitRichEdit, or else the Rich Edit control won't work.
|
|
|
|
|
Found that out! It gave me an empty document without that declaration!
Thanks,
ns
|
|
|
|
|
Hello!
Maybe this is a simple question, but the answer still eludes me. I have a simple SDI project with one view (call it CMyView) and I draw something on the view in the OnDraw() function. On top of the view are displayed a number of child windows of the view. If I call Invalidate() on the view, there is a noticeable flicker when the child controls are redrawn. Since both the controls and the view use CMemDC to prevent flicker when drawing, I am forced to conclude that this flicker is the result of the view becoming the topmost window while it is painting, then the child windows coming into the foreground again. Is this analysis correct? Is there any way to prevent this flicker?
Thanks in advance!
Sincerely,
Alexander Wiseman
Est melior esse quam videri
It is better to be than to seem
|
|
|
|