|
|
Why not download GCC (which includes STL, IIRC) from here[^] and try it GCC is the most widely used compiler on Linux/Unix, so this Windows version is the easiest to try!
You may have some problems - some parts of MSVC6 STL (and MSVC for that matter!) aren't compliant with the C++ standard. There's a few things in std::string that aren't right and all the member template functionss defined in the standard aren't member template functions in MSVC STL. However, there shouldn't be too many
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
STL is the Standard Template Library. It's part of the definition of the C++ language, so any correctly written code should work on all compliant implementations of STL.
|
|
|
|
|
To all the experts:
I would like to display an open-file-dialog by a click on the ellipsis button ("...") in the property browser. I have a simple ATL/MFC control and would like to give the user the possibility to enter the path to some file the control needs at desing time by clicking in the "..." button on the right side of the property name. Some stock properties like "Back Color" etc. have simliar functionality (they show a color picker instead of an open-file-dialog).
So what I really need to know is how to display something after a click in the "..." button.
I know how to activate the file-open-dialogs, so my problem is more the property/propety-page part.
I'd appreciate any comment since I have been searching for a solution in C++ almost one entire day
|
|
|
|
|
knaster bax wrote:
I know how to activate the file-open-dialogs,
if your ATL is MFC enabled you can use CFileDialog Class and if your ATL is without MFC then [GetOpenFileName] api will help
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
Thanks for the answer, but I'm afrait, that was not my question.
I'm wondering how to implement an "..." button or maybe a whole custom property editor for my ActivX-Control (ATL 7.0 + MFC-Support).
So what additions do I have to make to a property, that my IDE (VB6, VB.NET) displays this button on the right side in the property browser?
|
|
|
|
|
Hi,
I created one skin application like winamp using WTL. If my application is opened and dialog is displayed in desktop, at the time we move some other application ( yahoo messanger) over my application means, in my dialog background imgage and text are erased and redrawn slowly.
Your suggestions are always welcome.
inbha.
|
|
|
|
|
Hi everybody, i am writing some functions for arithmetic operations with Huge numbers(more than 1000 digit), i am using CString class and i treat CString objects like numbers,for example :
CString s1,s2,s3;
s1="625";
s2="25";
s3=Divide(s1,s2); // now s3="25"
I have to convert Huge numbers to binary, so using simple algorithm(dividing by 2,...) is too slow, so i decided to convert these numbers first to Hex then from Hex to binary,(as converting to Hex to Bin is very fast as you know)
i thought it would make my func faster but it takes approximately the same time ?? Does anybody know why ?? or have any ideas??
Regards
m0n0
|
|
|
|
|
Hello, I'm having a problem accessing the upperbounds of an inner CArray ...
say I have 2 CArray's:
CArray <CSkeletonClass, CSkeletonClass &> m_projectClasses;
and with in CSkeletonClass:
class CSkeletonClass {
public:
CArray <CSkeletonMethod, CSkeletonMethod&> methods;
CArray <CString, CString&> variables;
}
I'm trying to access the methods array and get the upperbounds ... but using it like this
ex. m_projectClasses[counter].methods.GetUpperBounds() doesn't get the correct result ...
and if that doesn't work, then I have no idea if they are even getting in to the array because I insert them like this
ex. m_projectClasses[counter].methods.Add(someMethod);
HELP!!!
|
|
|
|
|
Sometimes, my CHyperLink breakes and it stops at this check. What can i do to stop this from happening?
|
|
|
|
|
CHyperLink uses ShellExecute() to launch the URL in your default browser. So ShellExecute() is failing, probably because the control doesn't have a valid URL.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
...But the URL is ok...and sometimes it works and sometimes is just doesn't, with the same link. I never saw this before:S..
it's obviously ShellExecute(). It returns 0..
|
|
|
|
|
I have a wtl project with date time picker control on it.
simple question hopefully.
how do I get the time or date back from it once the user changes it?
I want to compare the current time with what the user enters.
|
|
|
|
|
i have placed my own activex control in container(MS Word). now i want to print the current document in which i have place my activex control from within the activex control. i have gotten the container pointer using the following code.
IOleClientSite *pClientSite = NULL;
this->GetClientSite(&pClientSite);
CComPtr<IOleContainer> pContainer;
HRESULT hr = pClientSite->GetContainer(&pContainer);
if (hr == S_OK)
{
CComPtr<IDispatch> m_pApplication;
pContainer->QueryInterface(__uuidof(IDispatch), (LPVOID*)&m_pApplication);
CComQIPtr<MSWord::_Application> spApp(m_pApplication);
ATLASSERT(spApp);
}
m_pApplication gets the IDispatch interface pointer.
but when i try to get the application pointer of Word it return 00000 in spApp.
Plz help me how to get application pointer of Word. using this Container pointer.
Thanks in advance
|
|
|
|
|
I am trying to use this:
for_each(stringname.begin(),stringname.end(),bind1st(MyFunctionName, Arg2);
this is not passing Arg2 to MyFunctionName(Arg1, Arg2)..
I am getting the following errors:
error C2825: '_Fn2::second_argument_type': cannot form a qualified name
error C2039: 'second_argument_type' : is not a member of 'operator``global namespace'''
I can implement this easily as a functor if I make a class for it, but I thought you could use a function and just use it's name without any arguments using bind1st... am I wrong?
Thx.
|
|
|
|
|
I think you need to use ptr_fun() to get a functor.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
suppose i have a map<string,int> m;
if i need to search for the location using the int data im currently doing
map<string,int>::iterator iter;
for(iter=m.begin(); iter !=m.end(); iter++)
{
if(iter->second == 10)
break;
}
can i replace this with something like this
iter = find_if(m.begin(),m.end(),bind2nd(KeyEquals(),10));
in which case what would the KeyEquals function object be like???
|
|
|
|
|
Something like this should do the trick
<code>
typedef std::map<int, std::string> MyMap;
bool KeyEquals(MyMap::value_type value, int keyValue)
{
return value.first == keyValue;
}
std::string blah(MyMap const& theMap, int thing)
{
MyMap::const_iterator it =
std::find_if(theMap.begin(), theMap.end(),
std::bind2nd(std::ptr_fun(KeyEquals), thing));
return (it==theMap.end())?std::string():it->second;
}
</code>
PS - try out www.boost.org.Bind. This makes function binding a lot easier. You'd have the code below instead...
std::string blah(MyMap const& theMap, int thing)
{
MyMap::const_iterator it =
std::find_if(theMap.begin(), theMap.end(),
boost::bind(&KeyEquals, _1, thing));
return (it==theMap.end())?std::string():it->second;
}
i.e. no std::ptr_fun, no having to say that you're binding the second parameter. You can see that the order of the parameters passed to bind matches the function signature order of KeyEquals, with '_1' (a predefined placeholder) denoting that the first (and only, in this case) parameter of the bound function object is the value passed by find_if.
HTH!
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
thankx for that one
it worked swell
im just into STLs now and most of the adapter tutorials seem to have bind1st operating only on vectors
so was just tweaking around with maps n function adaptors
i ran into another problem....trying to use the solution above in "transform"
suppose i get my data as a space seperated string list
say a vector of
"one 1"<br />
"two 2"<br />
"tri 3"<br />
"for 4"<br />
"fiv 5"<br />
and have to parse it into a map<string,string>
i tried using the transform function like below
typedef std::map MyMap;
typedef std::vector MyVector;
MyMap::value_type ParsetoMap(string str)
{
string::size_type index = str.find(' ');
MyMap::value_type MyMapPair;
MyMapPair.first = str.substr(0, index);
MyMapPair.second = str.substr(index+1, (int)str.length());
return MyMapPair;
}
void blah2(MyVector & theVec, MyMap const& theMap)
{
transform(theVec.begin(), theVec.end(), theMap.begin(), ptr_fun(ParsetoMap));
}
but it doesnt work
???
|
|
|
|
|
transform(theVec.begin(), theVec.end(), std::inserter(theMap, theMap.begin()), &ParsetoMap);
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
say i have a data that i should be able to lookup using EITHER a int key or a string key..i repeat EITHER..
what kind of container should i be using
|
|
|
|
|
Boost.multi_index[^] should do the job.
Otherwise, you'll need to have a container for the data and separate containers for the mappings (that's what multi_index does internally, I believe).
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Hi,
I'm using CRebarCtrl to hold my commandbar, the menu's though appear as toolbar button but with the menu text, when you click nothing happens!
I used CComand bar class from the the OfficeXP Menu article http://www.codeproject.com/wtl/menuxp_wtl.asp#xx135189xx[^]
Since my app isn't based on CMainFrame, i didn't have a a standard menu, so i created CMenu on the fly and attached it to CCommandBarCtrl does this have anything to do with it.
|
|
|
|
|
hello everybody!
i habe an urgent problem!
there are 2 components i developed in Visual Studio 6 with ATL.
i used the standard wizard to create the DLL´s.
Short explaination of the 2 components:
1. Modul: Search: this dll makes a search against a data-file. it has got interface can used by the most common program languages.
2. Modul: SearchOverXML(using MSXML 4 SP2): this dll receive the parameters used for Modul 1 from a Client, receive a Object, which contains the Result from Modul 1 and the Modul 2 will write the Result-Data in a specific XML-Structur to the Client.
and now my problem. if i call Modul 2 10000 times from a client, the memory is rising and rising and if memory is out the application crashes.
i cleanup all references to MSXML and if i want to call the Release-Method on the Modul 1 Object (i forgot it at first) the Client crashes and the Memory-Leak is still there.
if i call modul 1 only, i have got no problem!
so, i dont know what to do know. maybe the implementation of Modul 2 is wrong. Has somebody a Code Example how to call a ATL Server from a other ATL Server?
thanks for help
best regards
andreas
|
|
|
|
|
I am using a SpinButton control to let the user select a value. If the user selects a new value then I want a listctrl to immediately repaint itself to show a response to this value change. The repainting only occurs when I scroll down the list control. I am using C++ on Visual Studio 2003 .NET.
My question is how do I force the list control to repaint itself, so that I don't have to scroll up or down to get a repaint? I have tried sending messages to the list ctrl and even invalidating the client area of the list ctrl.
I am the handsome one in the crowd.
|
|
|
|