|
I think windows.h alone will do the job bcos when i tried adding shellapi.h im able to see lot of errors...
|
|
|
|
|
pradeep455 wrote: I think windows.h alone will do the job
Did u try for that?
pradeep455 wrote: i tried adding shellapi.h im able to see lot of errors
What errors?
- ns ami -
|
|
|
|
|
Hi,
I have a double var=123.45677, I want to control the 2 decimal places i.e var should be 123.45
How to do it?
|
|
|
|
|
You cannot control it as such, but you can display it using 2 decimal places.
For example, when assigned it in a character array you can do the following.
sprintf(cBuffer, "%.2f", var);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
If you need to truncate it to 2 decimal places, then
#include <math.h>
void main()
{
double var=123.45677;
var = floor(var * 100) / 100;
}
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
When i tried to invoke exe from console application using
ShellExecute("NULL","open","D:\\windows\\MYapp\Debug\\My.exe",NULL,NULL,SW_SHOW);
im getting the below error
error C2065: 'SW_SHOW' : undeclared identifier
error C3861: 'ShellExecute': identifier not found, even with argument-dependent lookup
and when i tried to include shellapi.h im getting lot of errors ie more than 50...Please help me out....
|
|
|
|
|
You probably need to include windows.h first.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Include Windows.h . You don't need to include ShellApi.h .
Also the first parameter must not be in double quotes.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks for ur reply.... im able run console application successfully without errors but i was unable to run the exe which i have specified in shellexecute().....PLease help me out...
|
|
|
|
|
Does it show any error? Does it crash?
What is the actual problem?
Are you running a UNICODE build?
I would recommend using CreateProcess instead of ShellExecute .
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
when i replaced SW_SHOW with SW_SHOWNORMAL... im able to see the Dialog ...
|
|
|
|
|
could you check my recent post....createprocess...
I am a beginner
|
|
|
|
|
You can also use of WinExec.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
WinExec() is outdated...
Need to use CreateProcess().
- ns ami -
|
|
|
|
|
Hello,
I have created a view object derived from CView in a function of a class derived from CMDIChildWnd.
It works fine but gives unhandled exception when closing the appliction.
While destroying this view object there is a problem. How should I destroy this View object.
Prithaa
|
|
|
|
|
Did you try to debug the root cause? If you application is crashing you can configure a process dumper tool to create a dump and then analyze it to zero in on the problem. WinDbg is an excellent utility to analyze dumps.
It's hard to provide you specific reason for the crash with the amount of information you provided. There can be n reasons like, memory overflow, uninitialized variable/pointer etc.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Hello,
What is a dumper process?
The problem exactly started when I created the CView object so I know that the problem is with CView object and after the CView destructor is called there an unhandled exception.
Thanks
|
|
|
|
|
What is Core Dumper?[^]. Process Dumper is a tool that helps you in getting the information related to a crashed process.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
I Created a Window.
and I created WM_DROPFILES in callback procedure in the window.
It brings Icon Function through the event.
<br />
<br />
void OnDropFiles(HDROP hDropInfo)<br />
{<br />
HICON hIcon;<br />
char filename[MAX_PATH];<br />
UINT Filenum = DragQueryFile(hDropInfo,0xFFFFFFFF,NULL,0);<br />
for(UINT y = 0; y<Filenum;y++)<br />
{<br />
DragQueryFile(hDropInfo,y,filename,MAX_PATH); <br />
<br />
int count = (int)ExtractIconExA(filename,-1,NULL,NULL,1);<br />
<br />
HDC hdc = GetDC(main_hWnd);<br />
<br />
if (count >= 1)<br />
{<br />
ExtractIconExA(filename,0,&hIcon,NULL,1);<br />
DrawIcon(hdc,location,10,hIcon);<br />
DestroyIcon(hIcon);<br />
location += 35;<br />
}<br />
ReleaseDC(main_hWnd,hdc);<br />
DragFinish(hDropInfo); <br />
}<br />
}<br />
<br />
This Function is only for exe or ico files to get some icons.
By the way, I would like to bring all of the files of Icons, How should I do?
And, at this part of DragQueryFile(hDropInfo,y,filename,MAX_PATH),
It counts "y", but that file name wasn't changed.
|
|
|
|
|
Hello Guys,
with VC++, I define a CListCtrl with coordinates 11,53 on my dialog, I give it a size of 202x130 pixels (pos and size displayed when I add my objects in the ressource view of VS).
I my code, when I want to fill my CListCtrl, I retrieve its size using m_Liste.GetWindowRect(&rect); and when I look at the infos stored in the returned rect, I have the following values:
rect.Width()=303 (instead of 202)
rect.Height()=211 (instead of 130).
What is the link between the 2 values?
How to translate one value to the other and vice-versa (to create my CListCtrl dynamically but keep the same size as when I created it from ressource editor) ?
Thanks in advance.
DD
|
|
|
|
|
GetWindowRect gives you the rectangle "in pixels", the resource editor displays and works with "dialog units". (This[^] might be useful)
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hello,
thanks for the answer, I'll have a look!
DD
|
|
|
|
|
Hi everyone.
I just downloaded EC++ 4.0 and i have been trying hard to make it run on my Windows XP.
First of all it did not open because apparently "No standard SDK was found on the desktop....".
So i downloaded the Standard SDK 5.O and installed it on my pc.
This time Ec++ did open and i was able to open a project.
However when i tried compiling the program another error message was displyed...
" The application targeting a standard SDK for Windows CE.net and built for the SH4 CPU cannot be run on the Emulator device. Inorder to run this application on any CPU other than the Emulator you will have to install an SDK that is compatible with the standard SDK for Windows CE.net, the target a shadow platform pertaining to that SDK.
Please see EVC documentation for more details."
Can anyone please help me with this....Smile
PS: The application i have been trying to compile is a remote control application written in Ec++ for a pocket PC running Windows CE 3.0.
Thanks in advance...
|
|
|
|
|
Firstly, I don't know the answer to your question.
There is another forum that might be more help (nothing wrong with trying here though!)
Mobile Development Forum.[^]
I wish you every success!
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Thanks for the heads up...:P
|
|
|
|