|
Well, AFAIK there are two main elements to watch when launching external programs:
. Current directory
. Parameters
If your games EXE relies on the current directory (which may affect the search path) or any given parameters, then that could be a reason.
Have a look at the properties of the launch shortcut to see what it is passing to the OS to launch the programs.
I Dream of Absolute Zero
|
|
|
|
|
Well, now I know the reason: directory parameter of ShellExecute was NULL. Now all works (except for 1 game shows black screen only on loading). Thanks for reply.
-- modified at 10:38 Friday 4th August, 2006
|
|
|
|
|
hi, i want to use ostream to write to a txt file, though i dont want it to automaticly start a new txt file, if a text file already excists, but behave similar as :
FILE* f=fopen("txt.txt","a");
fwrite(buffer,sizeof(buffer),1,f);
thanks
-- modified at 16:22 Thursday 3rd August, 2006
|
|
|
|
|
FredrickNorge wrote: FILE* f=fopen("txt.txt","a");
fwrite(buffer,sizeof(buffer),1,f);
That isn't using ostream ...
If you want to use ostream (specifically, ofstream):
ofstream fout("file.txt", ios::out | ios::app);
fout << "Hello, world!" << endl;
That will open a file named "file.txt" for output and append "Hello, world!" to the end of the file.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
|
Hey guys,
The additional include directory in the project Im looking @ is listed as below
$(RTI_HOME)/$(RTI_BUILD_TYPE)/include
I am working with Windows OS but I'm still confused why it still works with $ sign
in front of the environment variables.
I thought ($) sign in front of environment variables is suppose to mean you are working
with a Linux/Unix environment and (%) sign in front of environment variables is
suppose to mean you are working with the Windows OS.
Someone help me out here.....
Thanks in advance
Jaysan
|
|
|
|
|
it's not a Windows or Unix thing, it's a Visual Studio thing.
|
|
|
|
|
($) is a Visual Studio thing?
then when do we use (%) and ($) while referring to different OS directories
|
|
|
|
|
Jay03 wrote: ($) is a Visual Studio thing?
when you said "project", i assumed you were talking about VS. and VS uses $(name) for its configuration macros.
|
|
|
|
|
I have an MFC app and I'd like to get notified whenever a any of several possible child windows recv focus. I thought I could just override the main window's PreTranslateMessage() function and simply check the pMsg->message value and if it's a WM_SETFOCUS and the pMsg->hWnd is one of the windows I care about then react accordingly. However I never get ANY WM_SETFOCUS messages!
Am I misunderstanding how PreTranslateMessage is supposed to be used or is there an alternate approach? I'd prefer not to have to subclass each of the controls, but I will if I have to.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
AFAIK the WM_* messages are sent to the pMsg->hWnd window. If that window does not handle the message then it is sent to the parent of that window and on up the parent chain until one of the windows actually handles the message (returns TRUE), or the there are no more parent windows. So the only way the main window will get the WM_SETFOCUS message is if none of the child windows handle it, or they return false if they do.
See CWnd::WalkPretranslateTree() and AfxInternalPreTranslateMessage() in the MFC sources for more details (Set a breakpoint in your PreTranslateMessage() function and use the call stack)
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
the problem is not from the way u try to catch the message, but from the message u want to catch, WM_SETFOCUS cound't be caught, I tried to catch it in the simplest window's program. catch this message before TranslateMessage calls, but still, couldn't get it. somebody knows why?
life is like a box of chocolate,you never know what you r going to get.
|
|
|
|
|
Jim, did you get a solution for this without rewriting all your child controls?
You may find that setting up a WH_CALLWNDPROC hook is the easiest way to be notified when a window in your app recieves the WM_SETFOCUS message.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
No, in the end I just added the OnSetFocus() methods to the various controls. Wasn't that big of a deal, just annoying. But then that pretty much sums up MFC development, for me at least
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
Hi
I have a windows based application and creates a icon on the system tray, i wanted to keep it active all the time ( i mean visible in the system tray). I know i can do this by going to taskbar properties-> customize notifications -> Always show, does any body know how to achieve this programmatically?
Thanks for help in advance
|
|
|
|
|
Whenever the thump of the HScroll goes to the end of the scroll bar in the CListCtrl, I will add the 20 records in the listctrl. It will be attain by inserting the record at the HScroll method, by calculating the thump value. Whether the thump is getting to the end, then only I will add the records. But I met the problem which is When I track the thump to the end of the HScroll, the mouse holding the Thump. At the time I need to release the mouse from the holding of thump. I have tried by posting the message of WM_LBUTTONUP by the
SendMessage(WM_LBUTTONUP);
function. Please help me..
~ Selva
|
|
|
|
|
If you need to release the mouse capture and stop scrolling, I think you can try this sequence:
SetCapture();
ReleaseCapture();
I hope it helps.
|
|
|
|
|
Hi Everyone.... i am trying to get this piece of code working over a WAN connection, when i use it on a LAN it works ok.. but when i use it on a wan i can create the connection etc, create and remove directories etc, but as soon as i try to use the openfile function it crashes, does anyone have any ideas why ??
oh, i have tried to use passive rather than Active mode, when i do this i cant use the FtpFindFile function ??
just wondered if anyone had any pointers....
this is the snippet of code..
<br />
CInternetSession oISession(AfxGetAppName());<br />
CFtpConnection* poFtpConnection;<br />
<br />
poFtpConnection = oISession.GetFtpConnection(csSite,"xxx","xxxxx",2001,FALSE);<br />
<br />
poFtpConnection->GetCurrentDirectory(csCurDir);<br />
<br />
poFtpConnection->CreateDirectory(csDir);<br />
poFtpConnection->SetCurrentDirectory(csCurDir + csDir);<br />
<br />
CInternetFile* pInternetFile = poFtpConnection->OpenFile(csFile, GENERIC_WRITE,FTP_TRANSFER_TYPE_BINARY);<br />
<br />
The bold part is where it is falling down...
Any help would be appreciated..
Thanks
Lee
|
|
|
|
|
oh, forgot to say, i am using port forwarding in the router and the ports been used for the ftp is 2001...2009 i need to do it like this because i am going to have multiple connections to the router... i have used smartFTP and it connnects fine using with the port forwarding....
Lee
|
|
|
|
|
Have you stepped into the OpenFile() method to narrow the problem down further?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
yes, it is falling over at the FtpOpenFile method..., the m_hConnection is a valid handle but the hFile that gets returned is NULL ??
|
|
|
|
|
racing57 wrote: it is falling over at the FtpOpenFile method...
When that function fails, what does GetLastError() return?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i have everything in a try catch block, so when it fails its caught and at that point the getlasterror function returns 0 ???? its just baffling me, because it works ok on a lan...
|
|
|
|
|
racing57 wrote: i have everything in a try catch block...
So what exception is thrown?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
well when i try and call GetErrorMessage i get nothing back, and GetLastError returns 0.... i just cant get my head round whats happening ??? help!!!!!
|
|
|
|