|
hello,
How can i open a text file i excel using a schell command in c++.
if there is another it is ok.
10x regards
dghdfghdfghdfghdgh
|
|
|
|
|
ellllllllie wrote: How can i open a text file i excel using a schell command in c++.
Read the "Shell" API documentation. Note, it is NOT "Schell", you won't find it using that.
ellllllllie wrote: if there is another it is ok.
There is also the Excel Object Model. Again you should read the documentation
|
|
|
|
|
|
Isnt it "excel.exe" - sorry if I am wrong :p
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
BSoD during a Win98 presentation
|
|
|
|
|
it isn't important: using ShellExecute you can open what file you want with the application you want (if it can). Look to its help.
Or explain more details if it doesn't help.
Russell
|
|
|
|
|
Hello. I have this DLL that is used by three programs. Now, I was requested to modify program1.exe and the DLL, without --of course-- affecting program2.exe and program3.exe. Now, I made changes in both program1.exe and the DLL. To this one, I added other classes and functions. The question is, do I have to recompile program1.exe and program2.exe?
AFAIK, I don't have to recompile since it is a dynamic-linking library... but, just to be sure.
Thanks in advance.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
Generally, you do have to recompile if you want to be safe. However, unless you have changed the interfaces of those classes that used to be in the DLL before your modifications, you should run well without recompiling. Again, there are cases when this is not true. One example is if you access functions in that DLL by their ordinals - add or remove a function and you're probably in trouble.
Bottom line - you can never be 100% sure (that's why COM is better than regular DLLs), but you definitely may try leaving those executables as they are. Test empirically. If it works for you, it'll work for your users also.
|
|
|
|
|
Generally, no. If your changes added new function exports and did not change the ordinals of the existing ones, or if the other EXE's link functions by name and not ordinal, you should be OK.
Not so sure if you exported a new data item (variable), however...
Changing the binary layout of anything that is already being used by the DLL and EXEs may cause problems as well, because when the EXEs were compiled, they were built to expect a certain binary/size of any objects used in/by/from the DLL.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hello,
could someone help me to find a way to write an MDI application that draws lines with variable degree angle, the choice of the angle should be set in the same application?
Thanks a lot.
a novice in programming .
|
|
|
|
|
|
Thank you Maximilien!
ooops, really complicated...
I got older version of VS (vs2003.net), it is impossible to load the sample created with VS2005.net
|
|
|
|
|
if angle is given, the radius R and the start point too (X0,Y0) , then
X=X0+R*cos(angle);
Y=Y0+R*sin(angle);
where (X,Y) is the end of the segment.
CDC::MoveTo(X0,Y0);
then
CDC::LineTo(X,Y)
Russell
|
|
|
|
|
Thank You Russel for your reply,
in this way I should know which the radius for every set of angle?
I hope to be more clear, the application will be filled only with starting Y point and finish Y point, in the way that setting the angle e.g.30 degree, the line will be shown with unknown or variable X point on the graph, depending on the degree angle.
Is it affordable?
thanks again
|
|
|
|
|
omnimny wrote: Thank You Russel for your reply
omnimny wrote: in this way I should know which the radius for every set of angle?
Yes, I was thinking that the radius for you was constant (you haven't specify that) ....
omnimny wrote: the application will be filled only with starting Y point and finish Y point, in the way that setting the angle e.g.30 degree, the line will be shown with unknown or variable X point on the graph, depending on the degree angle.
Then simply you have fixed Y1 and Y2 , now you have to find X1 and X2 .
I assume that X1 is known, and it is given an angle .
Then simply:
X2=X1+(Y2-Y1)/tan(angle)
Russell
|
|
|
|
|
Thank you Russell,
I tried to apply your formula, but I know I need to study more c++, I am extremely novice, and really I m not able to get it out.
No problem with excel, it works, but I added X2=X1+(Abs(Y2-Y1))/tan(angle) in the way to get positive space consuming on the right of Y axes, because if I got a series of yn and I want to trace all the lines, in the case yn <= yn-1 , xn becomes less than xn-1 (without Abs value of y2-y1), giving out a bad picture.
Ciro
|
|
|
|
|
Russell
|
|
|
|
|
Hi,
In my applications images are displayed (and for example rotated) with the help of GDI+. I store the image (there is only 1 displayed ) like this:
Gdiplus::Image * m_image;
I draw it on the screen with this line:
graphics.DrawImage(m_image, x, y, size_x, size_y);
Now i wanted to zoom in and out of the picture with the help of a Slider Control. From 100% to 1600% (1x - 16x). I tried it in different ways but none had worked. Sometimes I don't see any change of the image on the screen at all and sometimes the application crashes.
Isn't that the correct way?:
Graphics * graphics = Graphics::FromImage(m_image);
graphics->ScaleTransform(3.0f, 1.0f);
Any ideas?
Thx, Shi
|
|
|
|
|
TheShihan wrote: Graphics::FromImage(m_image);
the above function might have returned 0. thats why the graphics->ScaleTransform() is giving exception.
|
|
|
|
|
How can I check the returnvalue from this function? I mean I cannot do this:
int = Graphics * graphics = Graphics::FromImage(m_image);
or do you mean NULL? I tryed to check it this way:
if(graphics != NULL) <br />
{<br />
MessageBox("OK")<br />
}<br />
else <br />
{<br />
MessageBox("Not OK")<br />
}
Gave me also errors... sorry I'm really a beginner.
Shi
|
|
|
|
|
TheShihan wrote: or do you mean NULL?
null and 0 are all the same
TheShihan wrote: if(graphics != NULL)
{
MessageBox("OK")
}
else
{
MessageBox("Not OK")
}
So which message box u got?
|
|
|
|
|
TheShihan wrote: or do you mean NULL?
Note - some developers get hung up on the fact that NULL , NUL and zero all have the same value, completely ignoring that the meanings may be different depending on context.
For an extreme example of this mistake, see the "NUL is not NULL...! " post on my profile's page.
So yes, as far as you are concerned, the poster meant NULL .
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hi All,
I have created an application in which i can change the font attributes of a text. I am using CFontDialog to select font size, font family etc
Before calling CFontDialog (while debugging)
m_TextFont.m_cf.iPointSize is 140. (Font Size is 14).
But when Font dialog is popped it is showing Font Size as 17.
What may be the problem?
|
|
|
|
|
Care to share a code snippet with us?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I would hazard a guess to say that it is to do with how Windows maps fonts. In the LOGFONT structure, for example, it needs a *negative* value to get the full character height - a positive value gives a slightly different size as it doesn't check against the full character cell height.
Now, this doesn't necessarily mean it's true in your case.
I think we are going to need to see some sample code and / or an explanation of what you do as a user with the font dialogue in between examining those values - for example, do you simply cancel it, or do you choose something?
|
|
|
|
|
CFontDialog* m_TextFont = new CFontDialog(&lfFontAttr, CF_BOTH | CF_TTONLY | CF_INITTOLOGFONTSTRUCT);
lfFontAttr is LOGFONT structure.
m_TextFont->GetCurrentFont(&lfFontAttr);
Here m_TextFont->m_cf.iPointSize is 140 (i got the value while debugging)
if (m_TextFont->DoModal() == IDOK)
{
m_TextFont->GetCurrentFont(&lfFontAttr);
-------
}
Font size 17 is shown in dialog.
|
|
|
|