|
Yeah, I understand that I am meant to distribute it, but I'm lazy, it's not a large audience and it's internal. I just thought certain distibutions of Windows may have had the MFC DLL's by default and others may have got them via Service Packs. All PC's are running 2000/NT/98 and should have installed at least one program with the DLL's included so I will just take a chance.
It was curiosity that made me ask the question.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
"Don't belong. Never join. Think for yourself. Peace"
- Victor Stone
|
|
|
|
|
If it were me, given an internal situation, I'd provide a URL to the DLL, and ship without it. You'd have to hope most people have it.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
If it's internal, and you're that lazy, just compile your app(s) with statically linked MFC. It only adds 200k (given no COM or database code) and it's a lot safer than relying on some end-user moron being able to download/install the right version of the MFC DLLs.
|
|
|
|
|
I have a problem in displaying tips of the toolbars using MFC.
My software displays images continuously in a infinite loop.
I created 2 toolbars with style 'CBRS_TOOLTIPS' and added tips for each icons.
The images are fine but the tips disappear.
Tips come back when the infinite loop is disabled. However, I need the loop to display my images...........
Can anyone help me?
Walter Pak
|
|
|
|
|
The issue caused by your infinite loop not allowing GUI (or any?) messages to be processed by the message queue. This can be fixed by making your infinite loop run in a seperate thread to the rest of the application. Look here in Mike Dunn's C++ FAQ, while not covering your problem exactly it covers the generic requirement and has pointers to other articles that will explain what you need to do.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
"Don't belong. Never join. Think for yourself. Peace"
- Victor Stone
|
|
|
|
|
Hello !
How can I make a Lib file in VC++ and use it in Delphi ????
I want to statically link it to a Delphi aaplication ....
I used {$L test.Lib} in delphi, but I recived this error message ..... Bad file Format ????????
best regards !!!!
|
|
|
|
|
I'm not 100% sure but as Delphi is Pascal then I wouldn't have thought VC++ libs would be compatible.
Michel
|
|
|
|
|
Hello ! Michael P Butler
tanks.
|
|
|
|
|
The import library produced by MS Visual C++ is in COFF format (Mangled Names), and Delphi and Borland C++ expects things in OMF format.
See the July 1996 "Under the Hood" article of Microsoft Systems Journal. It talks about different dll formats and ways to get round this.
|
|
|
|
|
Hello ! Rashid Thadha ....
Tanks!;)
|
|
|
|
|
I have a list that is always kept sorted. ie, when an item is added, it gets added at a position that will keep the list sorted. I am using binary search now to identify the location to insert the item.
Is there a better algorithm than this?
Thanks in advance for any suggestions.
-Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
A binary tree with linked lists to allow for equal nodes?
> Andrew.
|
|
|
|
|
I am now using a CPtrList, that contains pointers to structures. I have an InsertSorted(DATA_STRUCT* pStruct), that inserts based on binary sort. Will the binary tree model be able to be implemented inside this InsertSorted?
In any case, I will have to do some research on the binary tree model and make a sample to compare the performance advantage.
Thanks for the reply.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
If you were using STL, the set or map would do this for you automatically, you'd only need to add an element for it to be sorted.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I will try that out. The functionality is encapsulated in a class. I will re-write the class using STL and check for performance improvement.
Thanks
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I was reading through the map and set docs in MSDN. Rightnow, I have a compare function, that compares based on different items in the structure depending on user settings. Is there a place, where I can define a custom comparison function in these classes? I did not find any.
Any help is very much appreciated.
Thanks
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Yes, you can provide a function of your choice that return a bool. It's the last argument of the algorithm, and is optional.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
You can either overload the "<" operator for your structure, or use a function object as the sorting criterion for a map or set. The STL documentation in MSDN is really bad, you need some other information source.
|
|
|
|
|
I think you'll have better use with CTypedPtrList instead of CPtrList
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|
|
I may be lazy, but why not let the container figure it out.
list<myobj> MyList;
MyList.push_back(NewObj);
MyList.sort();
There are performance issues of course if this is being updated frequently and a list may not be the best container, but just a thought.
|
|
|
|
|
I am in a very tight performance requirement here. I have about 20 incoming data structures per second and the list can be large. I was using a binary search to make a sorted insert into the list. But, the list.sort() approach will sort the whole list for each event, not something that will fir in my requirements.
The binary search method is efficient, but I wanted to find out if there are better methods available.
-Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
binary search works greate with arrays not lists.
because. . .
A list is a conected items in different blocks of memory , while an array is one big block of memory when the items stored one after one after one .
which means that,
to get 14th item from the array, you do this: ar[14]
ar[14] = (*(ar + 14 * sizeof(YourArrObj) ))
while to get 14th item from a list you will to get the 1st item and from there you'll get the 2nd item and then the 3rd and the 4th until you'll get the 14th item
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|
|
Does anyone know how to add print preview support to an active document server?
|
|
|
|
|
Hello everyone,
I am new to C++/MFC so I hope someone can help me out here.
I'm writing a program which does things relating to various (human) languages. I would like the code which deals with each language (e.g. French, German, etc.) to be stored in a DLL. The main program will not know in advance which language DLLs exist, it will look in a folder to find them.
The task of the DLLs will be to operate on classes derived from CObject. Sometimes the DLLs will need to put up dialog boxes.
I have two questions:
(1) Would it be possible to have a class CLanguage in the main program, overridden by a class CFrench in the French DLL, to achieve all French-related functionality, by a class CGerman in the German DLL, etc. Then in the main program the user would pick a language and the main program would create a CFrench or a CGerman etc. as appropriate. This seems probably impossible to me because the main program cannot have access to the definition of a CFrench because it doesn't know in advance what languages exist. Is this correct?
(2) Suppose that is not possible, then no problem, I can do it another way: The DLLs would be required to export certain fuctions (e.g. InitLanguage, GetVerbList, etc) and the main program would dynamically load the dll and call the functions with GetProcAddress. In that case, do I need a regular DLL or an extension DLL? The exported functions in the DLL would have some parameters which are pointers to classes derived from CObject, and they would use MFC. But I can't work out from the documentation whether this means I need an extension DLL, and I don't really understand the difference between extension DLLs and regular DLLs.
If anyone can help, I will be really grateful.
best regards,
Stephen Wilson
UCLA Department of Linguistics
|
|
|
|
|
I'd look at creating them as COM DLL's. You could create a base interface such as ILanguage and have each DLL implement it. Choosing them would then be a matter of calling the right CLSID.
Maybe this will help, http://www.devx.com/free/mgznarch/vcdj/1997/aug97/extapp1.asp
It's not exactly what you want, but it might help.
Michael
|
|
|
|