|
With so many items in a list view you should consider to use a
"virtual" list view[^]
Angels banished from heaven have no choice but to become demons
Cowboy Bebop
|
|
|
|
|
I have a problem with converting all serialized data of MFC Object such as COleClientItem, CDocItem and CObject to XML. I would appreciate it if someone could suggest me how to solve this problem.
Thank very much for your help.
|
|
|
|
|
If the item is text, then the easiest way I can think of is with a macro, because a macro can write a variables name in place, so you can turn int Size = 5 to <Size>5</Size> very easily.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I finally figured out how to get my dlls setup properly and exported the functions and was able to import the functions into another project. When I did this I had to add the .lib file to my project and compile the project with the lib file to be able to access the exported functions.
What I would really like to do is link to the dll Explicitly using LoadLibrary and GetProcAddress. To explain why I need to ask another question. I am going to have a series of dlls that will all export the same functions but will have different data returned depending on the dll that is called. For example each dll might have a function exported call GetNames(). If dll1 is called in might return John, Jill, Jack and Joe. If dll2 is called it might return Amber, Ally, Allen and Ashely. Now what I really wanted to be able to do is not have to recompile the the main application when I add each dll. I need a way to be able to have my main application check to see which dlls are available and then call those functions for each dll. If I have to include the .lib file for each dll won't I have to recompile the project each time I add a new dll? Or will I have to recompile the project each time no matter which style I use?
Thanks for all the help from everyone with my relentless dll questions.
-Eric
|
|
|
|
|
VanHlebar wrote:
If I have to include the .lib file for each dll won't I have to recompile the project each time I add a new dll?
yes. since you're linking to the static lib, your app will have the DLL name encoded into it somewhere.
it sounds like you're doing a plug-in system. (click here to learn more! )
if that's the case, what you need to do (IMO) is to write an interface layer between the DLLs and the code that calls the DLL. this layer will act as a proxy between your DLLs and the caller. in addition to allowing a way to call the DLL functions, it will handle DLL loading and unloading. your app can just scan a folder (or whatever) and get a list of DLLs that support your interface (just GetProcAddr for all your calls; if they're all there, the DLL is good, add it to the list).
make that proxy layer a class and instantiate one per DLL. put them all in an array and you're all set
-c
I'm not the droid you're looking for.
|
|
|
|
|
Chris Losinger wrote:
it sounds like you're doing a plug-in system. (click here to learn more! )
Chris,
I clicked but didn't go anywhere Yes it is sort of a plug-in system. The user will be able to get the extra dlls and choose which ones they want to use and which ones not to use.
I like the idea of being able to instantiate one class per dll and having an array, but I guess I would need more information on how to do just that.
Thanks for the help,
-Eric
|
|
|
|
|
somethign like this:
class CMyProxy
{
public:
CMyProxy();
~CMyProxy();
bool Load(const char *pDLLName);
RetType MyFunc1(...) {return (m_pFunc1)(...);}
RetType MyFunc2(...) {return (m_pFunc2)(...);}
protected:
FuncType1 m_pFunc1;
FuncType2 m_pFunc2;
};
CMyProxy proxy;
if (proxy.Load(pDLLFileName))
{
RetType ret = proxy.MyFunc1(whatever, whatever);
}
so, the CMyProxy class loads the DLL, gets function pointers and lets you call DLL functions through its own function wrappers.
-c
I'm not the droid you're looking for.
|
|
|
|
|
This article Plug-In Architecture.asp[^] of mine does what Chris is suggesting. Its probably overkill for your current situation, but you should be able to cut out the bits you needs and modify them to what you require.
Roger Allen
Sonork 100.10016
This is a multiple choice question, choose wisely
Why did the hedgehog cross the road?
A: To show he had guts?
B: To see his flat mate?
|
|
|
|
|
Does anybody know a way to programmatically lock the computer's desktop or the user interface? Maybe system modal dialogs? Is there any way to use them in windows nt/9x?
/regards/
|
|
|
|
|
|
This isn't suitable. I need to lock the interface and unlock it programmatically, I don't want to let user to unlock the station by standard system means.
I think it could be possible by using system modal dialogs, but I'm not sure whether they are supported in Win32 or not and how to implement them.
/regards/
|
|
|
|
|
Hi,
I transferred a project from VC++ 6 to 7. This is a static library.
The library produced by VC++ 7 is twice bigger than with VC++ 6 (either in release or debug mode).
Is there something to tune there or is it normal ?
Thanks for your help. I really need to know the how and why because I release these libraries in a setup package and I don't want it to grow so much.
Nicolas
|
|
|
|
|
|
I have
double Total = 0;
Total += GetSubTotal(m_edit1);
Total += GetSubTotal(m_edit2);
...
sprintf(buf, "%.2f", Total); CString str = buf;
Lets say the total is a million. Then str
is 1.00e+006 which is bad. How can I get it
to display normal numbers and not this exponential?
Please, any response any one can give me will
be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
try "%10.2f". with no width spec, its acting like g instaed of f.
Some ideas are so stupid that only an intellectual could have thought of them - George Orwell
|
|
|
|
|
You could format CString before as:
double Total;
str.Format(_T("%12.2f"), Total);
|
|
|
|
|
This might be an easy question for someone out there. I put together some code so that a user can go out and select a custom program (like WinAmp, WMP, solitaire, freecell, anything that is an .exe file) and it puts the icon for that program on a toolbar and when pressed, it calls the .exe file. What I would like to do is put the program name, up to 8 chars anyway, under the icon. I was wondering if anyone knew how to get the program name from the properties of the .exe file. Right now, I use the filename but in cases like solitaire, it just puts SOL. Does anyone know how to retrieve the properties so I can determine what the application name is?
If possible, I need help in 2 areas. This will go into 2 apps, one is written in C and the other in C++/MFC. Can you help???
|
|
|
|
|
I would like to embed a video clip into a MFC dialog -- basically, I would like to embed or wrap the "functionality" of Windows Media Player into my dialog. Can you help with this?
I have looked through the numerous pages/articles here at CP and have even used the example in CAnimateCtrl before, but I haven't found what I want.
My video clip may come in the form of:
1) AVI uncompressed
2) AVI compressed
3) MPEG file (mpeg4 ? for video???)
What I want is the effect of a "picture-in-picture". I want a few controls that work with the video clip (start/stop, pause). I would also like for the controls of the clip to work with the dialog itself. If I press "pause" on the Video's control, I want my dialog to recognize that "pause" command was issued -- this is for synchronizing activity from either the video clip to dialog or vice-versa.
Thank you for helping and pointing me in the right direction.
Johnny
|
|
|
|
|
DirectShow is what you want. It's part of DirectX. You can basically embedd an instance of Media Player in your app.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
What's the message when a CSliderControl ?
For Buttons, there's BN_SETFOCUS, for edit box, EN_SETFOCUS, so what's the one for the slider control ?
I need to handle when a slider control gets the focus.
Do I need to have a WM_NOTIFY for it if it doesn't exist ?
Thanks.
Max.
|
|
|
|
|
|
|
I'm trying to implement a dynamic menu system to my program. Currently, i can add and remove the items from the menu, and make the menu items run code that i've premade.
for example i can add "section 1" to a section menu, while associating ID_SECTION_1 to the command in the menu. This will call my OnSection1() code when this command is executed.
I want this to be boundless (i.e. i dont want to have to make code for OnSection2, OnSection3, OnSection4... , or the strings in the string table, and so on.) I can currently bind each new menu item to the same id, for example section 1, section 2, and section 3 all run the OnSection() command which is bound to ID_SECTION. What i cannot do, is figure out how to determine which of the 3 i called. I would like to basically get the location of the last menu choice i picked, so if section 2 is in the second spot on the menu, i want to know this when i call OnSection().
Any ideas?
Jeff Rothenberg
Project Engineer
Vector CANtech, Inc.
|
|
|
|
|
why dont u store the currently displayed option on the menu as a numeric index somewhere and use a switch staement in the code to determine what to do?
"traffic lights are for people who can't make their own decisions" biz stuff about me
|
|
|
|
|
How can i get the currently displayed option?
Jeff Rothenberg
Project Engineer
Vector CANtech, Inc.
|
|
|
|