|
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.
|
|
|
|
|
|
I want to transfer a large data buffer, maybe 10k. Who can tell me how to realize my idea?
|
|
|
|
|
|
thanks a lot, please tell me , if I have a data buffer like "BYTE* p = myData;// there are many 0 values in buffer", I know buffer 's length, how to transfer the data use BSTR?
|
|
|
|
|
Don't treat the BSTR as a null-terminated string!
Use SysAllocStringByteLen to allocate the space.
Cast the BSTR to BYTE* and use SysStringByteLen to get the byte count.
Free the string as normal with SysFreeString .
MSDN does say that a SAFEARRAY with element type VT_UI1 is preferred, in order that you don't get translations on 16/32-bit borders...but a) who uses 16-bit OLE now?, and b) BSTR is a lot easier in C++
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|