|
MFC, STUDIO 2008
How to convert CString to int, for example:
CString m_s;
m_s = “1949”;
in i;
i = itoa(m_s); - uncorrectly
char m[5];
strcpy(m,m_s); - uncorrectly
|
|
|
|
|
It's atoi [^]:
CString m_s = _T("1949");
int i = _tstoi(m_s);
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
You are welcome.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all
I have to develop windows device driver for PCI card.Can anybody suggests a starting point for doing it.
Any examples or link
I am having experience in developing a printer driver.
Thanks in advance.
With regards
Deepu
|
|
|
|
|
How to place a Bitmap in the center of a Cdocument document on startup? If tried to find it in codeproject and MSDN but neither shows what I want. I want to place the Bitmap in the center of the document when the program loads(opens). could someone show me code for doing this in MFC? Please.
Thanks in advance. The ID of the Bitmap is IDB_FRACTK.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Look around for a "splash screen" (here or using google...), is that what you mean?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
No this is NOT what I'm looking for. I once saw an article that displayed a Bitmap in the CDocument/View interface, but I've lost it somehow. I'll keep hoping someone has one and meanwhile I'll keep looking.
A C++ programming language novice, but striving to learn
|
|
|
|
|
I'm still not sure what you mean but...did you try overwriting the OnPaint method of your view class (or OnDraw maybe?) and do something like this:
CBitmap bitmap;
bitmap.LoadBitmap(IDB_WHATEVER);
CDC MemDC;
MemDC.CreateCompatibleDC(&dc_of_view);
CBitmap *originalBitmap = MemDC.SelectObject(&bitmap);
BITMAP bitmapInfo;
bitmap.GetBitmap(&bitmapInfo);
CRect Rect;
GetClientRect(&Rect)
dc.BitBlt(Rect.CenterPoint().x - bitmapInfo.bmWidth / 2,
Rect.CenterPoint().y - bitmapInfo.bmHeight / 2,
bitmapInfo.bmWidth,
bitmapInfo.bmHeight,
&MemDC,
0,
0,
SRCCOPY);
MemDC.SelectObject(originalBitmap);
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Yes, that's exactly what I was looking for. Question?: everytime the bitmap gets covered what command do I use to redraw it? (UpdateWindow??)
A C++ programming language novice, but striving to learn
|
|
|
|
|
Once again i am not sure what exactly do you mean but to trigger redrawing of your view you can either use RedrawWindow[^] or InvalidateRect[^] (maybe in conjunction with UpdateWindow right after).
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Thanks again.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Windows has triggered a breakpoint in Gobang.exe.
This may be due to a corruption of the heap, which indicates a bug in Gobang.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while Gobang.exe has focus.
The output window may have more diagnostic information.
The text above is the message That show me when i debug my project.
Do any body ever run across problem like this,help me.thanks in advance.
|
|
|
|
|
Hi all,
I want to use SendMessage(). Through CMainFram class object it works fine but using CWinApp class as base class, it doesn't work. It is not giving any error, but SendMessage() is not called.
I use the following code.
CSampleCMSApp * poApp = (CSampleCMSApp*)AfxGetApp();
SendMessage((HWND)poApp,WM_DISP,0,(long)recv_data);
If i use poApp->SendMessage((HWND)poApp,WM_DISP,0,(long)recv_data);, it give error as
error C2039: 'SendMessageW' : is not a member of 'CSampleCMSApp'.
Can i use SendMessge for the class which is derived from base class as CWinApp?.
If yes, how can i do this.
If no, why i can't?
Please reply.
Thanks,
Abhijit
|
|
|
|
|
There are two versions of SendMessage .
One that is global and one that is a member of the CWnd class.
You are getting the error because CWinApp does not directly or indirectly inherit from CWnd , whereas CFrameWnd does inherit from CWnd .
You can use the CWnd member like so
AfxGetMainWnd()->SendMessage(WM_DISP, 0, (LPARAM)recv_data);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi,
If possible please let me know where can i download book for
MFC written by petzold....i have googled but i didn"t find it...
|
|
|
|
|
You BUY it from a bookshop.
Or maybe the equivalent of amazon.
If you want to steal other people's idea, this is the wrong forum for you.
If you want to buy a downloadable version, I'd encourage you to edit your original question too.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
here u can: www.cpallini.illegal.copiez.of.copyrighted.bookz.com
BTW: you're entitled to use the above site only if your request is urgentz.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I heared your site has everything I need an elephant can I buy it of your site(of course its urgentz PLZ)?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
You know it is www.cpallini.free.elephantz.com, so, why paying for it?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Well in fact I dont want to pay any thing for it I want to know does it pay any thing for me?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Google is best place for search it.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
The last thing you want it an MFC book written by Petzold. I learned how to program windows from the guy's books, but his books on MFC and C# stunk. My two specific complaints are that he has complete disdain for the Visual Studio tools and his examples are very contrived and hard to translate to the real world.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I have used IConverterSession Interface. I declared in my project.
I also defined these two GUIDs CLSID_IConverterSession and IID_IConverterSession.
when i compile, it shows following errors.
error LNK2001: unresolved external symbol _CLSID_IConverterSession
error LNK2001: unresolved external symbol _IID_IConverterSession
fatal error LNK1120: 2 unresolved externals
I dont know how to resolve this.
Regards,
Swapnil
|
|
|
|
|
As far as i know,This is because you project short of some dll file or dib file,you may find the msdn to find it yourself,it will be easy,good luck.
|
|
|
|