|
You ve to use Alpha layer blending to the image to remove the background of the image. this should be done using the help of some grafix team.
Try using Alpha layer, thats the solution for this. filling the background with transparent color may npot be working all the time.
|
|
|
|
|
Dear All,
I want to write one COM with ATL Executable program or Service program.
Can one help me to get one exact easy article to do this ?
Kindly...
|
|
|
|
|
|
In the two places I have boldened below, should the code be checking for 'b' to be NULL instead of psz, after the call to T2BSTR ???
HRESULT ToLower()<br />
{<br />
USES_CONVERSION;<br />
if (m_str != NULL)<br />
{<br />
LPTSTR psz = CharLower(OLE2T(m_str));<br />
if (psz == NULL)<br />
return E_OUTOFMEMORY;<br />
BSTR b = T2BSTR(psz);<br />
if (psz == NULL)<br />
return E_OUTOFMEMORY;<br />
SysFreeString(m_str);<br />
m_str = b;<br />
}<br />
return S_OK;<br />
}<br />
<br />
HRESULT ToUpper()<br />
{<br />
USES_CONVERSION;<br />
if (m_str != NULL)<br />
{<br />
LPTSTR psz = CharUpper(OLE2T(m_str));<br />
if (psz == NULL)<br />
return E_OUTOFMEMORY;<br />
BSTR b = T2BSTR(psz);<br />
if (psz == NULL) return E_OUTOFMEMORY;<br />
SysFreeString(m_str);<br />
m_str = b;<br />
}<br />
return S_OK;<br />
}
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
Where you get this code from ? With VS2005 its different from what you have posted.
If at all there is code like this, then there is is bug. It should be checked with 'b'.
|
|
|
|
|
This code was lifted directly from the source for one of Microsoft's ATL libraries.
In this case, Visual Studio 6.0 - ...\VC98\ATL\Include\AtlBase.H
The function does not appear to be a problem in VS 2003 - it uses different algorithms - handling Unicode and other issues - see AtlComCli.H.
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
Yes, Now I can see it.
Is it is definitely a bug(Now we should say 'was', as VC 6 is no longer supported).
I wonder,How it goes unnoticed for such length of time.
May be, nobody is supposed to see implementation.
|
|
|
|
|
What documentation should i read?
Are there any books published (if yes, which ones should i buy),any good tutorials, where do i find the namespace's reference..?
Thanks
|
|
|
|
|
|
CodeProject site on the subject[^] is always a good place to start.
Before you begin you should be aware of what STL is in general.
STL stands for "Standard Template Library" and is a set of C++ templates to be used when creating common data structures such as arrays, lists, stacks, maps and so on.
If you don't know how to use templates and data structures mentioned above, or more important; when to use them, you should get yourself a book of basic C++ before taking the plounge into STL.
STL is like a toolbox with tools designed to solve different kinds of problems. You just have to know which tool to use in any given situation, otherwise the tool may become part of the problem.
Hope this helps
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|
|
I recommend The C++ Standard Library by Nicolai M. Josuttis - perfect for C++ programmers who have yet to take the STL plunge. It's pretty much my bible on the subject (along with Scott Meyers Effective STL book of course).
Amazon UK link[^]
Kicking squealing Gucci little piggy.
|
|
|
|
|
|
I agree 100% with you and Rob!
|
|
|
|
|
I agree 100% with you and you and Rob!
Kevin
|
|
|
|
|
Thanks. Just what i was looking for
|
|
|
|
|
I agree with you & him & him & him. Now Chris is not going to agree with all of us
|
|
|
|
|
Hi.
I'm writing an ATL control, (composite control), and handling some button message I need to load a cursor from resource. So I tried to use the API LoadCursor(hInstance, LPCTSTR lpCursorName) and I found that I need the instance of the control and I don't know where to find it.
With a regular MFC application I can call AfxGetApp()->m_hInstance but now it does'nt work in spite of my application class is derived from CWinApp because it support MFC.
So, how could I get the control hInstance needed for many API functions????
Thank you.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
I found it!
Is a member of CComModule, and there's a global object of CComModule called _Module.:->
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
Use _Module.GetResourceInstance() when loading resources.
|
|
|
|
|
Ok.
Thank you Mike.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
I have to create an ActiveX control from a huge .IDL file.
I have no problem creating a class to control the control but there seems to be a lot of leg work in writing out the declaration, definition, dispatch enumeration and dispatch map when creating the control class.
Apart from manually running through the properties and methods in the IDL file is there a way of automating this process instead?
Thanks
Tom
It will always be the bane of the civilized as to what to do with the barbarian
|
|
|
|
|
In VC6, once you'd built the IDL there was an 'implement interface' option. Can't remember exactly where, since I saw it demo-ed on a COM course once, and never used it myself, since I preferred to go through and do it by hand to help reinforce my memory
Don't know if there's an equivalent in later VS though, as I wouldn't use it if there was ...
Steve S
Developer for hire
|
|
|
|
|
Ummm - use ATL? That'll do the IDispatch implementation for you if you ask it nicely, as well as loads of other interfaces - I just created an ATL Control class in VS2003 and it looks like it'll implement these interfaces for you:
IDispatch, IPersistStreamInit, IOleControl, IOleObject, IOleInPlaceActiveObject, IViewObjectEx, IOleInPlaceObjectWindowless, IPersistStorage, ISpecifyPropertyPages, IQuickActivate, IDataObject, IProvideClassInfo2<br />
|
|
|
|
|
Thanks for the responses guys
I agree with your do it your self attitude but this interface has literally hundreds of events, methods and properties and I start to go a bit nuts after a while of doing that much repetitive work.
Unfortunately, I've failed at failed at finding any assistance from VC2005. so I've decided I'd rather write a parser myself than manually go through it all. Is there a document that lists the complete spec for IDL files? and would anyone be interested in me publishing the resulting app?
Thanks again
Tom
It will always be the bane of the civilised as to what to do with the barbarian
|
|
|
|
|
Would it be less work to use the type library instead of the IDL ?
Steve S
Developer for hire
|
|
|
|