|
Hello, There.
I changed tool, VC++2008 but I had a error code.
How can i repair this error?
Error Message
=======================
Error 1 error C2440: 'static_cast' : 'void (__thiscall CDisplayRect::* )(WPARAM,LPARAM)' to
'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)' Can't change.
Maked Message.
=======================
// for Windows messages #define ON_MESSAGE(message, memberFxn) \ { message, 0, 0, 0, AfxSig_lwl, \ (AFX_PMSG)(AFX_PMSGW) \ (static_cast< LRESULT (AFX_MSG_CALL CWnd::*)(WPARAM, LPARAM) > \ (memberFxn)) }
Calling Function.
===================
ON_MESSAGE(WM_DISPLAY_RECT, DisplayRect);
Thank you
|
|
|
|
|
Well this is due to prototype difference in ON_MESSAGE macro message map function. Earlier this function returned a void now it returns an LRESULT .
So you got to change the prototype from
void DisplayRect(WPARAM, LPARAM)
to
LRESULT DisplayRect(WPARAM, LPARAM);<br />
Another one that has changed is ON_WM_ACTIVATEAPP() , whose last parameter used to be HTASK but now it's DWORD .
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Hi,
I am using the following statement. It works fine for debug mode but not for release mode. whats the problem.
double dServerAppVersion = _wtof(strServerAppVersion);
Please tell me.
Thanks In Advance
|
|
|
|
|
Possibly the debug build defines the _UNICODE symbol while the release build NOT defines 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]
|
|
|
|
|
Hi,
I want to display a scrollbar in my MFC ActiveX Control. How do i do this? Do i have to create a scrollbar control or is there a way i can specify a scrolling window style or maybe a scrollable view i can work with?
Thanks for the help
Regards
Jagannathan
|
|
|
|
|
SandipG :) wrote:<br />
<br />
Why dont you create a stitched bitmap first and then draw this bitmap on device context.<br />
i mean <br />
Graphics gr(bmpTemp)<br />
.... Stitching code.<br />
<br />
Graphics gr(hDC)<br />
RatateTransform()...<br />
DrawImage(bmpTemp)..<br />
<br />
Does it make sense?? <br />
<br />
<br />
Regards,<br />
Sandip.
I received a reply from Sandip but I'm having hard time translating it to code. The process is what i needed it's just that I can't make it work.
First I haven't found a constructor for
Graphics gr(bmpTemp)
and for function
DrawImage(bmpTemp)..
I'm not that good in GDI so I hope somebody can help me.
It will be a big help if you reply. Thanks.
|
|
|
|
|
TooShy2Talk wrote: Graphics gr(bmpTemp)
(One overload of )The Graphics constructor accepts a pointer to a CImage object.
DrawImage (as well as RotateTransform ) is a method of the Graphics class.
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]
|
|
|
|
|
But how will I declare bmpTemp?
?????????<br />
Graphics gr(bmpTemp)
I'm confused on how will I declare this one.
Can yu please show. Thank you.
|
|
|
|
|
Did you look at the link i gave.
It shows a graphics constructor which accepts Image class object as a parameter.
Bitmap class is derived from the Image class. So when you will pass the Bitmap object to the graphics constructor it would invoke that constructor.
Now declaration of bitmap.
You can simply create a canvas bitmap which will hold your other bitmaps someting like this.
Bitmap *bmpTemp = new Bitmap(iWidth,iHeight);
Is it clear now???
Regards,
Sandip.
|
|
|
|
|
I have tried
Image *bmpTemp;<br />
Graphics gr(bmpTemp);<br />
.... stitching here
but result to following error,
bmpTemp is being used without being defined.
I don't really know how to implement it.
|
|
|
|
|
For instance
CImage bmpTemp;
bmpTemp.Create(640,400,32);
Graphics gr(& bmpTemp);
Bitmap bmpTemp(640,400, PixelFormat32bppRGB);
Graphics gr(& bmpTemp);
Did you follow the link provided by
Sandip?
Have you a good C++ tutorial?
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]
modified on Tuesday, September 9, 2008 4:41 AM
|
|
|
|
|
Yes, I have tried also
CImage bmpTemp;
but there is no intellisense for .Create()
bmpTemp.Create();
I have tried including altimage.h but it comflicts to other class I'm using.
Or is there other header to include?
|
|
|
|
|
TooShy2Talk wrote: CImage bmpTemp;
I dont know if CImage is derived from Image.
But you can use
Image *bmpTemp = new Image(iWidth,iHeight);
Did you try this??
I don't know why are you facing so much trouble in this
Previously you were using hDC directly to draw your bitmaps on.
Now you just have to replace this hDC with temporary bitmap..
and once you finish all your operations do following
Graphics gr(hDC);
gr.RotateTransform(..);
gr.DrawImage(bmpTemp);
Is it clear?
Regards,
Sandip.
|
|
|
|
|
SandipG wrote: But you can use
Image *bmpTemp = new Image(iWidth,iHeight);
I received an error on this,
I think there is no constructor available.
|
|
|
|
|
TooShy2Talk wrote: Image *bmpTemp = new Image(iWidth,iHeight);
I am nt sure if constructor is available for the Image class but it is surely there for Bitmap.
What is the problem you facing in following code.
Bitmap *bmpTemp = new Bitmap(iWidth,iHeight);
Graphics gr(bmpTemp);
If you still have problems
Please Look at this section on CP GDI+[^]
I hope it will help you..
Regards,
Sandip.
modified on Tuesday, September 9, 2008 4:40 AM
|
|
|
|
|
You're right: I made confusion, I'm sorry about.
I've modified my previous post. Hope it helps.
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]
|
|
|
|
|
Finally, it WORKS.
Thank you very much.
It's a big help.
Till my next question.
|
|
|
|
|
I'm very sorry for the delay due to my mistakes.
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 have successfully created the following lines
CPallini wrote: CImage bmpTemp;
bmpTemp.Create(640,400,32);
But encountered an error on the line below.
CPallini wrote: Graphics gr(& bmpTemp);
Error is "Cannot convert CImage* to HDC".
|
|
|
|
|
Dear All,
My project requirement is MFC application need to create setup package.I have created the setup package using Inno setup. Im using filters and equipment driver in my applicaion. so i need to connect filter(.bat file) and then driver should be install.
I have connected the filter using below code...
[Files]
Source: "C:\Program Files\Inno Setup 5\reg.bat" ;DestDir: "{app}"
[Run]
Filename: "{app}reg.bat"; Parameters: "/WHATEVER_PARAMS_YOU_NEED"; StatusMsg: "Installing driver..."
But now i want to install .inf (driver)file.How to install the driver in .iss file.
Plz helpme.....
It will be much helpful to me to give some advice on this..
Thank you very much,
Regards
Anitha
|
|
|
|
|
does this link [^] help ?
Regards,
Sandip.
|
|
|
|
|
I installed VS 2005 Pro on a new machine and went to debug an existing application. The ADO calls to query the SQL server DB are taking a REALLY long time, where they run instantly on the old installs. Are there any global settings that will change the debugger performance? I have all the patches installed, right data sources, same connection string, etc. but it won't run quickly.
|
|
|
|
|
Hi all
I am copy file data from source to destination.It is working only for .txt file.Code is here
USES_CONVERSION;
CString FileName;
CString cs;
CString CStrfilename=FileName;
char* charfilename;
charfilename=CStrfilename.GetBuffer();
LPCTSTR lp;
lp=CStrfilename;
PathSkipRoot(lp);
cs = "\\BackUp\\";
cs += PathSkipRoot(lp);
CopyFile(FileName, cs,TRUE);
But when i use
AfxMessageBox(cs) then it is working for .exe. So can any one tell me where i am wrong?
Plz help me
|
|
|
|
|
|
vcprog wrote: I am copy file data from source to destination.It is working only for .txt file
What happens with other file types?
vcprog wrote: CopyFile(FileName, cs,TRUE);
Why don't you check the return value (and call GetLastError on failure?)?
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]
|
|
|
|