|
bryan523 wrote:
we have to use C++ to call exe program??
In Continuation With Mr. Tox.... you can refer this article too... http://www.codeproject.com/system/newbiespawn.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Thanks for urs information!
i still trying to understand all the function
but its very deep for me to really understand!
i think i need a full example to show hw a simple application can calling out for function like calling out a windows calculator function?
i really need urs help, thanks!
|
|
|
|
|
::ShellExecute(NULL, "open", "myProg.exe", "", "", SW_SHOW);
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
WHen i try below code then got three error!
so, wht should i put as my identifier?
#include "stdio.h"<br />
#include "string.h"<br />
#include<conio.h><br />
<br />
int main(int argc, char *argv[])<br />
{<br />
::ShellExecute(NULL, "open", "myProg.exe", "", "", SW_SHOW); <br />
return 0;<br />
}
-error C2039: 'ShellExecute' : is not a member of '`global namespace''<br />
-error C2065: 'ShellExecute' : undeclared identifier<br />
-error C2065: 'SW_SHOW' : undeclared identifier
|
|
|
|
|
bryan523 wrote:
::ShellExecute(NULL, "open", "myProg.exe", "", "", SW_SHOW);
ShellExecute Api cannot be executed in Console Mode, you have to use system() function
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
2 possibilities :
1- you didn't read the link on the MSDN i gave you describing how ShellExecute() works
2- you didn't see you had to #include <shellapi.h>
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
toxcct wrote:
you didn't see you had to #include <shellapi.h>
Hain Tox,
Sorry for correcting you, Shell Function caanot be executed in dos mode/ console mode
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
yeah, i've seen your previous post.
actually, it depends if he has to execute his program in pure DOS mode, or if it will run under command windows in Win2000, XP, etc, where DOS don't exist anymore, and is emulated... it would work in the later cases...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thanks toxcct, Neagoe, Alok!
I manage to do it liao!
toxcct,Alok
i still dun knw hw to use shellExecute!
I will be very appreciate if u can show to me hw to use?
i using code below and its ok:
#include "stdio.h"<br />
#include "string.h"<br />
#include<conio.h><br />
#include <stdlib.h><br />
<br />
int main(int argc, char *argv[])<br />
{ <br />
(void)system("C:\\ShutDown.exe");<br />
return 0;<br />
}
-- modified at 6:11 Monday 5th September, 2005
|
|
|
|
|
wow wow wow, don't #include stdio.h and string.h as if they were project local headers...
they are standard files, you have to include them inside <>
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Is there a way for me to get the rect of one cell in CListCtrl when dealing with NM_CUSTOMDRAW (reflect)?
|
|
|
|
|
http://www.codeproject.com/listctrl/lvcustomdraw.asp[^]
NMLVCUSTOMDRAW::rcText is the rectangle.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
If you have a member variable that points to the CListCtrol you can access to each item dimensions through
GetItemRect[^] inside the reflected message.
MArc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
CRect rcItem(lpDrawItemStruct->rcItem);
int nItem = lpDrawItemStruct->itemID;
....
}
NG
|
|
|
|
|
ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnCustomDraw)
It even doesn't enter the message handler.
|
|
|
|
|
Override CComboBox::DrawItem .
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Custom draw is a feature supported only by the common controls. For the standard builtin Windows controls, you have to implement owner draw, which is a bit more involved.
Software Zen: delete this;
|
|
|
|
|
Hi all,
Can we find programmatically what the FileType(whether it's PC or UNIX) of a text file? Is there any API available?
Please suggest.
Thanks,
Mani
|
|
|
|
|
text files are identical on all operating systems..... UNIX , WINDOWS, LINUX
NG
|
|
|
|
|
Anonymous wrote:
Can we find programmatically what the FileType(whether it's PC or UNIX) of a text file?
AFAIK, txt file is same for every operating system!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
|
|
As a rule, PC text files use carriage return / line feed pairs (\r\n, or 0x0D 0x0A) to delimit lines, while UNIX machines use line feed only (\n 0x0A).
One approach would be to read the file as binary, and search for \r\n pairs. If you don't find them, try treating it as a UNIX file.
Software Zen: delete this;
|
|
|
|
|
I agree - this is the approach I have used in the past! Brute force and pig ignorance works every time.
I've seen some text files which did line feed / carriage return instead of CR / LF - this confused the hell out of Microsoft Word (Word 97?)! I think they came from a PC which used OS/2 operating system.
|
|
|
|