|
Hi
How i can :
run an *.exe file and then stop it ?
|
|
|
|
|
Use ShellExecute()for starting exe , why you want to stop exe?
Regards,
Abhi Lahare
|
|
|
|
|
i have to close exe and run it to update some other tasks.
|
|
|
|
|
|
How can I read/write registry entries in an mfc dll?
e.g. can I use the CWinApp interface ?
Thanks.
- KarmaFX
|
|
|
|
|
karmafx wrote:
How can I read/write registry entries in an mfc dll?
The same way you would in an EXE...with the registry API.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks..
Okay, so I guess I cannot do it the MFC way ?
i.e.
CWinApp* pApp = AfxGetApp();
CString key = "Preferences";
CString f = pApp->GetProfileString(key,....
int l = pApp->GetProfileInt(key, ....
....
?????
|
|
|
|
|
Sure, you can use the CWinApp() methods, but they are slightly less flexible that the API itself. It really just depends on exactly what you are wanting storing and where.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Ok...so now my questions boils down to:
How do I get a CWinApp interface within a dll ?
in my experience AfxGetApp returns null in dll's...
Thanks again.
- KarmaFX
|
|
|
|
|
There are several decent registry classes here on CodeProject.
Why not choose one and use it?
Ignore the CWinApp stuff
|
|
|
|
|
karmafx wrote:
How do I get a CWinApp interface within a dll ?
Unless your DLL already uses MFC, you can't.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Take a look at the CRegKey class.
Larry J. Siddens
|
|
|
|
|
Thanks alot !
- KarmaFX
|
|
|
|
|
in the following code iam trying to save an edited icon with its relevant pixel information.
But iam unable to save in Iconformat using the specifier ImageFormatIcon.
But the same can be saved in Bmp format using the specifier ImageFormatBMP
Can anyone let me know the reason.
CImage icon_image;
icon_image.Create(sizex, sizey, 8);
// Fill color table with pre-defined colors
RGBQUAD FAR* pRGB = new RGBQUAD[nColors];
DWORD dwval;
UINT r, g, b;
int j;
for (int i=0; i
|
|
|
|
|
I try to make some DoModol when user click whith right button of mouse on CButton , but i cant catch click above.
please help me. . . .
|
|
|
|
|
Right-clicking a button is not very intuitive. What exactly is it that you are trying to do?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
i need to popup window dialog (something like menu popup),
the dialog/menu will popup on right click button.
|
|
|
|
|
Create a new class and inheriate the CButton class...
class CMyButton : public CButton
{
. . .
}
Then capture on the WM_RBUTTONDOWN message. Using the wizard for VC6.0 and the properties for VS2003.
In there do what you need to do.
Hope this helps.
Larry J. Siddens
|
|
|
|
|
ok , this is the "long" way that i thought about ,
but can`t i do it with out creat new class ??
does microsoft didnt make to us "easy" to us easy life ?
|
|
|
|
|
yanshof wrote:
but can`t i do it with out creat new class ??
No you have to make you own class derived from CButton!
yanshof wrote:
does microsoft didnt make to us "easy" to us easy life ?
Don't you think MS already make you life easy by providing Inheritance to there proprietary classes
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Is it possible to create a VPN connection programmatically?
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
I need to read a data file using C++, it's a data file that contains a row of column headers before the actual data. I need C++ to remove the header and re-print just the data into a new data file. Any suggestions?
|
|
|
|
|
Are you using MFC? If so, then the following snippet should (it's untested) work for you:
CStdioFile in(<code>""</code>, CFile::modeRead), out(<code>""</code>, CFile::modeWrite | CFile::modeCreate);
CString strLine;
in.ReadString(strLine);
while (in.ReadString(strLine))
out.WriteString(strLine);
in.Close();
out.Close();
CFile::Remove(in.GetFilePath());
CFile::Rename(in.GetFilePath(), out.GetFilePath()); A slightly harder-to-read, but more efficient, approach would look like:
CFile in(<code>""</code>, CFile::modeRead), out(<code>""</code>, CFile::modeWrite | CFile::modeCreate);
char c;
LPSTR pBuffer;
DWORD dwLength = in.GetLength();
do
{
in.Read(&c, 1);
dwLength--;
} while (c != 0x0a);
pBuffer = new char[dwLength];
in.Read(pBuffer, dwLength);
out.Write(pBuffer, dwLength);
delete [] pBuffer;
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Use iostreams. MFC file reading is crap.
You just want to read the first line and discard it, then read and keep the rest ? Use getline, an ifstream and an ofstream ( or a stringstream to read the file, then write it to the same file in a seperate operation ). I've written articles on this here on CP, you should have no trouble finding them.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
if u want to do it using the basicz...then i would suggest the fopen,fgetc,fputc.....it can get complicated though!!!!!
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|