|
Thanks...an insightful message.
What is the difference between MFC and Win32 API?
Many members recommended Programming Windows, The Definitive Guide to the Win32 API -- by Charles Petzold and Programming Windows With MFC -- by Jeff Prosise. I believe the Petzold book emphasizes C, and not C++. That is the reason that is keeping me from considering buying that to strart GUI programming. As for Prosise's book, again, I do not know about the future of MFC with respect to .NET. I want to make sure that .NET and possibly future releases of popular C++ compilers such as Visual C++ and Borland C++ Builder will support MFC.
Ultimately, I want to stick with C++ as a primary programming language. I do not know until when, but I believe it will be a long,long time until someone design a language with the same low-level (C) and high-level (OOP) features like C++. With that said, what GUI programming technique using C++ will give me the most options now and in the future?
Kuphryn
|
|
|
|
|
MFC is a thin layer around the Win32 API.
Eventually becoming an MFC pro does imply knowing the Win32 API. For more complex thing in MFC, you just HAVE to know the Win32 API to make things happen.
Some People say MFC violates a lot of the principles of object-oriented programming, my personal experience is that it just doesn't offer any real abstraction.
Some people have written their own classes around the Win32 API because they got fed up, most do 70% of their things in MFC and hit Codeproject.com to find solutions to the remaining 30% the cannot figure out on their own without knowing Win32 (someone like ME )
It is simply a completely different thing writing ISO-C++ (but again, WHO does that) and using C++/MFC.
.NET is a platform, Win32 is a platform. Writing apps even in C++ for the .NET platform (winforms) is a lot more elegant, writing apps in C++ for Win32 using MFC (do not know WTL) forces you to know the insights = straight C Win32 API.
Sticking to C++ seems a rasonable decision, you can start programming winforms with c++ today, using managed extensions.
just my 2 cents
|
|
|
|
|
Is there any benefit to using .NET Framework over Win32 platform such as MFC? What do you mean by "elegant?" Are you implying, for example, 100 lines of code to 20 lines of code for the same job?
Kuphryn
|
|
|
|
|
For now I would strongly recommend learning C++ and then learning MFC for GUI work. Why ? Because there is a ton of free information on how to do it available ( look around you ). Also, you'll get a copy of VC6 pretty cheap now .NET is available.
I'm not saying don't ever learn .NET/C#, but I am saying that learning where there are a lot of resources will be much easier, MFC is not going away anytime soon, and once you've learned one, the other will be easier because of the basic principles you'll have under your belt.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
Picture a world without war, without hate. And I can picture us attacking that world, because they would never expect it.
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Thanks.
I believe there has been a misunderstanding about my ".NET." When I said ".NET," I meant Visual C++ .NET, the latest upcoming version of Visual C++ (7.0).
I am that much closer to buying the book on MFC by Jess Prosise.
Kuphryn
|
|
|
|
|
For some info about VC 7.0 & MFC read this article in MSDN
http://msdn.microsoft.com/msdnnews/2001/sept/vcnet/vcnet.asp
|
|
|
|
|
Well, what bothers me is that there is no good tool for GUI at all. MFC is not productive enough (just see what you need to do to change a color of a button, for instance ), and VB and .NET are slow and dependent on huge runtime.
I vote pro drink
|
|
|
|
|
I am writing an application for the PPC and I have a question regarding CView::OnInitialUpdate(). On my desktop version this method is called and I have put my initializations here for my pages on my tab that is displayed on the main view. It works just fine on the desktop. In the ppc version the OnInitialUpdate is never getting called. Does anyone have any ideas as to why? Is there a windows message I can generate to get it called? If so where?
Thanks for the help,
-Eric
|
|
|
|
|
Hi there,
I have installed the NT Option pack over NT 4.0 sp 5, and use the personal web server to run ISAPI extensions of my development. The problem is, once a web page accesses a certain extension (DLL) and it is loaded into memory, I can't seem to unload it (stopping the web service doesn't help). This of course prohibits changing the code and trying again, since I can't replace the DLL in my SCRIPTS folder, unless I reboot.
Any Ideas?
|
|
|
|
|
Do you only stop the webservice?
I't might help if you also stop the iisadmin service...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Yep, you need to reboot.
In .NET though, this has been fixed from what I've heard.
Giles
|
|
|
|
|
You can change the ISAPI caching option to prevent ISAPI DLLs remaining in address space:
Open Internet Service Manager, and view the Default Web Site properties. Select the Documents tab and press the Configuration... button. On the App Mappings tab, deselect the Cache ISAPI applications checkbox.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
when i was writing a filter a while back, after each build i'd rename the dll eg filter002.dll. Install that, and remove the config for the old ones in IIS. it still has a file lock on the old ones, but doesn't process them.
Then, every now and again you can reboot and clean up all the old versions.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Is there any way i can make a CDialog based dialog fade in/out??? (under win98).
Or maybe even keep them partially transparent?
Kuniva
--------------------------------------------
God gave man a penis and a brain but not enough blood to make both of 'em work at the same time.
|
|
|
|
|
There is no API functions for doing that on Win98, you need Win2k or WinXP for doing that.
I guess you could do it by manually, by taking a "screenshot" of the dialog, using bitblt(), and then draw it transparently with GDI+...
But then the the controls on the dialog would not work when you draw it transparent, because it's only an image of the dialog, not the real dialog...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
It should be possible though with the standard GDI functions. Get a CRect of the dialog's size and position, then take a screenshot of that area as it stands (before displaying the dialog). Now load a bitmap of the dialog's initial state. Then, manipulate a bitmap structure in a loop to gradually fade the screengrab and bitmap together. Ok, it would be slow as hell, but it could work
Simon
"Does the room have a CView?"
Sonork ID 100.10024
|
|
|
|
|
i want to close my app while some of the threads are using socket connection. how can i stop these threads and clean
the memory used in the threads?
i had tried to add the codes following in the DestoryWindow() of the MainFrame:
while (m_MailThreadManager.GetThreadNum()>0)
{
CMailThread* pMailThread = m_MailThreadManager.RemoveHead();
pMailThread->PostThreadMessage(WM_MSG_ACTION_STOP_THREAD,0,0);
if (WaitForSingleObject(pMailThread->m_hThread, INFINITE) == WAIT_OBJECT_0)
{
CloseHandle(pMailThread->m_hThread);
}
else
{
TerminateThread(pMailThread->m_hThread, -1);
CloseHandle(pMailThread->m_hThread);
}
delete pMailThread;
}
but i found that the threads will cause windows exception
after the SOCKET connection even if ExitThread had been execcuted.
i don't know why since i had executed the ExitThread, the thread still exist and caused that SOCKET exception. and how
can i terminat them safely?
please help me!
- Anthony Chen
|
|
|
|
|
Why cannot anyone help me?
- Anthony Chen
|
|
|
|
|
You need to pass the Socket handle to the thread that you want to
use to terminate the thread that is waiting on it.
Use the "Thread Parameter" or other way.
When you close the socket from a different thread, the thread
that was waiting on "accept(...)" will return INVALID_SOCKET, so you will
know that if fail.
Hope this information helps
- Greatest invention : "The Microchip!"
|
|
|
|
|
If I understand well, you want a thread to tell a second thread to stop waiting on a socket, and you don't know how to do that because the second thread is blocking on the socket call?
If this is your problem, make the second thread use select() [See MSDN for complete description] to see if the socket is ready.
If i am right, and want more information, just tell me
Michel
|
|
|
|
|
Yeah, you are absolutely right! what you say is what i really mean.
i have checked the MSDN about select(), which is used to determine
the status of one or more sockets.
now would you mind telling me:
1. what should i do to terminate a thread which has been blocked on a socket saftly.
2. what should i do to terminate a thread which has a socket (no blocking) saftly.
thanks a lot. hoping more help.
- Anthony Chen
|
|
|
|
|
Hi Guys,
Is it possible to change the Dialog Border Style ???
Best Regards
Sonu
|
|
|
|
|
Use ModifyStyle/ModifyStyleEx
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Uh hello, i have to program an application which uses an access database. I started in Visual C++ but suddenly i remembered Visual Studio also offered Foxpro. Allthough i have no idea what you can use Foxpro for exactly i know it has something to do with databases... Should i use Foxpro for my application instead?
Kuniva
--------------------------------------------
God gave man a penis and a brain but not enough blood to make both of 'em work at the same time.
|
|
|
|
|
Stick with Access.
I think they've abandoned Foxpro now
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|