|
I don´t know myself at all with Toolbars, but after a short read of the msdn, i think you could try the following :
Create a CToolBarCtrl object, assign it the return value of pBar->GetToolBarCtrl where pBar is your CToolBar . Then you have access to the EnableButton() and other functions of the same kind using the CToolBarCtrl .
Hope this helps...
~RaGE();
|
|
|
|
|
Hi,
I am trying to develop a Resource editor like VC++ .
It seems that the way a CDialog is displayed while running
in applications and while CDialog is shown in the Resource
Editor.
Can some tell me what is the difference.
Thanks,
San
John 3:16
For God so loved the world,
that he gave his only begotten Son ( Jesus Christ ) ,
that whosoever believeth in him should not perish, but have everlasting life.
|
|
|
|
|
I have both Visual Studio C++ 6.0 and .Net Enterprise Architect installed on an Win 2K platform. Whenever I use the 6.0 debugger it launches the .Net debugger instead. Does anyone know a work around for this bug?
Thanks in advance for your assistance.
Amos Kermisch
|
|
|
|
|
I think .NET puts itself as the default JIT debugger. But if I have a VC 6.0 project set a breakpoing somewhere in the source files and hit F5 then my project is debugged under VC 6.0
Best regards,
Alexandru Savescu
|
|
|
|
|
Alexandru,
Just wanted to thank you...your suggestion works great!
Amos
|
|
|
|
|
i know it's easy for win2000, how abut win98
|
|
|
|
|
In Win2000 the transparency is built in to the GDI. These functions don't exist on Win98, so there's no simple way.
You could cheat, by screengrabbing the area that your window will appear, and then drawing this over the top of your window with an alpha effect, but this will be fairly cpu intensive (unless you start doing directx stuff)
Basically you can do it for very little overhead on Win2000, as it's built in. On Win98 you're going to have to make your own transparency code, which will be complicated, and probably slow
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
some collections are called dictionay, bag ...
we know how to implement list, array because we know their physical structure. but if i want to develop a dictionary or bag class, what are physical stories about them?
i guess a dictionary just = array or list + key.
am i wrong? do u have suggestions?
thx
includeh10
|
|
|
|
|
if i remember my smalltalk, a 'bag' is a collection that you can put any number of things into, duplicates are allowed. but when you take something out, tho, you have an equal chance of getting any of the objects out - it's random.
a dictionary, i think, is an associative map (item + key, lookup by key).
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
my question is about their physical view and to to implement them, not how to use.
thx
includeh10
|
|
|
|
|
bag = array with random accessor function.
dictionary = ...well, there are a thousand ways to do it. use std::map
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
In STL a dictionary is implemented as a map (maps keys and values) and is a binary tree (a red-black tree under the VC implementation). Thus the tree is kept always sorted by its key, so we have logarithimc insertion and look up time.
A map cannot have duplicate keys. However if you want to use duplicate keys you can used multimap (also part of STL).
Another implemntation is to use a hash_map or hash_multimap (not part of the STL library but most of the STL implementations offer them - VC offers it in VC.NET).
A hash works like this:
you provide a hash function that "hashes" the key and thus you have a hashvalue. your hash_map has a vector of lists. The size of the vector may depend on a given hash size. When you want to insert your object, you hash the key, and with the obtained hashed value you insert the object in the in the list indexed at the hash value (i.e if your hashed value is 5 then you insert your element at the tail of the 5th list).
When you want to lookup an object, given the key, you hash the key and then you perform linear search at the list of the index of the hashed value to find your object
If the hash size is big enough you will have lists with only one element then the insertion and lookup time will be O(1), provided that your hash function is fast enough. (it was O (log(n) for a map). However if your hash size is too small (or you have too many elements in the dictionary) then your lists will be very big so inserting and looking up can be slow. That's why people use map and hash_map also.
Best regards,
Alexandru Savescu
|
|
|
|
|
I want to create an COleDispatchDriver through class wizzard to call an object within a ATL project.
I have tried implement the object both as a CCmdTarget and an Atl Simple object. But to no joy.
When my Project calls the createdispatch method of COleDispatch driver it just fails.
Can anyone offer me any advice.
Cheers
Richard
|
|
|
|
|
I can now call "simple Atls objects" in Atl Projects, i hadn't called AfxOleInit.
But i still can't call CCmdTargets which are in a Atl Dll projects.
|
|
|
|
|
I have a class in DLL and a derived class in another dll. The first class contains a std::map <int, CString> that is populated in a method of its class.
After the map is filled, iterating throgh it in the base class works fine.
In the second dll I do this:
1. Call the method from the first class to fill the map. It works fine, I can iterate through the map like for (it = mymap.begin(); it!= mymap.end(); it++)
2. Now I am back in the second dll (of the derived class). And I use the same code to iterate through the map. The first element of the map is displayed correctly. Troubles occour when getting to the second element (i.e. when doing it++)
I have checked to see if the map has not been damaged accross dlls. This is not the case (all the pointers are the same and point to the same data - the _Right, _Left, _Value structures point to the same addresses in the first and second dll.
The problems seems to be in the _Inc member function
void _Inc()
{if (_Right(_Ptr) != _Nil)
_Ptr = _Min(_Right(_Ptr));
else
{_Nodeptr _P;
while (_Ptr == _Right(_P = _Parent(_Ptr)))
_Ptr = _P;
if (_Right(_Ptr) != _P)
_Ptr = _P; }}
The first element of the map is a leaf (it's the lowest) in the tree so the execution should go on the else branch, right?
In the first dll, _Right(_Ptr) is different from _Nil and, so the execution goes on the else branch, but in the second dll (of the derived class) it says they have the same value although I have checked _Right (_Ptr) returns the same value in both cases.
Any idea, CG, Joaquin and other STL gurus, please help!!!
Best regards,
Alexandru Savescu
|
|
|
|
|
My wild stab in the dark would be that if they both point to the same address, then _Nil is what's changing and therefore it seems your copying only the first element between dll's. _Nil obviously changes, have you actually asked the map how many elements it has ?
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
How can _Nil be changing since it is defined static?
static _Nodeptr _Nil;
and is initialized with 0
template<class _K, class _Ty, class _Kfn, class _Pr, class _A>
_Tree<_K, _Ty, _Kfn, _Pr, _A>::_Nodeptr
_Tree<_K, _Ty, _Kfn, _Pr, _A>::_Nil = 0;
I have checked, it has the same number of elements and I can find them all if I put the map in the watch and expand the _Left, _Right and _Parent correspondents...
Best regards,
Alexandru Savescu
|
|
|
|
|
You are right after all Chrstian. _Nil changes, but why?
Here is what happens:
class A is in A.dll and class B : public A is in B.dll
Class A has a map as its member. (I'll call it MyMap)
1. I am now in a method of class B. Here MyMap._Tr._Nil is NULL (0x00000000)
2. This method will call a parent method from class A. Just stepping into that method (withought touching the map object) I will find that MyMap._Tr._Nil is no longer NULL. I can work with the MyMap fine, inserting elements and iterating through it.
3. I return to the method described at 1. Now MyMap._Tr._Nil is NULL again . Now playing with the map screws up my application.
Any idea?
Best regards,
Alexandru Savescu
|
|
|
|
|
I replied, went to bed, got up and you'd solved the problem yourself. Thanks for letting me know the outcome.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
Sorry for replying for the third time to the same method. I found the solution and I thought you might want to know:
Get an updated version of xtree from Dinkumware. Also, VC.NET does not need this patch.
Best regards,
Alexandru Savescu
|
|
|
|
|
hello..
as a background process, i should print pdf files...
does anybody know any good library (commercial should be no problem) for this?
i tried messing around with the activeX - component.. but it should be a plain c++ file, without any dialogs, the best would be even without mfc...
thanks in advance (i have to say that i am ont able to response until monday.. because my weekend starts in 5 minutes)
bernhard
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
You can buy a PDF print driver direct from Adobe. Then you can create a printer DC as normal and print as you require. We use it embedded in our software to generate PDF files.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
i need it the other way round... a background process should print pdf files out..
first a normal printout from an application (with barcodes..)
then some pages from a pdf file..
(and this should be a background process.. so no gui..)
bernhard..
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
Situation: I built a dialog based mfc-win32-app.
Because the app works with skins, the main dialog has no borders nor caption.
Problem: The program DOES show the program icon when the app is minimized and shown in the Windows main task bar WITH border/caption, but NOT without it. This seems very odd to me
I really want the program icon shown...
Solution:?
|
|
|
|
|