|
Imho, you're much better off using MFC, which is a thin object oriented wrapper above the Win32 API. MFC provides a pretty good collection of classes, and with AFX (the application framework), greatly speeds up application development.
The app framework contains a lot of well tested code that takes care of most of the routine tasks common to all apps (creating the main window, handling documents and views, wiring toolbar buttons and menus to commands, etc.). Most of this code can be automatically generated using the MFC App Wizard.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
What kind of app?
The differences:
-----------------------------------------------------------------
MFC is a class library and application framework built on top of the Win32 library.
Win32 is ultimately what every windows gui application/component has to work with.
Win32 requires more knowledge to get started than MFC (IMHO).
Win32 can require more lines of code than MFC for visual aspects of your app.
MFC simplifies visual components through the CWnd class and its message mapping support.
MFC does some funky memory related heap management things I don't fully understand but can cause you problems with certain kinds of situations. (Rare)
Win32 provides no utility classes for such things as string and files. MFC provides many of the most common utility classes. (Note STL and other libraries also provide many of these utility classes.)
MFC's biggest strength is in the framework it provides for developing desktop apps. The Document/view architecture, simple message mapping and other visual related code greatly simplifies development for most types of projects.
My suggestions:
-----------------------------------------------------------------
For desktop apps MFC is by far easier and faster-to-release.
For server-side N-Tier components, MFC doesn't offer very much.
For ActiveX visual components MFC helps a little and can be easier especially if you are already familiar with MFC in desktop apps.
For non-visual COM components it depends on what you are doing. 60-70% of the time MFC won't help you.
|
|
|
|
|
How can i show a dialog resoucre on a CView-dialog at runtime?
I would show the child dialog when a button is clicked on the CView-dialog.
I would place static text controls on the child dialog, and write to these from the CView-dialog.
|
|
|
|
|
If there somewhere is a parameter/class item with the name lpTemplate, try setting it to MAKEINTRESOURCE(<dialogname>) where <dialogname> is the name of the dialog you want to use.
|
|
|
|
|
I don't understand what you wrote!
Can you give me a little code example?
|
|
|
|
|
Use CFormView .
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
What do you mean with "Use CFormView"?
Can you please give me a code example.
|
|
|
|
|
Unfortunately, it's hard to explain this with a code example in a reply. But if you don't need document support and just want to create a simple dialog based app, see this tutorial.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello
I want to send messages from MainFrame to its child views (for example CView and CListView).
In MainFrame there are tree views created from splitterwnd like this;
m_wndSplitter2.CreateView(0,0, RUNTIME_CLASS(CUserListView), CSize (0, 0), NULL);
Those are the ones I would like to send messages to. How do I do that?
How do I get all neccesary handles/pointers to that view.
/Yours truly
|
|
|
|
|
I really need to know how to get a handle or a pointer to a child view?
I'm trying to do thar with GetWindow(), but how do I know which window the result is?
Thanks for all your help
/DrZOO
|
|
|
|
|
I think you can get the caption of all windows like this. I'm sure there is an easier way.
HWND curHWnd = GetWindow(HWND, GW_HWNDFIRST)
while (curHWnd)
{
int iLen = GetWindowTextLength(curHWnd)
GetWindowText(curHWnd , szWindowText, lngLen + 1)
// check if szWindowText is the Caption you want
curHWnd = GetWindow(curHWnd, GW_HWNDNEXT)
}
QMuffs
|
|
|
|
|
if you have the splitter wnd, you can do : splitter.GetPane(...) for each of the panes. this gievs you the CWnd for each sub-view.
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
It's nice with bright people!
|
|
|
|
|
Here's the code, it inside my WindowProc procedure:
LV_DISPINFO *pLvdi = (LV_DISPINFO *)lParam;
switch(pLvdi->hdr.code)
{
case LVN_COLUMNCLICK:
IntBox(1);
break;
}
When i run the program and the window isn't even displayed yet it comes with an "Unhandled exeption" and the goes into debug mode and goes to the "{" after the switch statement.
Thanks
|
|
|
|
|
is pLvdi NULL ? you should test.
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
Yes, it is... why that when i have set it to the value of lParam?
|
|
|
|
|
Aaah, i get it now, you have to check if uMsg equals WM_NOTIFY, thanks man.
|
|
|
|
|
I would like to have char * from string.
I have a fn. called c_str() but it returns a const char*, i dont want to cast away the constness. Whats the proper way to get the char* from std::string.
thanks
Kannan
|
|
|
|
|
std::string s won't allow you to directly manipulate the underlying char * (hence the const .) The closest you can get is obtaining a copy of it for your use. Example follows:
std::string s;
...
std::vector<char> v(s.begin(),s.end());
v.push_back('\0');
char *p=&v[0];
...
s.assign(p);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You really shouldn't try to do this. If you absolutely need a non-const char* then you should probably allocate a char array (ie. char szTemp[200] or char* pszTemp = (char*)malloc(200)) and copy the data from the std::string in and then reset the std::string when you are finished.
|
|
|
|
|
Hi,
In a dialog-based specific application, i need load, draw and change the pixel colors of both bmp and tiff images.
I don't know if it is possible for make a unified class such
as CDib class for dealing with both bmp and tiff images.
Would you please provide some info?
Thanks a lot!
chen
|
|
|
|
|
while i prefer my own library, there are a couple of image classes available on this site. Try the "Bitmaps and Palettes" section.
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
Hi!
Take a look at
http://www.6ixsoft.com/
They have a free "FreeImage" library.
Mukkie
|
|
|
|
|
I want my server ot transfer files...
But if my server is going to get data from client, send data to another client... and 10 clients do that at the same time.. pretty slow server huh?
So.. how can I solve it!?
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
Hi!
a) easy: you can't. Send it to two clients, those send it to another two? Or send the files on a remote server and tell teh clients the URL where thy can download the files. Have a look on different filesharing systems.
b) difficult: you have a multicast router, then you establish a multicast tunneling and use that to send a file to many target clients at the same time.
PS: I'm not sure if I'm right here. This is only what I found out.
|
|
|
|