|
Thanks CPallini and the same to you,
Hope we can have a happy post/discussion in 2008 -- with you together.
regards,
George
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
I'm trying to draw pictures in my application.
The primary usage is stuff like: replacing a button picture to a lighted one on mouseover.
I tried using ID3DXSprites to do that.
does anyone do that ?
my main problem is that when creating a texture from file (.png), the image get 'smeared'
to a larger size (power of 2 size), this makes life hard for me.
|
|
|
|
|
Hanan888 wrote: my main problem is that when creating a texture from file (.png), the image get 'smeared' to a larger size (power of 2 size)
Well, I'm an OGL person moreso than DX, but... This is done for performance reasons. There may be a way to turn this option off for NP2 (non power of two) textures, but doing so will give you a SERIOUS performance hit for NP2s. It makes the computer's life harder.
Hanan888 wrote: this makes life hard for me.
It shouldn't.
|
|
|
|
|
Thank you very much but actually I knew that.
Let me just note to anyone reading this that turning textures in directX to NON_POWER_OF_2 should be done with extra attention to portability.
I finally figured out how to show those textures in the original size of the picture. Still, It looks less pretty than the original picture.
My really main concern is that I'm using the wrong technique (textures & sprites) to show pictures.
If you got anything to direct me it would be very great !
|
|
|
|
|
hi,
i am learning mfc, and having a good time doing so. i currently stuck on how to approach a particular problem: i am trying to create a control a color picker control that has four parts for self contained use in multiple projects. the four (rather simple, i know...) parts are:
1) a static box for showing the color selected
2) three separate spin controls that allow you to select the R,G, B components of the color
i know that there are several color pickers avail that do this, but i would like to create my own for use in my own projects, partly as an exercise in how to create self contained controls.
problems that i am having:
1) it is my understanding that there is no way to save a dialog as a resource by itself... the resource file is for the whole project. no importing/exporting of individual dialog resources.
2) so that's ok - i will just create a dialog class and include all of the elements that i want as memebers therein and init them in the dialog class in OnInitDialog using their individual ::Create() methods.
uh, but wait a minute... when it comes time to listening for events, don't i have to give a resource ID for the call to
DDX_Control(, , )...
?
Uh, I seem to be chasing my tail here...
Any help appreciated. - @LRG
|
|
|
|
|
Another option would be to save the dialog template in a separate file that could then be #include d in either the .rc or .rc2 file.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I suggest that you build a DLL which gives access to, or maybe exports your dialog. You need to export it if you want to be able to derrive from your dialog. The main difficulty in this case is the selection of a resource ID that's not going to be used in any of the apps that use your DLL.
Regards,
Bram van Kampen
|
|
|
|
|
In addition to the other replies...
Whatever method you choose - resource-only DLL, resource includes,
etc., the most important thing is to manage IDs so they don't clash.
For example, I personally have a solution with several EXEs that share an MFC
extension DLL, and also share common code that is compiled/linked directly into
several EXEs. From the start, I set aside blocks of resource IDs for each - one block
for the shared DLL, one for common code, and one for EXEs. For new projects, I
just have to adjust the _APS_NEXT_xxx values in the resource.h file so the Visual
Studio auto-generated IDs start in the proper range of IDs.
The info in these technical notes explains the details...
TN020: ID Naming and Numbering Conventions[^]
TN035: Using Multiple Resource Files and Header Files with Visual C++[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hi,
i am just learning mfc and finding good inspiration with this excellent site. a question i have is that many of the dialogs and controls listed on this site are described as "owner drawn". what the heck does that mean?
is that like when you attach a control to a dialog with out using a resource?
thanks - @lrg
|
|
|
|
|
|
ok, thanks... so it would seem that creating an owner drawn control is useful when you need to customize the appearance of the control.
hmm... that's not what i need to do, so i will start another thread with my next question.
|
|
|
|
|
@largeinsd wrote: what the heck does that mean?
The owner is the program that creates the control, so it's responsible for its appearance rather than Windows.
|
|
|
|
|
I just downloaded a copy of VS2008. Am I alone in not recognising anything anymore. There are apparently No more Dialogs (They're called Forms? now, and are apparently created on the fly) No Resource templates, messagemaps, etc. It is still not clear to me how I trap an event, say clicking on a button. Is all knowledge of classical MFC Skills assigned to the scrapheap? To me the whole enterprise looks like Visual Basic with cpp syntax.
Bram van Kampen
|
|
|
|
|
What edition of VS did you download (the Express one hasn't MFC )?
You have also to use VC++ and choose a Win32 Project to find the old stuff.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
I have Express, so that's useless for my purposes.
btw Is that 'new' stuff realy the future? If I had wanted to write in VB and accept it's limitations, that what's i'd have done by using VB. I Don't see any point in using cpp to write stuff akin to VB. By the way, there are more limitations to Express. It is not geared for DLL's. I tried to write a simple one just as a test, Ultimately (because there were no options to choose) by changing the Output Filename to .dll. The whole thing is in a quandry since, (a process called mt is looking for it at the start of the build, and can't find it (it has not been built yet) and cancels the Process with error message c10100b1. I have sofar not been able to find a deeper meaning or background on this error message on MSDN.
Sofar I've been using Visual Studio 97 and VC++ V5.00. It serves 99% of my needs. On occasion I've had to write some DLL's to cover features not implemented on my version, but I get by.
Thanks for your reply, and a happy new year.
Regards
Bram van Kampen
|
|
|
|
|
Bram van Kampen wrote: I have Express, so that's useless for my purposes.
Well, the Express Edition has a great value for money (in fact infinite ). Seriously, you can usually really go on without MFC, in fact I often prefer to use standard Win32 programming.
Bram van Kampen wrote: btw Is that 'new' stuff realy the future? If I had wanted to write in VB and accept it's limitations, that what's i'd have done by using VB. I Don't see any point in using cpp to write stuff akin to VB
Microsoft is strongly promoting .NET Framework, i.e. managed code. It support neverthless standard C++ (native) programming while Visual Basic 6 is no more supported. Roughly speaking, .NET languages are much more powerful and really better (expecially C# ) than 'good' old VB6.
Bottom line, you can really build great application using .NET .
Bram van Kampen wrote: By the way, there are more limitations to Express. It is not geared for DLL's
The above is false. You can easily build a DLL (as well a Static Library) using VC Expression Edition (I've done it): just choose, as project, a Win32 one and then, in the application settings window, select DLL .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
I must admit, I'm totally new to this thing. The interface has changed beyond recognition over the last few years.
CPallini wrote: The above is false. You can easily build a DLL (as well a Static Library) using VC Expression Edition (I've done it): just choose, as project, a Win32 one and then, in the application settings window, select DLL.
I've created now about two dozen empty projects in an attempt to get the options you mention. The biggest learning experience of it all was that I'm getting a feel of the Trepidation our staff feels when I announce that their software has been upgraded. (I Never change the Look and Feel though, if it can be helped). I also noticed that All VC++ 5.0 Help (Help for my Working version)was rendered inacessable by installing V9.0.
Bram van Kampen
|
|
|
|
|
Bram van Kampen wrote: I've created now about two dozen empty projects in an attempt to get the options you mention.
Well, maybe in the next two dozen attempts... Good luck!
Bram van Kampen wrote: The biggest learning experience of it all was that I'm getting a feel of the Trepidation our staff feels when I announce that their software has been upgraded.
I know this kind of feedback, it's useful.
Bram van Kampen wrote: (I Never change the Look and Feel though, if it can be helped).
Beacuse you are a kind developer. I usually cannot resist the temptation...
Bram van Kampen wrote: I also noticed that All VC++ 5.0 Help (Help for my Working version)was rendered inacessable by installing V9.0.
This happened to mee too (with two different version of Visual Studio). I
don't know if it is a documented incompatibility, but I agree: it is a weird thing.
Best wishes to enjoy Visual Studio 2008.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Bram van Kampen wrote: Sofar I've been using Visual Studio 97 and VC++ V5.00.
You really need to be using the full VC++ 2008 then. The Express edition will be limiting.
Kevin
|
|
|
|
|
I went through the same feeling of being locked in VB land when going from VC++ 6.0 to VC++ 2003. I can't imagine how much of a shock it would be to go from VC++ 5.0 all the way to VC++ 2008.
I think it's the one size fits all mentality with the IDE.
The express editions only come with the libraries like .NET, but if you want the power of MFC, you have to buy one of the full products.
|
|
|
|
|
It is a Shock allright, I am maintaining a six year old code base. The Code runs our shops, essentially POS (Point Of Sales) Terminals.
To port this to .NET would involve at least a porting tool, as about 1500 files are involved.
We do not want or need Global Internet Access. VC++5.0 is more than adequate for this. I am now trying to write a form of Internet access, which allows customers to see their bills, and management what's going on!
VC++5.0 should be well able to do this. Maybe we should have a separate sub forum on Legacy MSCompilers, which no doubt people would find usefull.
Not everyone is writing "Push the Boundary" apps. In reality, most queeries on the CPP-MFC messageboard deals with newcommers.
By the way:
if .NET is the way forward according to Microsoft, why is VS2008 littered with JS type files!
Happy New Year
Bram van Kampen
|
|
|
|
|
MFC is alive and well in our shop. We continue new projects in it and use VC++ 2003. Granted, there are quite a few project options but MFC is still in there. Looks different and MFC 4.2 and 7.1 differ a bit in a few places but mostly for the good of MFC. They've fixed a few problems but unfortunately ruined the IDE.
I've gotten used to it though. I still fire up VC++ 6.0 on a regular basis for some test apps but I found the VC++ 2003 compiler to smoke my VC++ 6.0 compiler by a factor or 7 to 1 even with the optimizing compiler disabled. CString is now a template class which is a bit odd but otherwise it feels the same. Some of the C++ conformance has improved allowing for some coding styles that weren't possible with VC++ 6.0.
Some things I hate: the IDE becomes non-responsive and locks up on a regular basis for 2-5 seconds, it's hardly a RAD tool anymore as it is quicker to hand code than use those bastardized "wizards" they give us, not all the tools that came with Visual C++ 6.0 seem to be included, even in the Professional Editions.
Anyway, from what I hear, you don't have to give up on MFC if you use a newer IDE. You just don't get it for free which makes sense in a way since it's really a professional's tool. I plan on going to VC++ 2008 about the start of 2009 so I hope they finish cooking it by then.
Happy New Year
|
|
|
|
|
Hello all,
I was spending some time making a little application that will help me a lot on save time for my future applications.
I'm creating a Property sheet application that initially will have 5 property pages.
I can add and remove some other pages, and of course it is not a big issue if they are not placed in the right order, but imagine that:
UNIT1 | second page | third page | fourth page | fifth page | UNIT2 | UNIT3 | ...
At the beginning I don't know the amount of pages I'll have, and it would be very nice to be able to add the UNIT2 and UNIT3 pages later, but having them after UNIT1:
UNIT1 | second page | third page | fourth page | fifth page | UNIT2 | UNIT3 | ...
Is this hard to do? or even possible?
PS:
I've looked into Google and in the articles regarding to the property sheets, in Google I've found tons of people asking how to change the tab order on a dialog (CTRL+D) and in he articles nothing regarding my question...
PS2:
of course I could set the UNIT1 tab at the end and "end of the story", but the fact is that UNITx should be before as their data affects the other tabs...
As always thank you in advance.
|
|
|
|
|
The PSM_INSERTPAGE Message[^] will insert pages wherever you want.
If you're using CPropertySheet, you may want to implement an
InsertPage() method to a CPropertySheet-derived class. See
CPropertySheet::AddPage() for details.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|