|
AfxGetMainWnd()
Roger Allen
Sonork 100.10016
In case you're worried about what's going to become of the younger generation, it's going to grow up and start worrying about the younger generation. - Roger Allen, but not me!
|
|
|
|
|
Oh good grief! I expected the answer to be simple but I didn't realize it would be *that* simple. Thanks, Roger. ^_^
|
|
|
|
|
OMG! I went krazi and messed with functions man was not meant to mess with to get the main window. And its THIS simple?? Waaaah :p
|
|
|
|
|
Hello,
I need to draw the numerical control machine that I'm moving with my program to the screen.
I want that the machine parts that must do get repositioned in the screen depending on they real position.
I've thought on drawing transparent bitmaps over the screen and moving them.
Could you give me ideas of how to get it without consuming a lot of CPU?
As I use a WM_TIMER in order to get information related to the machine, I've thought to redraw the machine each WM_TIMER message...
Thank you in advance...
|
|
|
|
|
If you are only using windows NT or XP, then you will be able to use TransparentBlt, which works quite efficiently.
Otherwise you will need to resort to a process like this:
1) Blt your image to the destination surface with the SRCINVERT flag.
2) Blt your Mask image to the destination with the SRCAND flag.
3) Blt your image to the destination surface one more time with the SRCINVERT flag.
This process requires a monochormatic mask where the black pixels are transparent on your mask.
One other method is to create a region that represents the clipped area and select this as a clipping region when you are ready to paint. However it may be more trouble than it is worth to create a region for each image that needs to be painted transparently.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi there,
I'm not the kind of person to upgrade just for upgrading sake (if it's not broken, why fix it? ) - so is there actually any value to upgrading from VC++ 6 to VC++ 7 ?
Cheers,
Paul
//////////////////////////////
// Paul Evans, UK.
//////////////////////////////
|
|
|
|
|
At the moment, I'd say not. The next release looks more promising. If you have no need of the new ATL/MFC classes or the improved standards compliancy then the new VC7 isn't worth the hassle of upgrading just yet.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
The IDE has many problems. If possible I would wait until there is a more stable version available.
Oliver
|
|
|
|
|
Oliver Anhuth wrote:
The IDE has many problems
I don't like the Project Wizard. And that one you use when adding a method or varible to a class dialog, gosh it really sucks!
I used to use that dialog before but now I add varibles and method to my classes by writing them.
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I am studying VC++7,so I often meet with the problem:the system tells you there is a problem which he can not resolve the problem,so the vc.net compiler system is going to reboot.To add a varible or a method ,I prefer to write ,which is more conveniently.
Got it
|
|
|
|
|
I would wait until Feburary when Visual Studio 2003 is released. It contains many new enhancements especially for C++ developers over VS7.
I have heard the next version described as an upgrade for VC++ 7.0 with service pack updates for all of the rest of Visual Studio.
Hope that helps.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I've added on the fly transparency to my bitmaps using StretchBlt and a mask. I want to add the ability to flip and mirror the bitmaps, but I'm not sure how to approach it.
Should I load my source image, flip/mirror it, then prepare a mask from that and combine the two for transparency?
Or should I load, mask, combine and then mirror/flip?
What is the best way to do this anyway - StretchBlt with -width and -height? SetWorldTransform?
Tips gratefully received!
|
|
|
|
|
I figured out I can do it using negative arguments in my StretchBlts
|
|
|
|
|
OK...I got that working, but to complete the set of orthagonal rotations,
I need a single 90 degree rotation that I can combine with flip/mirror.
Since I'm working on NT4/2000 and higher, is SetWorldTransform the way to go?
If so, would I be able to set the transform for both mask and source images? Or would I have to operate on the transparent combined image?
|
|
|
|
|
hello!!
i want to read a CString into an not existing .txt-File:
CString MyCString = "The Text";
CStdioFile csf("FileName.txt",CFile::modeCreate | CFile::modeWrite |CFile::shareDenyNone);
csf.WriteString(MyCString);
everything works fine (special thanks to PJ Arends ), but now i will set a path. at the moment the txt is saved in my Program file (MyProgram). now the .txt-file should be saved in MyProgramm\TXT-File.
how can i do this?
thanks
sunny
|
|
|
|
|
you can put whole path into construktor(or Open function)
CStdioFile csf("c:\\path\\FileName.txt",CFile::modeCre.....
Or if you need you program path you can retrieve it by:
GetModuleFileName(NULL,... function.
viliam
|
|
|
|
|
that´s good, but i have another problem:
the filename is given from the program user:
<br />
CString FileName=m_EditFileName;<br />
FileName+=".txt";<br />
i tried this:
<br />
CStdioFile csf("TXT\\myfile1.txt", CFile::modeCreate ...);<br />
and it works perfect. (thanks).
but now i in need something like this:
CStdioFile csf("TXT\\"FileName, CFile::modeCreate ...);
but this do not work? what can i do??? what´s wrong?
thank you for reply
sunny
|
|
|
|
|
Sunnygirl wrote:
CStdioFile csf("TXT\\"FileName, CFile::modeCreate ...);
Almost right, change to:
...
CStdioFile csf("TXT\\" + FileName, CFile::modeCreate ...);
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
great, thank you very much...
sunny
|
|
|
|
|
Try it like this:
<br />
CString FileName = m_EditFileName;<br />
FileName += ".txt";<br />
CString FullName = "TXT\\";<br />
FullName += FileName;<br />
<br />
CStdioFile csf((LPCTSTR)FullName, CFile::modeCreate ...);<br />
|
|
|
|
|
great, thank you very much, too..
sunny
|
|
|
|
|
Dov Sherman wrote:
(LPCTSTR)FullName
Any reason you're doing the cast from CString to LPCTSTR here? It does an implicit cast already, eh?
I never do it, but I have seen others do it, so I'm just wondering what your reasons are?
Thanks
That's why I ramble so much. If you're short and quotable, there's a much greater danger of ending up in a sig.
[Christopher Duncan on how to prevent yourself from ending up in a sig]
|
|
|
|
|
CString MyCString = "The Text";
CStdioFile csf(".\\FileName.txt",CFile::modeCreate | CFile::modeWrite |CFile::shareDenyNone);
csf.WriteString(MyCString);
With the include headers this works...
could it be...
Hope this helps...
regards
|
|
|
|
|
Hi All,
I am opening database as
CDaoDatabase dbSql;
dbSql.Open(NULL,FALSE,FALSE,"ODBC;DSN=ITITest;UID=sa;pwd=");
CDaoRecordset rsSql;
rsSql.m_pDatabase = dbSql;
rsSql.Open(dbOpenSnapshot,"SELECT * FROM tbltest");
BOOL TRY1 = rsSql.CanUpdate();
rsSql.SetFieldValue("test1","123");
when this is executed TRY1 is 0, that means I cant update
I have to change the data in one field of tbltest at the run time for which I am using SetFieldValue of CDaoRecordset.
I am getting following error,
"operation is not supported for this type of object"
Is this approach is correct?? Can anyone explain me asap
Thanks in advance
Uday
|
|
|
|
|
I need to use IMSAdminBase in order to programatically administrate IIS. Unfortunately i get unresolved external symbol on linking phase.
Do you know what is the appropriate library file to be used?
rechi
|
|
|
|