|
Does it have to be an icon? If you convert the icon to a bitmap then you can display that and have it any size you want
|
|
|
|
|
Strictly, no, it doesn't have to be an icon. However, I wanted to take advantage
of the intinsic transparency of icons, rather than messing around with blt functions to make my bitmaps transparent. That seems like a lot of work for an about box.
Dan
|
|
|
|
|
I'm having a problem writing to a remote drive on a NT4 PC.
With two PCs writing different files simultaneuously to the same target PC, sometimes on one of them at Cfile::Open I get a CFlieException cause set to 1 - non specific. Just added CFile::shareDenynone to the Open statement and testing.
Any other suggestions to check out as this is an intermittent problem ?
Thanks.
Elaine
The tigress is here
|
|
|
|
|
well my question really divides into two:
i wanted to save new pictures from old pictures, and add the time to them.
that's when i got to my first question:
[1] i could only save the new pics as gif and bmp, other formats gave me
invalid parameter. why? and how do i fix it?
then i thought to myself "ok, nevermind, i'll just save it as bmp, and then
open it from a new Bitmap object and save it as another format". - wow, it
actually worked, but then i got to my second question:
[2] i can't delete the temporary bmp file, since it's being used, even when
i used pointer to a bitmap and deleted it, it still couldn't delete the
file. why? and how do i fix it? (i used the DeleteFile function)
can anyone help me about these two questions, or one of them, please!
thanks
|
|
|
|
|
hey,
is there any way to priview video which i am getting from a webcam, and also
capture it to disc in a compressed form, at real time.
if anyone knows please tell me, i couldn't get it to work (the capture to
disc part), and i haven't seen any examples on it.
thanks
|
|
|
|
|
|
i've downloaded the directx SDK, and i haven't found any example
on the issue, however, i managed to resolve my problem alone, i
forgot to use addFilter on the compressor filter.
however i don't understand why it brings me so much CLSID_VideoCompress...
and yet most of them didn't work. what gives?
|
|
|
|
|
Hi world...
OS = Win2K with VC++6.0
I have some problem but I don't know who causes this problem (I suppose that's the use of exception)...!!!
The problem is that I catch a BSOD!
How the use of exception can gives me a BSOD???
Can I throw exceptions OR use return inside a catch statement?
Is that permitted?
Thanks in advance...
Hello World!!!
from Raphaël
|
|
|
|
|
If you can I don't know, but you may (at least this month).
If you return you should delete the exception, usually by calling e->Delete().
You may also throw this same exception again, or throw another one. In this case you also should Delete() the old exception.
If you throw the same exception it won't be caught by this code, because it is thrown outside the try block. In this case it acts like it is passed through.
G. Steudtel
|
|
|
|
|
G. Steudtel wrote:
If you can I don't know, but you may (at least this month).
Oops... Sorry... But I'm not an English expert...
I don't use CException of MFC!!! I use exception class from the C++ standard library. Thus, How to reproduce the delete method of MFC?
Re-thanks...
Hello World!!!
from Raphaël
|
|
|
|
|
You throw by value, and you catch by const reference .
No need to delete, you make these Exceptions on the stack, and if you re-throw it will get copied.
This way you can catch a derived exception as its base (say std::exception), re throw the std::exception object and catch again as a derived exception.
And NEVER EVER touch MFC exceptions....
I have a small hierarchy of exception classes, eventually derived from std::exeption, and their c'tors are filling the error-string with a sensible message, and then add filename and line number of the error to member strings, so I can have a look when debugging.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
I want to make sure that no one deleted my data files in my program . Is there a where i can write protect a folders or files so to prevent it from deleted . Also is it possible to set a folder to be a system folder so it can be invisible ?
|
|
|
|
|
Hi, I want to ask if I can have a variable in a namespace that all namespace's functions can hava access to it, for example:
<br />
namespace foo<br />
{<br />
int x;<br />
<br />
extern void yak();<br />
extern void bar();<br />
}<br />
<br />
void foo::yak()<br />
{<br />
x++;<br />
}<br />
<br />
void foo::bar()<br />
{<br />
x--;<br />
}<br />
Can I make both yak() and bar() to operate on x? I get a linking error this way, saying that I've multiple definitions of int foo::x.
Thank you, Themis
|
|
|
|
|
You can try something like:
namespace foo
{
extern int x;
void yak();
void bar();
}
(you dont need to define the functions as extern)
Then just make sure you instance the variable in one place only:
int foo::x = 0;
|
|
|
|
|
BoundsChecker v7 is reporting the error 'Argument 2 in ReleaseDC (HDC__ hdc = 0xE00105F5) still contains non default/stock objects.' in the d'tor for CClientDC in the code:
void CHListBox::updateWidth(LPCTSTR s)
{
CClientDC dc(this);
CFont * f = CListBox::GetFont();
CFont* pOldFont = dc.SelectObject(f);
CSize sz = dc.GetTextExtent(s, _tcslen(s));
dc.SelectObject(pOldFont);
sz.cx += 3 * ::GetSystemMetrics(SM_CXBORDER);
if (sz.cx > width)
{
width = sz.cx;
CListBox::SetHorizontalExtent(width);
}
}
I'm fairly confident that there is no leak. Do you agree?
Gavin
|
|
|
|
|
CFont* GetFont( ) const;
Return Value
A pointer to a CFont that contains the current font.
The pointer may be temporary and should not be stored for later use.
so maybe
CFont * f = new CFont( CListBox::GetFont() ); ??????
|
|
|
|
|
Gavin Jerman wrote:
I'm fairly confident that there is no leak. Do you agree?
Yes.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I need to find out if the currently logged in user has administrator access to their PC. Does anyone know how I can do this please?
I'm writing a custom installation app, and need to make sure the logged in user has administrator access to the PC otherwise some of the files, especially MFC dlls won't copy properly.
Thanks
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
|
I'm making a small program (in MFC) that needs to play several wave-sounds at the same time. I tried to use PlaySound(), but with that it seems you can just play one file at the time (the previous played file stops and the new begins to play, or the second waits till the first have finished).
How do I play several wave-files simultaneous?
|
|
|
|
|
Hi,
I encounterd the same problem, and found no solution.
I think it's the system which locks the "loudspeaker" resource.
Well, actually it's the soundcard device.
The only workaround would be to switch the playing of the sound faster than the user can hear the tones. But this will be heard by cracks, and also the sum of the wav file times will be the total playing time, not the time of the longest wav file.
By considering the difficulties and drawbacks of this method I choose not to follow this way.
Instead now I try to find a tool for mixing two wavefiles outside the application, and later on play this mixed wave file in my application.
G. Steudtel.
|
|
|
|
|
DirectX DirectSound will do this for you.
search google for some helper classes that encapsulate DirectSound and DirectSoundBuffer unless you want to do a lot of low level coding.
|
|
|
|
|
Hi
I have created a very simple ActiveX, but I would like to send parameters from a HTML page to the ActiveX. I have found some information mentioning that I need to implement an "IPropertyBag" but I am new to MFC, (this is my first project), and I dont know where to implement it neither how.
Could anyone help me?
Thanks
"Learn from the mistakes of others.
You can't live long enough to make them all yourself."
"Failure doesn't mean I'm a failure, It does mean I have not yet succeeded;
Failure doesn't mean that I should give up, It does mean that I should try harder;
Failure doesn't mean that I will never make it, It does mean that I need more practice".
Thank you for helping.
|
|
|
|
|
Hi!
I need to serialize some GDI+ stuff and for that it seems I need to use the
IStream COM interface.
For the rest of the serialization I use CFile. I tried this but it throws a
memory exception:
<br />
void CViewCoverPage::Serialize(CArchive& ar)<br />
{<br />
...<br />
<br />
COleStreamFile* pOleStream = (COleStreamFile*)ar.GetFile();<br />
IStream* pIStream = pOleStream->GetStream();<br />
m_pLogo->Save(pIStream,...);
...<br />
}<br />
It seems any operation I try with the IStream object results in an access
violation.
Do I need to initialize it in some way??
What am I missing here??
thanks /Anders
|
|
|
|
|
On the wild assumption that your document class is dervied from COleDocument try COleDocument::EnableCompoundFile(TRUE)
else create a memory stream file and stream m_pLogo into it
then archive the resulting bytes
ar << (DWORD) size of memory stream
ar << contents of memory stream
and reverse the sequence for the restore obviously
using dynamic_cast<colestreamfile*> ar.GetFile() would probably have shown this up etc etc
|
|
|
|
|
I've had some luck with the CArchiveStream class declared in the <afxpriv2.h> header (at least in VC6.0, 7.0 and 7.1; also in eVC 3.0).
This class is what MFC uses for feeding ActiveX controls on dialog boxes. I don't expect it to change, but it might.
Using it is quite simple:
<br />
CFile file( );<br />
CArchive ar( &file, );<br />
CArchiveStream arStm( &ar );<br />
<br />
IStream* pStm = &arStm;<br />
<br />
<br /> Obviously if you need the stream object to have a longer lifetime, you'll need to create all the objects (arStm, ar, file) on the heap instead.
Minor edits - decided to make IStream more obvious
--
Mike Dimmick
|
|
|
|