|
I believe you'll find none of the NeHe tutorials use MFC. We are building an OpenGL app and do not use MFC, and I create dialogs and so on in the standard, non-MFC way. You can find examples here that build a framework for GL using MFC, or you'll need to learn Win32, and maybe buy Petzhold.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
None of the tutorials use MFC, just the plain win32 API. However, I'm pretty sure there is an MFC framework example on the site included. If you understand OpenGL, then creating MFC OpenGL apps shouldn't be much of a problem. Be prepared though, 99% of the OpenGL examples you'll find around are going to be win32. Learning win32 is a great bonus though, and there's no better book than Petzold.
Simon
Nobody does chicken like MFC
Sonork ID 100.10024
|
|
|
|
|
Check out the OpenGL section of this and at Code Guru. There are several very good examples that use MFC and support printing and print preview. They worked for me.
|
|
|
|
|
hello
i have created an application (e.g.- a.exe)
& i want to open or run it from another application (e.g.- b.exe) how can i do that ?
regards
Chanda.com
|
|
|
|
|
CreateProcess, ShellExecute, ShellExecutEx
Normski. - Professional Windows Programmer
|
|
|
|
|
|
Thanx a lot for immediate reply.
Chanda.com
|
|
|
|
|
Is there anything that can help printing on A4 pages?
What I would like to do print on for an
application written in VC++. Data are represented in table and charts
(the charts are just image). If the table is too long for an A4, it's
required to break the pages. I am Looking Excel Type of page break
Mechanism.
So I need to deal with the format and pagination either in VC++
Any suggestions?
Thanks in advance
Nag
|
|
|
|
|
You need to Know the width and the heigth of the page.
You Know the properties of the page that the user selected, for example Letter or A4, the size is standard.
Okay, when you are printing, through a printer or the preview, you need to calculate the space that you need for show the next Column, if the rigth point of the next column is greather of the page less a margin, you need to do a page Break.... (The same for the height). Is not easy but works...
Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hi, I have troubles to set an icon on the title bar of my modeless dialog box. I tried SetClassLong () after I'd created the dialog but before it became visible. It's working well except all message boxes I create subsequently have the same icon on the title bar. They are obviously created from the same system dialog box class. Not mentioning possible further creation of other dialogs. How would I go about this problem? Anybody knows?
|
|
|
|
|
Try this:
In the constructor of your dialog class, change: m_hIcon = AfxGetApp()->LoadIcon(IDR_YOURICON)
And this I think will change the icon of your dialog title bar
"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
|
|
|
|
|
But I'm not using MFC
|
|
|
|
|
I set an icon for a dialog as follows :
m_hIcon = (HICON)LoadImage(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDI_SELECTSTRUCTURE), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR) ;
SetIcon(m_hIcon, FALSE);
This is done in the InitDialog()
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
|
|
|
|
|
I cannot find pure API function similar to CWnd::SetIcon ()
|
|
|
|
|
The MFC function translates to this:
_AFXWIN_INLINE HICON CWnd::SetIcon(HICON hIcon, BOOL bBigIcon)
{ ASSERT(::IsWindow(m_hWnd)); return (HICON)::SendMessage(m_hWnd, WM_SETICON, bBigIcon, (LPARAM)hIcon); }
So you need to use SendMessage to do the equivalent.
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
|
|
|
|
|
|
What really is Managed C++, opposed to normal C++ ????
Thanks !
Jerome
|
|
|
|
|
I believe it's C++ compiled to the .NET CLR. This topic is getting a lot of discussion in the lounge right now.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Managed C++ allows the developer to reap the benefits of other .NET languages such as C#, VB.NET. These benefits include:
Automatic garbage collection.
Intergration with the .NET Framework
From the VS.NET MSDN:
A primary focus of Visual C++.NET is to provide a powerful and simple way to design applications that target the .NET Framework common language runtime (CLR). The CLR offers a run-time environment that manages the execution of code. When you develop code using Visual C++.NET, you can compile your application or component with managed code, which is code that the CLR supports with services that make component programming easier. Managed Extensions for C++ allow you to easily create new .NET Framework components with C++ code, easily migrate existing native C++ code to use the .NET Framework, and access unchanged C++ components from the .NET components.
|
|
|
|
|
I have written an extension DLL which always have had on and off problems with resources. I've always been able to get it working, however, until a few days ago when something went haywire. Suddenly NONE of my resources in the DLL are available from the applications using it. I've tried almost everything, moving the source to a new DLL project, doing the same to the applications. Restoring an old, known-to-work, version of the resource files, but nothing seems to help!
Is it possible, in the source, to create a situation where the resources are never inserted in the resource chain, or their ID-values become scrambled somehow?
Stepping through the failing calls to LoadString (which is the first place the problem makes itself known, though the program can't find any dialog or bitmap resources either) I can see that it searches my DLL for the resource but for some reason doesn't find it.
I've also checked the DLL with a resource explorer and found all the resources to be present and accounted for.
What is going on? Thanks in advance for any input you might have!
|
|
|
|
|
A possible guess at the cause:
When the module gets searched using FindResource, is the correct HINSTANCE value passed across to the FindResource call. If this has been corrupted in your program then it could cause this problem.
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
|
|
|
|
|
How do I know if it is corrupted? It seems a strangely even number: 0x00400000, every time, but is that wrong? And why is it set to that if it is wrong (it is the value assigned to the DLL in the DllMain routine).
/Daniel
|
|
|
|
|
The value you quoted for you HINSTANCE is typical for a loaded DLL, so it looks like thats not the problem.
The only other idea that occurs to me is that the resources are in the file, but they are in a different language section (You can have multiple resources for different languages in the same file, I think).
It may be worth checking in your .rc file that they are being compiled into the correct language space.
From one of my .rc files I have:
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
This may be missing or incorrect in the file to cause it to be in a different language area.
These are only guess's, I hope they help out.
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
|
|
|
|
|
Thanks for your help!
This was indeed the problem. What had happened was that a few resources had entered the resource file that were in swedish (I'm Swedish, dontyaknow) and all the rest were set on US English (because in realy the *are* in English and not in Swedish). Therefore FindResource refused to load them, since there were multiple languages available.
Let this be a warning to ye all! Don't mix and match.
Three days of my life I wasted on this problem. Thanks again Roger Allen, you are my savior.
/Daniel
|
|
|
|
|
Daniel Hellsson wrote:
Thanks again Roger Allen, you are my savior.
Praise indeed
Glad to be of service.
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
|
|
|
|