|
I'd not seen rentacoder - the sad thing is people there are offering bids to provide solutions that are available here for free..... If people can't use a search engine they are unlikely to be able to impliment the solutions IMHO.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
Do they know what a compiler/assembler does? Beside making virusses come to live?
TMB!
|
|
|
|
|
hi all,
I'm developing a program based on ms word 2000 via automation.
everything seems to be going fine, but I get an error every time I try to save a document, open one or add a new one.
these entries in the menu are disabled (grayed), otherwise then that I can run the speller, auto- text, or anything else (like running a macro).
btw, when I try to call _document.SaveAs I get an exception.
does anyone has a clue? all of the official examples from the msdn ignore the problem (and they are vb, I develop using VC++ with SP5
thanks anyone for helping,
Omri W.
|
|
|
|
|
I need to create a dialog based app that does basically one thing, calculate the total pay from 2 fields
-i have 3 edit box's, 1 for hours worked, 1 for pay rate and the third for the total pay.
-what it has to do is take whatever numbers i put into the first 2 fields, then by clicking a button multiplay them together and put the answer into the third field.
i've seen calculation code for console based but it looks completely different then what i use for dialog. i know it must be simple but to me as a beginner, it's rather confusing. please help
|
|
|
|
|
Since you have a console app that performs the desired function your problem then seems to be how to get the numbers from the edit boxes and put the result into the third edit box.
Look at the documentation for Dialog Data Exchange (DDX) and UpdateData.
|
|
|
|
|
Kron,
I'm not sure what parts you are finding confusing but the app you want is so simlple here's a quick walkthrough of how to make it in Visual C++; (No I/O control or formating/error checking etc) You should be able to spot where you went wrong.
Create a new Project - MFC AppWizard (exe)
Add the 4 controls you need ...
3 edit boxes and a button
Right click each one in turn and in their properties/general change the IDs to :
IDC_HOURS
IDC_RATE
IDC_PAY
IDC_CALC (for the button)
Now again right click one o fthe controls again and this time go to the ClassWizard.
For the 3 edit controls you want to add a variable and associate it with the edit box: In ClassWizard select the "Member Variables" tab then - ( example for "Hours" box... )
Highlight "IDC_HOURS" in Control IDs column.
Click "Add Variable"
Complete Member variable name as "m_Hours"
Make sure "Value" is selected in Category drop-down list.
Select "float" in "Variable Type" drop-down list.
Click "OK"
...do the same for IDC_RATE and IDC_PAY Controls IDs.
Now select the Message Maps tab on the AppWizard.
Highlight IDC_CALC in the Object IDs list
Highlight BN_CLICKED in the "Messages" list
Click "Add Function"
Click "Edit Code"
This will take you to the code at the newly created ::OnCalc()function.
Here insert the 3 lines:
UpdateData(TRUE);
// the above line transfers the input typed in the IDC_HOURS
// box and IDC_RATE box into the variables m_Hours and m_Rate
m_Pay = m_Rate * m_Hours;
// This does the work
UpdateData(FALSE);
// This causes newly calculated contents of m_Pay to be
// displayed in the IDC_PAY edit box.
Compile and run!
Hope that helps.
Steve T.
|
|
|
|
|
i dont know why but my teacher seems to think i should know this stuff already when he hasn't even explained floating point yet for decimals. i had to buy a book and find it there. another problem i'm having with this is, i have to now put in 2 more edit fields for name and lastname and make a button that clears ALL fields. i thought i had it but i get an error telling me it can't convert str to float and vice versa. is there a universal clear command that clears all fields in the program regardless of the contents?
|
|
|
|
|
1. Create a new project under VC++ using the project wizard and make it a dialog based application.
2. Go into the resource and add the edit controls you need and a button to multiply. Use names such as IDC_EDIT_RATE, IDC_EDIT_HOURS and IDC_EDIT_RESULT for your edit boxes.
3. Go into classwizard and to the 'member variables' add a new variables to the controls. This gives you an easy way to get to the data in the edit controls. So you should create some variables such as m_editRate, m_editHours and m_editResult.
4. Goto the 'message maps' tab again in classwizard. Select the button control from the list onthe left. Select the BN_CLICKED message, and create a function called OnButtonClick();
5. Goto this function in the code and add the following:
----------------------
CString sRate;
m_editRate.GetWindowText( sRate );
CString sHours;
m_editHours.GetWindowText( sHours );
CString sResult;
m_editResult.GetWindowText( sResult );
float fRate = atof( sRate );
float fHours = atof( sHours );
float fResuls = fRate*fHours;
CString sResult;
sResult.Format( "%f", fResult );
m_editResult.SetWindowText( sResult );
----------------------
You'll have to include the right header to use atof() (see the help file).. I can't remember it offhand.
Well I hope that will get you started.
Philip
=)
|
|
|
|
|
I'm trying to get the background color of the search box on my guestbook to become transparent, or to match the .jpg background I'm using for the entire page. Is there a color code # I can use to achieve transparency for the background color of this search box so it will match the rest of my page? Thanks in advance.
|
|
|
|
|
|
If you can use an IE-specific solution, create a DIV and set it's contenteditable attribute to true - that'll make it work like a textbox. It's background is transparent by default, so you don't have to do anything more. You shall have to get what the user entered from its innerText property. see the sample below...
If you have IE 5.5 or better, you can edit this text.
"A surprise to be sure, but a welcome one."
- Senator Palpatine
|
|
|
|
|
Hi All,
i want to write a win 32 application which will clear the
History folder of internet explorer. This should support IE versions from 4.x to 5.5 and windows 9.x,NT,Me,XP.
Is there any win 32 API or ready made code example for this
Plz..... i need it very urgently...
Thanx in advance
archana
archana kirane
Sr. Software Engineer
|
|
|
|
|
How much is the code worth to you?
|
|
|
|
|
|
Does not meet the requirments. IUrlHistoryStg only works for IE 5.5 or above and WinMe & Win2K or above.
|
|
|
|
|
I think MSDN's documentation is incorrect there. Those interfaces have been included since visual studio 6. I've been able to use them on Win95 and IE 4.0 (I think).
|
|
|
|
|
Is it so?
as i tried with the IUrlHistoryStg2 with WinNT4.0 and IE 5.5 but it not working . Below is the code i tried.
IUrlHistoryStg2 * pHistory;
HRESULT hRes;
CoInitialize(NULL);
hRes = CoCreateInstance(CLSID_CUrlHistory, NULL, CLSCTX_INPROC_SERVER,
IID_IUrlHistoryStg2, (LPVOID *)&pHistory);
if (SUCCEEDED(hRes))
{ pHistory->ClearHistory();
pHistory->Release();
}
CoUninitialize();
return hRes;
what could be the problem?
thanx and rgds
archana
|
|
|
|
|
This code looks good to me. Is it the CoCreateInstance or the 'ClearHistory()' that fails?
|
|
|
|
|
ammm one doubt is there...
do "today" folder should also get cleared using this method????
As, in my case it's not getting cleared. And i need to clear it.
Thnax in adv.
archana
|
|
|
|
|
I'm not sure why the 'today' folder wouldn't get cleared. I guess you could use IUrlHistoryStg to enumerate and delete the URLs that remain, but that seems like overkill.
|
|
|
|
|
well, i think it was the problem as my browser instances were open. I will tackel that now.
Could u tell me something .....changing the subject bit Now it's about deleting History files for Netscape 4.7 and 6.0 .
My research told me that...NS 4.7 saves it's history in netscape.hst in user profiles but i didn't get any file of named netscape.hst in NS 6.0 instead i got history.dat but it is not containing URLs. So, do u know where actually NS 6.0 stores it's visited URLs . Is it cookies.txt?
I doubt but...and even it stores it's entries in the address bar(drop down combobox) in different way or in different location i think...i didn't get that also....if u know details of NS 6.0 history files then plz do let me know...
Thanx in advance
archana
|
|
|
|
|
I'm afraid I don't know how to access Netscape's history info.
|
|
|
|
|
Thanx
IUrlHistoryStg2 is working
thanx a lot
archana
|
|
|
|
|
To get text under mouse cursor, i think we much hook
some API such as TextOut, but I can't hook any API function which have address above 2Gb. Anybody can help me?
Please email me if you can. phamthienan@yahoo.com
|
|
|
|
|
Hi,
I'm in search of a sample of creating a MAPI preprocessor. I've taken a look at the one in the Platform SDK, but am a little confused as to what *basics* I need to have done..
The same preprocessor in the SDK is full of a lot of stuff which might probably be unneccessary for what I want to do..
thanks in advance,
Erik
I hit faked him with my win32 API .chm and the peabrain goes for it. I follow it up with a salvo of left's and right's sending him down hard. It's lunch time and he's getting a Champ Sandwhich Special. I said, How's that Mr. VB?! Is that 'I wanna use COM in that Server enough for you?!'
...Ever since then, I've been the Champ.
|
|
|
|