|
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.
|
|
|
|
|
Ya, that's it what I was asking for. But just I want to know is there any other way to differentiate the two files. And, any API present to check carriage return or line feed (in VC++)?
Thanks you all for your time.
|
|
|
|
|
Anonymous wrote:
But just I want to know is there any other way to differentiate the two files. And, any API present to check carriage return or line feed (in VC++)?
As far as I know, there isn't an API function for this. The code to do it should be pretty simple.
Software Zen: delete this;
|
|
|
|
|
I want to import a VB interface in my VC++ programming for my image thinning project. How to do so and how to link the interface objects with the coding?
My VB form consists of a menu toolbar, command button,a picture box and a text box. I want to open a 50x50 TIFF image file using the menu item File->Open File and displays the image in the picture box. How to get the file name from the interface and load the image onto the interface?
Then I need to click the command button to convert the image to binary image(0 for white and 1 for black).(I have the coding for binary conversion but I don't know how to link them with the command button and accessing the image in the picture box.
Later, i need to display the binary image that I saved in a binary file in the text box in the interface. How to read and write a file through the interface? How to display the content of the file being read?
Hopefully, anybody who are experienced in this can guide me from the scratch in details. Is there any source where can I get examples of source codes and related tutorials? I've browse through books but they only give the howto info not the real full source codes on the howto.
Some books give info on how to how to create an MFC application, but I still don't get it on how to link the interface items with the existing coding. Need simple and fast help here.
thank you very much
|
|
|
|
|
Hi,
I have no much idea about the VB programming. But when you compile your VB program, it should generate a tlb file, which you can import into your C++ program using #import preprocessor.
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
MailtoGops wrote:
I have no much idea about the VB programming.
Obviously. A tlb is generated by a COM object. A C++ COM object could be imported into a VB UI app, but a VB UI app is not going to generate a type library.
Christian Graus - Microsoft MVP - C++
|
|
|
|