|
Then i'll have to look over it again, maybe i made some mistake.
Anyhow, i'll get back with more info (i'll have to make some tests).
Thanx anyway.
-----------------------------------
Ok, i looked it over, it didn't load the dlls as i made a mistake when i declared them, now i can load MFC extension DLLs too.
Thanx.
|
|
|
|
|
Im in the process of developing an application that requires a imilar plugin architecture. However, unlike the last response, I have chosen COM as a way of handling such things. I have not solved, or identified all of the problems associated with doing it this way, but heres the basis for my design.
- Component Categories in COM would allow my applicaiton to load any registered component on the system thats fits into my architecture.
- Using a simple, but efficiently designed interface that will allow my app to identify, and understand each component. This interface would be common across every "plugin".
- an IConfig interface could handle executing the plugins configuration, but the implementation would be specific to each plugin.
- The main applicaiton contains the list of useable and loaded plugins. It could then easily generate a tree view that lists each plugin as a node along with access to the IConfig interface.
- Almost every plugin will be presented as an child window in an MDI application.
- My applicaiton would require multiple intances of each plugin.
- I have not solved the problem of presented a common data source to each of the plugins, but im also new to COM and have a shipment of books from Amazon heading my way.
Ryan Baillargeon
|
|
|
|
|
Just remember if you allocate memory from your DLL you have to free it from your DLL. One way to get around this is to pass a function pointer to your DLL for allocating memory.
Todd Smith
|
|
|
|
|
I'm about start a new MFC project and I have fallen at the first fence! I can't decide what type of project to create.
The project will record data (from an instrument on the RS232 port) and display the data as a graph. When it is complete the user will be able to store the data as a file, and view those files at a later date. Also, they can load other files in and overlay them with the existing data.
I think I need an SDI project because I need to open files and I want the File menu, but then how can I overlay one file over another or display data 'real time'? I've only ever used the view class to display data from a file.
Or could I use a Dialog project and add my own menu, 'Open' 'Save' but that sounds messy and I don't know where to start. Any ideas / advice?
Thanks,
Ali
|
|
|
|
|
Alison Pentland wrote:
but then how can I overlay one file over another or display data 'real time'?
Sounds like SDI/multiple views or SDI/single view with a non-modal dialog for the graph.
You probably have to overwrite the open file part of your document class with your own code.
If you have ONE set of Data, shown in different ways in different views -> SDI
If you have many unrelated data sets (like documents in MS-Word) -> MDI
Just my 2c
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
jhwurmbach wrote:
Sounds like SDI/multiple views or SDI/single view with a non-modal dialog for the graph.
Thanks for answering. Yes, I have only written one app before, but it was similar and I used a modeless dialog box when the data was being recorded and displayed the files using the 'CView' class later.
The difference with this app is that they need to be able to overlay old data while they record new data, so that they can look at trends while they happen. I guess I could do this in a modeless dialog box by adding a button called 'Overlay' then calling my own File Open code.
But I still will not be able to overlay stored files together using the Doc/View architecture because you can only have one file per view can't you?
Or have I got that wrong?
Thanks,
Ali
|
|
|
|
|
Alison Pentland wrote:
The difference with this app is that they need to be able to overlay old data while they record new data
That would mean that your 'data source class' adds new data items to the CDocument -derived class and this generates UpdateAllViews() , possibly with a specific (arbitrary) Number as a Hint on witch your Views redraw itself.
Or your View update themself in fixed intervals (using a timer). Either way, Data is only to be held in the Document, and views (and non-modal dialogs) show it.
As with overlaying different files:
You would have to do the loading yourself, that is true.
But you can overwrite the OnFileOpen() -code in the Application class to allow for opening more files with one Document.
Your views have then only to iterate over the vector of loaded graphs and display all of them one after another.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
I'd go either SDI w/ modless dialogs for graphs as stated above, or go dialog-based with modless dialogs for the graphs.
If you don't have a data storage/retrieval class yet, check out my article, CDataFile[^]. I do a lot of what you're talking about.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
OK, I see you are both recommending the same thing, but what do I do about overlaying stored files in Doc/View? You get a new View for each Document don't you. Any ideas? (Sorry if I'm being stupid here).
Nitron wrote:
If you don't have a data storage/retrieval class yet, check out my article, CDataFile[^]. I do a lot of what you're talking about.
Thanks for this, I will definetly give it a look All help gratefully received!
Ali
|
|
|
|
|
I'm not too familiar with the DOC/View archetecture, but you can handle multiple files within a std::vector, and control how many views you want. I keep track of multiple files using:
std::vector<CDataFile>m_vFiles
Good luck.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Hi,
I'm changing my MainFrame's Title when I open a new view.But when I close this view Title is setting back to previous like when my application was opened for the first time.can anybody give me the suggetion to change the Title which does not changes even any view is opened or closed.this is very urgent.
thanks in advace
rgds
Thomas
ThomasKennedyBose
|
|
|
|
|
As far as I know you can't set a title for the whole runtime. But you could try to handle WM_SETTEXT and there don't let it set your caption. If this doesn't work you should set your title even when a window get's closed.
|
|
|
|
|
Ya.............u r right......v have to set the caption even the new window gets closed.Thanks a lot.
ThomasKennedyBose
|
|
|
|
|
Will YourMainframe.SetWindowText("Test") not work?
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Perhaps you read over it, but he mentioned that the title of his mainframe is set back after closing a view. Thus his problem should not be a problem of SetWindowText.
|
|
|
|
|
it will work but it won't remain even when the window gets closed
ThomasKennedyBose
|
|
|
|
|
What about setting the document title by GetDocument ()->SetTitle). Also, try changing the application title in the string table
|
|
|
|
|
it will work but it won't remain even when the window gets closed
ThomasKennedyBose
|
|
|
|
|
If you mean you don't want to have the current document's filename in the title, then in CMainFrame::PreCreateWindow() , turn off the FWS_ADDTOTITLE style.
--Mike--
I'm bored... Episode I bored.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
How do i change the typical MFC icon in my MFC application (I want to use a .ico I have)
Thanks
-- n
|
|
|
|
|
Go to your res directory and replace the icon named like your project by the icon you like to use.
|
|
|
|
|
It doesn't work. I still get the funny MFC icon next to my exe in the folder. I don't only mean the icon thta you see when you run the program, but the icon you see next to the exe file. Any ideas?
thanks
-- na
|
|
|
|
|
Sorry, it works perfectly
thanks so much!
-- na
|
|
|
|
|
Sorry, it works perfectly
thanks so much!
-- na
|
|
|
|
|
To quote MSDN: "Windows 95 and Windows 98: The wParam parameter is limited to 16-bit values. This means list boxes cannot contain more than 32,767 items. Although the number of items is restricted, the total size in bytes of the items in a list box is limited only by available memory."
Does this mean in Windows NT that the wParam parameter can be up to 2,147,483,647 items in the list box? Just out of curiousity, what would be a workaround to add more items to the list box if one was targeting Windows 98 platforms?
|
|
|
|