|
In OnClick Event Write this :
CComPtr<IHTMLTxtRange> spHTMLTxtRange;
m_pHTMLBody->createTextRange(&spHTMLTxtRange);
spHTMLTxtRange->collapse(VARIANT_TRUE);
long x,y;
pEvent->get_clientX(&x);
pEvent->get_clientY(&y);
spHTMLTxtRange->moveToPoint(x,y);
spHTMLTxtRange->expand(CComBSTR("word"),&vtBool);
spHTMLTxtRange->get_text(&bstrText);
//bstrText now contains the Word which user clicked
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Nice!!!
good to see that you posted the solution when you got it, ppl usally forget about it.
This space is empty.
|
|
|
|
|
i have an full control ImageControl.
i have a composite control imageDisplay.
i want to put imagecontrol into imagedisplay. that's fine.
but when i want to invoke a method in imageControl, i can't. not even to compile. i am using code i found in txts and websites:
CComPtr<iimagecontrol> pImg;
GetDlgControl(IDC_IMAGECONTROL, IID_IImageControl, reinterpret_cast<void**> (&pImg));
error: IImageControl unknown identifier.
must i import something? when i inserted the ImageControl, a h.file and cpp.file is added to the project. but neither defines the interface of imagecontrol.
must both source codes be in the same project to work?
help....
|
|
|
|
|
Hello,
I’m looking for a way to display the SysTreeView32 control in a WTL application. Is there an easy way to do this or is there a custom WTL control that can be used? Should I resign to my fate and implementing my own?
If I have to implement my own, what are your recommendations? IShellFolder interface?
Thanks in advance,
-mass
---
PAGE FAULT: Please insert "Swap File Disk 2" in drive and press any key to continue
|
|
|
|
|
There is the excellent http://www.codeproject.com/shell/explorer.asp article by leon Finker (WTL), I think it just lack notification. Also an ATL Tree activeX http://www.codeproject.com/atl/shellfoldertree.asp by Nick Hodapp.
These are the 2 I prefer and both WTL compatible.
Yarp
http://www.senosoft.com/
|
|
|
|
|
Thank you very much
---
PAGE FAULT: Please insert "Swap File Disk 2" in drive and press any key to continue
|
|
|
|
|
I'm just getting into atl but do not think I have all the header files, notably :
atltypes.h
is missing.
I have spent they day downloading various microsoft updates and SDKs but still have not found this file.
any hints?
jema
|
|
|
|
|
I think this is a VC.NET only file. If you're using ATL3.0/3.1 from VC6, you won't have this file, and as far as I know, the only legal way to get it is to buy and install a copy of VC.NET
Steve S
|
|
|
|
|
thanks for the reply, I ordered a copy an hour or two ago having finally figured this bit out......
regards
jema
|
|
|
|
|
hello,
how to overload this operator []
here is the function & type
string& CPCMGroupComputers::operator[](int idx)
{
return m_lstrComputers[idx];
}
list<string> m_lstrComputers;
|
|
|
|
|
|
hello,
but it is giving error.
please check it again.
string& CPCMGroupComputers::operator[](int idx)
{
return m_lstrComputers[idx];
}
here is the type .....
list<string> m_lstrComputers;
please check it
regards
skp
|
|
|
|
|
Im assuming that m_lstrComputers is a std::list < std::string >
In that case, your error is that std::list< T > does not have an operator[], which is logical since it does not support random access iterators. You will have to walk your way to idx either from .begin() or .end().
#include < string >
#include < iostream >
#include < list >
using namespace std;
class c
{
list< string > l_;
public:
c()
{
l_.push_back("test");
l_.push_back("me");
}
string operator [] (unsigned int i)
{
list< string >::iterator it = l_.begin();
while (i-- != 0)
it++;
return *it;
}
};
int main()
{
c c;
cout << c[0] << endl;
return 0;
}
---
“Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
|
|
|
|
|
Jonas Larsson wrote:
You will have to walk your way to idx either from .begin() or .end().
Of course, this is true. However, instead of writing his own loop for that, he can simply use advance function template. Something like:
string operator [] (unsigned int i)
{
list<string>::iterator it = l_.begin();
advance(it, i);
return *it;
}
|
|
|
|
|
Even better!
I havent seen that function template before (Im only halfway through my copy of Josuttis book). Thanks for the tip!
---
“Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
|
|
|
|
|
Hii Everybody,
I have written a ATL COM Component and I am calling through ASP.NET Web Application. But after after logout and setting object of component to null, It is not releasing component at all. I have to stop process aspnet_wp.exe for recompilation of component.
Any suggestion by you all experts that how can I release component after logout of web Application?
Please help me...
Regards
Anuj Mishra
Software Engineer
|
|
|
|
|
Marshal.ReleaseComObject
To quote MSDN: "This method is used to explicitly control the lifetime of a COM object used from managed code. You should use this method to free the underlying COM object that holds references to resources in a timely manner or when objects must be freed in a specific order."
|
|
|
|
|
It has nothing to do with CTreeViewCtrl. Look for bugs in your program.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Thank you for the reply.
I found bug in my source code.
-Freehawk
|
|
|
|
|
Hi list,
I need to compile the following code with gcc:
//test.cpp
#include <iostream>
int main()
{
std::cout << "Hello World";
return 0;
}
But trying "gcc test.cpp" fails miserably, because it cannot find some symbols:
ld: Undefined symbols:
std::ios_base::Init::Init[in-charge]()
std::ios_base::Init::~Init [in-charge]()
std::cout
std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
Can anybody please help me to find what is really missing?
TIA
Theofilactos Botaniaths
|
|
|
|
|
You probably need to tell gcc (via the command line) to search and link with a particular library file. Someone who knows what library file will probably be along soon.
This is a link-time, rather than a compile-time error. Sorry I can't be more help.
Steve S
|
|
|
|
|
Hi Steve,
Steve S wrote:
You probably need to tell gcc (via the command line) to search and link with a particular library file. Someone who knows what library file will probably be along soon.
This is a link-time, rather than a compile-time error. Sorry I can't be more help.
Yes that seams to be the case...
I've tried some (obvious) libraries but no luck
Thanks,
Theofilactos Botaniaths
|
|
|
|
|
Theofilactos Botaniaths wrote:
But trying "gcc test.cpp" fails miserably, because it cannot find some symbols
Try g++ test.cpp instead.
|
|
|
|
|
Hi Nemanja,
Nemanja Trifunovic wrote:
Try g++ test.cpp instead.
Yes it works!
Thanks so much!
Theofilactos Botaniaths
|
|
|
|
|
g++ is basically an alias for gcc --some-magic-c++-library-inclusions
--
Unser Tanz ist so wild! Ein neuer böser Tanz.
Alle gegen Alle!
|
|
|
|