|
There was a litte bug in the sample program...
Bit 18 is 0x40000, not 0x20000. If you havn't discovered it yourself I think I should save you some trouble....
/moliate
|
|
|
|
|
at first, because my poor english,I wish you can understand me!
If I draw some lines or pictures in a DC,How can I get the bitmap data and save it as a bitmap?
thank you for your help!
Don't look at me in that way!
|
|
|
|
|
CBitmap m_pGenBitmap = new CBitmap();
CClientDC dc(NULL);
int nWidth = 128;
int nHeight = 128;
HDC hDCScreen = dc.GetSafeHdc();
HBITMAP hbm = ::CreateCompatibleBitmap(hDCScreen,nWidth,nHeight);
if (hbm != NULL)
{
HDC hDCGlyphs = ::CreateCompatibleDC(hDCScreen);
HBITMAP hbmOld = (HBITMAP)::SelectObject(hDCGlyphs, hbm);
CDC *pDC2 = CDC::FromHandle(hDCGlyphs);
CRect r(0,0,nWidth,nWidth);
// your owner draw
pDC2->FillRect(&r,&CBrush(RGB(0xff,0xff,0xff)));
m_pFillUnit->Draw(pDC2,&r,0);
// end
SelectObject(hDCGlyphs, hbmOld);
m_pGenBitmap->m_hObject = hbm;
::DeleteDC(hDCGlyphs);
}
return m_pGenBitmap;
|
|
|
|
|
Check out Mike Dunns FAQ, I think it was something about that there...
or
see in the Bitmaps & Palettes section here on CP
or
Search this forum, because you're not the first who asking!
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Can someone tell me the easiest way in .NET to overload a base class function? basicly what I've been doing is looking at how the base class and just copying/pasting the code and modifying it, but i figure there has to be a built in way to overload a function without doing this?
thanks!
-dz
|
|
|
|
|
working under w2k platform, after changing the ip address, you needn't restart the system, so I want to write a programme that can change the ip address, mask gateway and DNS and so on dynamically, how should I do? thanks.
|
|
|
|
|
Chaps and chapets
Having trouple with testing C++ 'init'
cannot seem to surpress the violations within MFC macros
any comments welcome dudes
The Wudan Master (deceased)
|
|
|
|
|
I have CString object,I want to divide it 3 by 3.For example my string is this:"123456789"
I want to have threee CString like this:
"123","456","789"
How can I do it?
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Use CString::Mid() in a loop
|
|
|
|
|
Thanks ,I'll check it.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
How do I manage to use an own Icon for my executable (no MFC used yet) so that the usual Windows-Icon for exes is replaced by my Icon ?
|
|
|
|
|
hmm, I think this question is answered several times in this forum, it might even be in the Q&A section. Anyway, to change this icon, modify the Icon whose ID is IDR_MAINFRAME, remember to change both of them, the standard one (32x32) and the small one (16x16).
|
|
|
|
|
I know that procedure when I have a for example dialog-based app using MFC. But I dont use MFC and aint got any resources yet. What do I have to do ?
|
|
|
|
|
The resources are crucial - if you don't have them you can't have icons. When explorer try to flash an icon up, it just uses the first icon it comes across in the resource sector. Usually we arrange things so that if you have several icons, the main one is the first one uncovered. There really is no way around you making an .rc, and doing it that way - not that I nkow of anyway.
I hope that helps.
With time we live, with money we spend!
Joel Holdsworth
|
|
|
|
|
It helped, got my Icon now. Thanks a lot to both of you.
|
|
|
|
|
Hi.
I am developing a dialog based app.a costum header file for common defination has been included in stdafx.h,when i build the app,the compiler say the common definations is redefined in appname.obj.However after I install the latest MS Platform sdk,the problem disappear.Please tell me why?
|
|
|
|
|
|
I should think it would depend quite a bit on just what you were defining in that header file. Mind sharing?
Developers that like shiny objects also dig case mods and scratch-and-sniff stickers. Klaus Probst, The Lounge
|
|
|
|
|
Hi,
I have created two ActiveX controls that are on the same DLL file ( developed using ATL). I can insert them in the "Test Container" without problem.
But If I try to insert the newest one in Ms Word, it gives me the following error:
"The server application, source file, or item cannot be found. Make sure the application is properly installed, and that it has not beed deleted, moved, or renamed"
I've try to insert it there, from an Automated App, from the Insert Object menu, and from the Insert ActiveX from VBA toolbar.
I tought that it was maybe because some temporary files ( ".exd"), but I have search for that *.exd files and nothing found...
Any idea about that ?, Thanks in advance
Braulio
|
|
|
|
|
Hi,
I'm working on a rather huge project, and we would like to start using Visual Studio.NET in the near future. However, we will not be using MFC7 in the next few months; we'd like to stick with MFC6. Is it possible to work in VS.Net while developing with a previous libraryversion?
--
Alex Marbus
www.marbus.net
But then again, I could be wrong.
|
|
|
|
|
AlexMarbus wrote:
Is it possible to work in VS.Net while developing with a previous libraryversion?
No,You have to use MFC7 there but if you delevop half of your project with MFC6 then you want to swicth to MFC7(VC.NET),there is no problem and you can proceed your project with new version.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Are you sure about that? I have opened my project in VS.Net and MFC7, but there are a lot of things different in MFC7, compared to MFC6. I get a lot of compile-errors I didn't get with MFC6. So, I can understand that MFC7 will behave very differently compared to MFC6.
I have figured out that I can tell VS.Net to use different folders for include and sourcefiles, so it will include MFC6 files, however I can't manage to tell the linker it should link with MFC42.dll instead of MFC70.dll.
I really hoped I could use MFC6 in VS.NET because I don't feel very much like testing the entire project (which is rather huge) to see on what points it differs from the previous library.
--
Alex Marbus
www.marbus.net
But then again, I could be wrong.
|
|
|
|
|
AlexMarbus wrote:
I get a lot of compile-errors I didn't get with MFC6.
This is VERY strange,What was those errors? I used my MFC6 projects in VC.NET and there were no error also I saw thousends times in this forum there is no problem for that.
AlexMarbus wrote:
I really hoped I could use MFC6 in VS.NET because I don't feel very much like testing the entire project (which is rather huge) to see on what points it differs from the previous library.
I think you'd better not to take risk (because of those errors)and still use previous version of VC unless someone make sure for it.
Maybe other guys here can give you more information and of course help you better than me.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Mazdak wrote:
This is VERY strange,What was those errors? I used my MFC6 projects in VC.NET and there were no error also I saw thousends times in this forum there is no problem for that.
Most compile-errors were related to RichEdit, e.g. a wordbreakproc. But there were some errors related to CString as well. (Has that class moved to ATL?)
Mazdak wrote:
I think you'd better not to take risk (because of those errors)and still use previous version of VC unless someone make sure for it.
Maybe you're right, but I wanted my colleagues to get used to the look and feel of VS.Net in the first stage, and one stage later move the entire project up to MFC7.
Mazdak wrote:
Maybe other guys here can give you more information and of course help you better than me
You have been a big help so far, thanks for that!
--
Alex Marbus
www.marbus.net
But then again, I could be wrong.
|
|
|
|
|
AlexMarbus wrote:
Most compile-errors were related to RichEdit, e.g
In VC.7 there is new class for richedit.Go to dialog editor.You'll see "Rich Edit 2.0 Control",this one is for new version.
AlexMarbus wrote:
But there were some errors related to CString as well. (Has that class moved to ATL?)
Not move to ATL,it share with ATL.In MFC6 there where no base class for CString,but here there is CSimpleString that CString derive from that,and there are some additional function here for CString.
Now I can see there are some changes. But I never had any problem with my old CString when I migrate from MFC6 to MFC7.
AlexMarbus wrote:
You have been a big help so far, thanks for that!
Thank you Alex.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|