|
is anybody could explai me how i could create an automation which could simply open a specific workbook, a specific worksheet, update the data(using shift+F9) and close it. I would like to create this automation so that i could have a button in my dlg box app, when pushed it will update the data i need for my calculations???
thanks in advance
gerald
|
|
|
|
|
Look in the MSDN Article ID Q192348
You can find it all that you need, the explanetion is for Excel 97 but it can help you with other versions..
Best regards. And Happy Weekend
and for ever
Carlos Antollini.
|
|
|
|
|
Hello,
When an application states it requires 32MB of memory to run, how did the developer determine this? Is there a clear cut way or are they just guessing? Any ideas?
Thanks!
Derek
|
|
|
|
|
I just guess. The total memory ammount depends on what other software you are running.
There are articles on MSDN that will tell you how to do this, but, in a real world, just try your software on different configurations and recommend to your users what they feel comfortable.
Furor fit laesa saepius patientia
|
|
|
|
|
I have a dlg application in which i would like to put 2 check box. For each check box there is a boolean variable, i would like to use those variables so that my app could call the right function when one of this check box is flagged.
But, when i try to compile my code i have this kind of warning message:
warning c4800:"int":forcing value to bool "true" or "false"(performance warning)
So, i don't know if it's really a big pb. Perhaps i should use another type of button as a radio button, i don't know!
Thanks in advance for your help.
gerald
|
|
|
|
|
You can safely ignore this warning, or you can get rid of it by changing the type of variables from bool to int .
|
|
|
|
|
Please, post a code excerpt that raises the warning.
Probably, you're doing something like this:
int b;
b = true;
and you should be doing this:
bool b;
b = true;
Tip: press now the reset button to test your memory.
|
|
|
|
|
first i post the function which use it:
double EuropeanSwaption::CallOrPutEuropeanSwaption(COleDateTime StartDate,COleDateTime SwaptionEndDate,COleDateTime SwapEndDate,double Strike,int BaseAnnuelle,double Nominal,int Periodicity,_variant_t RateTable,_variant_t VolatilitySurface,bool CheckPayeuse,bool CheckReceveuse)
{
double Price;
if(CheckPayeuse==TRUE && CheckReceveuse==FALSE)
Price=CallEuropeanSwaption( StartDate, SwaptionEndDate,SwapEndDate,Strike,BaseAnnuelle,Nominal,Periodicity,RateTable,VolatilitySurface);
if(CheckPayeuse==FALSE && CheckReceveuse==TRUE)
Price=PutEuropeanSwaption( StartDate, SwaptionEndDate,SwapEndDate,Strike,BaseAnnuelle,Nominal,Periodicity,RateTable,VolatilitySurface);
if(CheckPayeuse==TRUE && CheckReceveuse==TRUE||CheckPayeuse==FALSE && CheckReceveuse==FALSE)
AfxMessageBox("Il faudrait peut être faire un choix!!");
return Price;
}
this first function is used in the calculation part.
Now i could show a sample coming from the the dlg code, i just post the line which call the function described above:
m_dlgPrice=eur.CallOrPutEuropeanSwaption(m_dlgStartDate,m_dlgSwaptionEndDate,m_dlgSwapEndDate,m_dlgStrike,m_dlgModeDate,m_dlgNominal,Periodicity,"TauxZCEURO","SurfaceVolatilite",m_dlgPayeuse,m_dlgReceveuse);
where eur is an EuropeanSwaption object, and m_dlgPayeuse, m_dlgReceveuse are the 2 variables linked to the 2 check box put in the dlgbox.
|
|
|
|
|
This is a common error:
TRUE and FALSE are for type BOOL
true and false are for type bool
Try making them consistent and the warning will go away.
Furor fit laesa saepius patientia
|
|
|
|
|
i test it and it works, thanks a lot
|
|
|
|
|
Try using BOOL instead of bool for your variable.
--Mark Terrano
www.ensemblestudios.com
(Creators of the Age of Empires series)
|
|
|
|
|
My print preview is more than one page,what should I do
to print from it and user can see all the print preview pages?
|
|
|
|
|
My ISP (roadrunner) uses DHCP to assign IPs to its customers. My cable modem is connected to a router which is in turn connected to a hub with several machines connected to it.
When I log ontot the router, it can provide me with the IP address assigned by the ISP. Does anyone know of a way to retrieve this IP address WITHOUT using the web browser?
It's a Linksys BFRS-4 router by the way.
Thanks in advance.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Is the router forwarding internet traffic from the ISP gateway, to your local network (192.168.*.*)?
If so, set the gateway on your machine to the router IP. And, make sure that your router, and your cable modem are on different subnets, so that the DHCP in the router can assign your PC's IP at boot time.
*Maybe
Frank
|
|
|
|
|
I think you mis-understood my question.
Here's the setup
ISP --> (mystery IP) router (192.168.1.1) --> my LAN
I want to programatically find out what the "mystery IP" (assigned by my ISP) is from *MY* side of the router (a computer on my LAN).
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote:
I think you mis-understood my question.
Yup...sure did.
Sorry John.
Frank
|
|
|
|
|
|
Hello, the codegurus around the world.;)
Tracert command works on Windows OS, and traceroute works on Linux and Unix OS.
I think that tracert shows your side IP address if you use this from your comp.
On the other hand, if we use this from ISP side, we get the different IP address
to the same machine.
However, the true router has the two NIC cards like the incoming packet side and
the outgoing packet side? So, your LinkSys router may work just like Swith?
If your LinkSys includs the agent of SNMP, you can get IP address from Agent.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
You are talking about the IP of the external interface on your router, right?
AFAIK you are running Linux, which actually might solve your problem
At a work I had a couple of years ago we found out a funny thing, you can use two different protocols to traceroute. ICMP and UDP, one of the protocols shows the internal IP, the other shows the external IP of routers. I can't remember which one shows what.
Linux uses UDP, as default, for traceroutes, and Windows uses ICMP, but on Linux you can vrite traceroute -i and it uses ICMP.
Try with both ICMP and UDP and check if your router shows different IP's...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi folks.
I'm displaying a bitmap on my toolbar. It works fine on 95/98/NT but on 2000 the toolbar buttons are all blank. Does anyone have any ideas as to the cause/solution?
Flit
|
|
|
|
|
I tried to use GetDC in CMainFrame to get the device context to draw some lines in my client area. These lines are supposed to overwrite the same lines drawn using CView::OnDraw
However, the lines are out of position respective to the original lines even though the start and end pts are the same CPoints. Any idea what's wrong? Something must be wrong with the device context obtained from GetDC I reckon. But I don't want to use OnDraw again to draw these overlapping lines.
|
|
|
|
|
Try CWnd::ScreenToClient
Might work.
Not sure.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Just because you're getting the DC doesn't mean your drawing parameters are setup. I would write a view function that sets any drawing parameters you need (startpoints, endpoints, color, etc) and that then calls Invalidate() (calling Invalidate() causes OnDraw() to be called). Of course, you'll have to change your OnDraw() function, possibly add some code to populate some structs or something, and make other minor changes to facilitate what you want to do.
The key is to do all of the drawing in (or from) your OnDraw() function.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
When you reply to a post here, do it here so that everyone can see your followup comments/questions.
The answer to your question (why do all the drawing in the view::OnDraw() function) is Maintainability. OnDraw() is where all experienced MFC programmers will look for drawing code first.
Like I suggested before, there's more work involved, but the code is a lot easier to follow for someone new to the code. In fact, a related change might (should?) include the associated document class as well. Change the document, and then have the document call UpdateAllViews() to have each associated view redraw itself. The view(s) should get any data necessary for redrawing from the document.
Nobody said it was easy for you, but it will be a lot easier on the next guy, and it will be easier for you to add functionality later on. You might respond by saying this code will only be seen/modified by you, but it doesn't hurt one bit to get into the practice of using MFC the way it was intended and following a few standards as far as putting code in specific places.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
okie... got the point. It's all part of good practice in coding. Guess i'll try to incorporate everything into OnDraw.
|
|
|
|
|