|
On 32-bit platforms the two data types have the same size hence the cast is harmless. The compiler warns because this can be an issue when you port the code to 64-bit platforms.
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]
|
|
|
|
|
now, I can also use these code
<br />
LONG64 l64Temp = (LONG64)m_hWnd;<br />
long lTemp = static_cast<long>(l64Temp);<br />
</long>
|
|
|
|
|
Why would you use that code?
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]
|
|
|
|
|
hanlei0000000009 wrote: long l = (long)h; // warning
convert that back to HWND after converting to LONG, if it is working than it is fine. i too have used this technique many times, and face to problem.. wishes same for you!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
|
To expand on CPallini's response [^]- you can turn off the "unsafe on 64-bit platform" warnings. Propeties => Configuration Properties => C / C++ => General => Detect 64-bit Portability Issues.
Judy
|
|
|
|
|
|
Hi All,,
I am developing Windows service using VC++ Template which will start before user login. And I want to catch that logon event into my Service.
As my thread subject indicates, I want to use ISensLogon structure into my Application.So, I have to include Sensevts.h file into my project file.And when I include this header file I get lots of errors.And these errorscome into the Sensevts.h file.
I am confused with this problem, is there any mistake which I do or I have link Sensevts.tlb type library into my project which is related to this header file.
Thanks in Advance.
Ashish Bhatt,
System Developer,
Avinashi System Pvt. Ltd.
|
|
|
|
|
I found that none of these masters are able give this simple question or not interested in my question!!!!!!!!!!!!!
Anyway I want to give some more description about my problem that I found from googling that I can add this SENS type library from the reference option in the project.
I tried this ....
Project properties->Common propeties->reference->Add new reference->COM Tab
here we can add this type library.But in my case I did not find this library into this list.
I want to ask you that I will have to include sens.dll into my project which is related to this library.
Plz. help me I am stuck in my work.
Thanks in Advance.
Ashish Bhatt,
System Developer,
Avinashi System Pvt. Ltd.
|
|
|
|
|
When that header is included in a managed app, you get the errors you mention. When it is included in a straight C++ app, it works fine. The included template creates a managed app, therefore ... I don't do managed apps so I can't tell you how to include Platform SDK functionality in your service. If you don't need the managed stuff, make your service pure C++.
Judy
|
|
|
|
|
Howdy y'all.
Does anyone happen to know off-hand if there's any way to tap into a system message for when the WorkingArea of the primary screen changes? I'm actually using .NET but should be able to do something with interop.
To see what I mean, simply change the windows vista sidebar "always on top" setting. This results in the WorkingArea changing.
(In the worst case I suppose I could poll every few seconds, but for something that is only going to happen once in a long while it seems wasteful.)
Secondly, does anyone know how to "reset" the workingarea to what it should be, minus any alterations? I am adjusting the working area to allow for an RSS ticker to be displayed on-screen, even when other windows are maximized. So far it's working great, except that the calculation sometimes gets thrown off, and it appears in the wrong location, or doesn't reset itself properly.
In general, if anyone has experience working with the WorkingArea or WORKAREA as I guess it's called in Win32, please let me know some tricks of the trade.
Muchas gracias,
Logan
{o,o}.oO( Want a great RSS reader? Try FeedBeast! )
|)””’) ( Check out my profile for a special members deal! )
-”-”-
|
|
|
|
|
Aha, I just discovered C# does Shell[^] here on CP, which of course I should have searched for first. I'll read through this and see if it answers my questions and/or teaches me a few new tricks.
Feel free to post any comments in the meantime...
{o,o}.oO( Want a great RSS reader? Try FeedBeast! )
|)””’) ( Check out my profile for a special members deal! )
-”-”-
|
|
|
|
|
Is this a C# question? Have you used Spy++ on the desktop to see what messages it receives after the Sidebar changes?
"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
|
|
|
|
|
Actually it's a Win32 question, but I didn't see a specific forum.
{o,o}.oO( Want a great RSS reader? Try FeedBeast! )
|)””’) ( Check out my profile for a special members deal! )
-”-”-
|
|
|
|
|
logan1337 wrote: Actually it's a Win32 question...
Is this a new language , or are you referring to some IDE?
"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
|
|
|
|
|
Win32's anything but new. It's the governing underlying API of the Windows operating system since (I think) Windows 95.
{o,o}.oO( Want a great RSS reader? Try FeedBeast! )
|)””’) ( Check out my profile for a special members deal! )
-”-”-
|
|
|
|
|
Really? I would've never known.
"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
|
|
|
|
|
You learn something new everyday.
{o,o}.oO( Want a great RSS reader? Try FeedBeast! )
|)””’) ( Check out my profile for a special members deal! )
-”-”-
|
|
|
|
|
Even an old dog can learn new tricks when taught with a taser...
Methinks your tongue wasn't in cheek enough... Have you tried sellotape?
Iain.
|
|
|
|
|
LOL sorry, I didn't notice you were an MVP! Haha that makes quite a difference in the mind's eye vs. a n00b.
{o,o}.oO( Want a great RSS reader? Try FeedBeast! )
|)””’) ( Check out my profile for a special members deal! )
-”-”-
|
|
|
|
|
As far as that goes, and to answer my own question, I found what appears to be the information I was looking for to begin with:
Using Application Desktop Toolbars[^]
Logan
{o,o}.oO( Want a great RSS reader? Try FeedBeast! )
|)””’) ( Check out my profile for a special members deal! )
-”-”-
|
|
|
|
|
I have a RichEditCtrl in a dialog box in a MFC program. While it is a simple matter to print from this, I would also like to implement a print preview. Is there any guidance available on how to do this?
|
|
|
|
|
See this[^] article is helpfuls for you,I didnt see it.
|
|
|
|
|
There is a great printing class here:
http://www.codeguru.com/cpp/w-p/printing/article.php/c2955/
I have used it along time. One problem I have, which is really
driving me crazy, is that I have a standard 8.5 x 11 sheet of paper
and cant print text past 10.5". I tried adjusting the SetBottomMargin()
function to:
pPage->SetBottomMargin(-1)
pPage->SetBottomMargin(0);
pPage->SetBottomMargin(11);
but none of them work. The text just doesnt print if it is too low
on the page.
How can print text that is close to the edge of the paper using this
class or not using this class?
Please, any response any one can give me will be greatly appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
hi,
i suppose that it should be changed into
double CPage::SetBottomMargin(double w)
{
int temp=m_PrtDesc.rc.bottom;
if(w > 0)
m_PrtDesc.rc.bottom=ConvertToMappedUnits(w,VERTRES);
if(w==-1)
m_PrtDesc.rc.bottom=m_PrtDesc.n_maxLength;
//m_PrtDesc.rc.right=m_PrtDesc.n_maxLength; //previous line
return ConvertToInches(temp,VERTRES);
}
and calling pPage->SetBottomMargin(-1);
|
|
|
|