|
Petr P. wrote:
UINT paramL; // place for x-coordinate
UINT paramH; // place for y-coordinate
I don't know if what you stated above is correct. Under my system I follow this logic:
WPARAM is defined as UINT_PTR which in turn is defined as unsigned int
LPARAM is defined as LONG_PTR which in turn is defined as long
UINT is defined as unsigned int
And also under my system sizeof(long) == sizeof(unsigned int). This means that you have enough space in the EVENTMSG structure being passed in to store everything. I doubt there would be any conversion nessisary.
I think all you would have to do is store your WPARAM and LPARAM in paramL and paramH.
Greba,
My lack of content on my home page should be entertaining.
|
|
|
|
|
Interesting idea.
I have tried to put contents of wParam words to high-order words of EVENTMSG ParamL/ParamH .
Regrettably it does not work. System works with X/Y coordinates only .
So problem pending.
BR
Petr
|
|
|
|
|
Problem is solved. I don't find better way, than to mix WH_JOURNALRECORD hooks with interseption of WM_MOUSEWHEEL and sinchronising this messages on play.
|
|
|
|
|
Hello
I want becom the handle of the desktopbackround so that i can set a playet movie behind the icon´s of the desktop.
thank you for help and sorry for my bad english.
Regards Nico
|
|
|
|
|
|
I now this and this is the handle for the desktop but if i draw in this window and display it i don´t can see the icons on the desktop. I want that the video plays in the backround so that the user can see all of the icon´s on the desktop normal.
|
|
|
|
|
I see.
Apologies for having insulted your knowledge there.
|
|
|
|
|
My ATL service crashes when it is being stopped by the system (its startup mode is "automatic"). This happens only if the service is running on Windows XP and is being stopped automatically (not manually).
The source code:
HRESULT CMyServiceModule::PostMessageLoop()
{
RevokeClassObjects();
LogEvent(_T("Service stopped"));
CoUninitialize();
SetServiceStatus(SERVICE_STOPPED); // <--- this line causes the crash
return CAtlServiceModuleT<clegnlicenceservicemodule, ids_servicename="">::PostMessageLoop();
}
The debugger shows that m_hServiceStatus is NULL.
Thank you in advance for any ideas.
|
|
|
|
|
I am having a problems printing the output for this program. With C++ when I compile and run the program I am left with an exe file. How do I incorporate code to print out the output? Below is the code. Where do I enter it within the program? Basically I want to be able to print the output.
//#include
int main()
//(int,char*)
//{
//ofstream printer ("1pt1:");
//Printer <<"test"<<endl;
//return o;
//}
{
int c;
double fee;
double total;
char a ='y', ans;
string input;
int number;
while (a =='y'|| a =='Y')
{
cout << "\nChoose from options below.\n";
cout << "\nEnter A to calculate total RWA cost.\n";
cout << "\nEnter B to calculate RWA base estimate.\n";
cout << "\nEnter your choice, then press the enter key:\a";
cin >> ans;
cin.ignore();
if (ans == 'A' || ans == 'a' ){
cout << "\nEnter RWA Base Estimate, then press the enter key:$\a";
cin >> input;
cout << "You entered:$" << input << endl;
int pos = input.find(',');
while (pos != -1)
{
input.replace(pos, 1, "");
pos = input.find(',');
}
number = atoi(input.c_str());
fee = number * 0.04;
cout << fixed;
cout.precision(2);
cout << "4% Management Fee:$" << fee <<"\n";
total = number + fee;
cout << fixed;
cout.precision(2);
cout << "Total:$" << total <<"\n";
if (total >= 1 && total <= 2499)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.1 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.1) <<"\n";
}
if (total >= 2500 && total <= 9999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.09 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.09) <<"\n";
}
if (total >= 10000 && total <= 24999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.08 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.08) <<"\n";
}
if (total >= 25000 && total <= 49999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.07 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.07) <<"\n";
}
if (total >= 50000 && total <= 99999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.05 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.05) <<"\n";
}
if (total >= 100000 && total <= 299999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.03 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.03) <<"\n";
}
if (total >= 300000 && total <= 999999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.015 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.015) <<"\n";
}
if (total >= 1000000 && total <= 2425000)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.005 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.005) <<"\n";
}
}
if (ans == 'B' || ans == 'b') {
cout << "\nEnter Total RWA Cost, then press the enter key:$\a";
cin >> input;
cout << "You entered:$" << input << endl;
int pos = input.find(',');
while (pos != -1)
{
input.replace(pos, 1, "");
pos = input.find(',');
}
number = atoi(input.c_str());
fee = number * 0.04;
cout << fixed;
cout.precision(2);
cout << "4% Management Fee:$" << fee <<"\n";
total = number - fee;
cout << fixed;
cout.precision(2);
cout << "Total:$" << total <<"\n";
if (total >= 1 && total <= 2499)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.1 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.1) <<"\n";
}
if (total >= 2500 && total <= 9999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.09 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.09) <<"\n";
}
if (total >= 10000 && total <= 24999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.08 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.08) <<"\n";
}
if (total >= 25000 && total <= 49999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.07 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.07) <<"\n";
}
if (total >= 50000 && total <= 99999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.05 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.05) <<"\n";
}
if (total >= 100000 && total <= 299999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.03 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.03) <<"\n";
}
if (total >= 300000 && total <= 999999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.015 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.015) <<"\n";
}
if (total >= 1000000 && total <= 2425000)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.005 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.005) <<"\n";
}
}
cout <<"********************************************************************""\n";
cout <<"* Rate Range Subtotal Max. Range *""\n";
cout <<"* .01 .1 $2,499 $250.00 $250.00 *""\n";
cout <<"* 0.09 $2,500 $9,999 $675.00 $675.00 *""\n";
cout <<"* 0.08 $10,000 $24,999 $800.00 $1,200.00 *""\n";
cout <<"* 0.07 $25,000 $49,999 $1,750.00 *""\n";
cout <<"* 0.05 $50,000 $99,999 $2,500.00 *""\n";
cout <<"* 0.03 $100,000 299,999 $6,000.00 *""\n";
cout <<"* 0.015 $300,000 $999,999 $10,500.00 *""\n";
cout <<"* 0.005 $1,000,000 $2,425,000 $7,125.00 *""\n";
cout <<"********************************************************************""\n";
cout<<"Would You Like to Perform Another Calculation (Y/N)?\a";
cin>> a;
}
cout <<"\nGoodBye\n";
getchar();
return 0;
cin >> c;
}
Old Program Below
// RWA's and Charges
#include <iostream>
using std::cout;
using std::cin;
using namespace std;
//using::endl;
int main()
{
int choice, c;
float amount,total,overhead;
cout << "\nChoose from options below.\n";
cout << "\nEnter 1 to calculate total RWA cost.\n";
cout << "\nEnter 2 to calculate RWA base estimate.\n";
cout << "\n\t\tEnter your choice, then press the enter key:";
cin >> choice;
if (choice == 1){
cout << "\nEnter RWA Base Estimate, then press the enter key:$";
cin >> amount;
overhead = amount * 0.04;
cout << "Total Overhead is:$" << overhead <<".\n";
total = amount + overhead;
cout << "Total:$" << total <<".\n";
if (total >= 1 && total <= 2499)
{
cout << "Cost is:$" << total + (total * 0.1) <<".\n";
}
if (total >= 2500 && total <= 9999)
{
cout << "Cost is:$" << total + (total * 0.09) <<".\n";
}
if (total >= 10000 && total <= 24999)
{
cout << "Cost is:$" << total + (total * 0.08) <<".\n";
}
if (total >= 25000 && total <= 49999)
{
cout << "Cost is:$" << total + (total * 0.07) <<".\n";
}
if (total >= 50000 && total <= 99999)
{
cout << "Cost is:$" << total + (total * 0.05) <<".\n";
}
if (total >= 100000 && total <= 299999)
{
cout << "Cost is:$" << total + (total * 0.03) <<".\n";
}
if (total >= 300000 && total <= 999999)
{
cout << "Cost is:$" << total + (total * 0.015) <<".\n";
}
if (total >= 1000000 && total <= 2425000)
{
cout << "Cost is:$" << total + (total * 0.005) <<".\n";
}
}
if (choice == 2) {
cout << "\nEnter Total RWA Cost, then press the enter key:$";
cin >> amount;
overhead = amount * 0.04;
cout << "Total Overhead is:$" << overhead <<".\n";
total = amount - overhead;
cout << "Total:$" << total <<".\n";
if (total >= 1 && total <= 2499)
{
cout << "Cost is:$" << total - (total * 0.1) <<".\n";
}
if (total >= 2500 && total <= 9999)
{
cout << "Cost is:$" << total - (total * 0.09) <<".\n";
}
if (total >= 10000 && total <= 24999)
{
cout << "Cost is:$" << total - (total * 0.08) <<".\n";
}
if (total >= 25000 && total <= 49999)
{
cout << "Cost is:$" << total - (total * 0.07) <<".\n";
}
if (total >= 50000 && total <= 99999)
{
cout << "Cost is:$" << total - (total * 0.05) <<".\n";
}
if (total >= 100000 && total <= 299999)
{
cout << "Cost is:$" << total - (total * 0.03) <<".\n";
}
if (total >= 300000 && total <= 999999)
{
cout << "Cost is:$" << total - (total * 0.015) <<".\n";
}
if (total >= 1000000 && total <= 2425000)
{
cout << "Cost is:$" << total - (total * 0.005) <<".\n";
}
}
//return 0;
cin >> c;
}
|
|
|
|
|
Hi
What happens if you run this code;
ofstream printer("lpt1:");
printer << "test" << endl;
If that prints something on your printer, you're in business and can simply change all instances of 'cout' to 'printer', with above lines added at beginning of the main function.
HTH
Martin
|
|
|
|
|
Thanks Martin,
I will try your recommendation and see what happens. I did not know you had to change all couts to printer. I am a beginner and have been working with this for awhile. I have had many recommendations and probably due to my inexperience I was not able to figure out what was going on.
|
|
|
|
|
From a command prompt, redirect the output of your program to the printer by typing:
program > prn BTW, for future posts, there is no need to post all of your code, only the relevant parts. Asking folks to wade through a bunch of code is a sure-fire recipe for getting little to no help.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Does anybody know of an API for Digital Cameras?
I am the handsome one in the crowd.
|
|
|
|
|
|
hai all,
when i connect a Oracle with vc, after closing the application window i am getting "User Break point at &72ff234" an error in a messagebox , and it automatically opens an assembly program and arrow points to the 72ff234 line.
i am getting this only while closing the application after using the database connection. i tested the program , with out connecting to database, i close the app. windows.. i didnt get the error ...
how clear it...
thanks in advance...
Surya Prakash
|
|
|
|
|
It sound like you have forgotten to disconnect from the database and clean up the appropriate database handles before exiting your application.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Previously (ie. VC++ 6), the Profiler was only included in the Professional and Enterprise versions. Is the Profiler included in VC++ 2003 Standard or do you have to purchase Visual Studio Pro 2003 (since it's not possible to purchase VC++ 2003 Professional separately) ?
|
|
|
|
|
|
How can i implement one function to get the file size of a file which takes pointer to the file path?Please help..
|
|
|
|
|
Hi
Using Win32, you can use FindFirstFile and inspect the WIN32_FIND_DATA structure returned from that (and call FindClose when you leave).
In .NET, that information is available from the FileInfo class.
HTH
Martin
|
|
|
|
|
Why not use GetFileSize() ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
The function should take only the constant pointer to the path of the file..
|
|
|
|
|
Ok, what's wrong with:
DWORD SizeOfFile( LPCTSTR lpszFile )
{
DWORD dwSize = 0;
HANDLE hFile;
hFile = CreateFile(lpszFile, 0, 0, NULL, OPEN_EXISTING, ...);
if (hFile != INVALID_HANDLE_VALUE)
{
dwSize = GetFileSize(hFile, NULL);
CloseHandle(hFile);
}
return (dwSize);
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Try
CFile myFile(lpszFileName, CFile::modeRead);
int len = myFile.GetLength();
Some people see things that are and ask, Why? Some people dream of things that never were and ask, Why not? Some people have to go to work and don't have time for all that ...
Author: George Carlin
|
|
|
|
|
Hello!
I've got a property page, containing a tab view. The tab pages are a bit brighter than the normal dialogs, which seems to be correct. But unfortunately all the static controls in this tab page have the standard gray color, i.e. the one of the dialogs and not the one of the tab page.
How can I make the statics look correct?
Best regards
|
|
|
|