|
I think the processwindow fucntion found here should do the trick
|
|
|
|
|
Hi,
I'm launching a child Windows Media Player process to play an AVI file from within my main application using CreateProcess. Is there a way to get a notification in my main app when the child app has finished playing the AVI file ?
Thanks
v3man
|
|
|
|
|
Consider WaitForSingleObject().
Kuphryn
|
|
|
|
|
There is an application our company has written in C++ that allows for
people to submit bug reports to us. We wanted to give it an upgrade
and have it automaticly e-mail us with the text of the report thats
submitted. We tried to use MAPI to send to our distibution list and
send email from the person but Outlook always comes up with a warning
that "Some program is trying to access your address book do you wish
to allow it" then we get "Someone is trying to send email from you do
you want to allow it" which then the user has to wait for 10 seconds
or so before the user can even say yes. So my question, Is there
anything we can do to stop these messages from coming up or is there a
better way to program it so we don't run into the messages at all?
|
|
|
|
|
Try using SMTP protocol.
Open socket connection to port 25 and then use smtp protocol.
I am sure that you can find smtp utility in codeproject site.
|
|
|
|
|
But be aware of some 'Personal firewalls' which will report your attempt to using SMTP port as well.
But it can be usually configured to be allowed without user interaction, just not to be surprised
|
|
|
|
|
hi all, im learning controls through MFC from this book . im using windows 98 SE. im trying to make a control in a class derived from CFrameWnd.i get an assert in win32debug. and controls dont show in win32 release. also in win32 debug if i ignore the assert, window is made but no controls. on window 2000 professional though the same programme works.
anyone please help!
|
|
|
|
|
Hi Yaseen,
Can you provide some more assertion details like
where it exactly asserts with class:func info? and for what
operation it asserts?
regards
~Hari~
|
|
|
|
|
Try converting the image to 32-bit color, and then paste it into the 256-color icon. Sometimes this works, because it forces the program to create a new palette rather than using its own palette and the current indexes. Of course, if it's a really bad program, it will just always use the system palette.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Does anyone know how to get a sound to play? I wrote this in my code:
button->SetSound((LPCTSTR)_T("ir_end.wav"), NULL, TRUE, TRUE)
However, nothing plays. Is there a certain filetype that it's supposed to use?
|
|
|
|
|
Albedo wrote:
_T("ir_end.wav")
Is the ir_end.wav file in the executable directory?
-Nick Parker
|
|
|
|
|
Well...ok, this is going to make me sound like a moron, but what is the executable directory and how do I put something into it?
This is my first "serious" program using MFC, so I'm not quite familiar with everything yet.
|
|
|
|
|
Albedo wrote:
but what is the executable directory and how do I put something into it?
The executable directory is the location on the hard drive where your executable program is running from. I am not familiar with SetSound , you may try the PlaySound function from Windows Media:
BOOL PlaySound(
LPCSTR pszSound,
HMODULE hmod,
DWORD fdwSound
);
-Nick Parker
|
|
|
|
|
Agh...problems upon problems! Ok, I tried using PlaySound() and made sure to put the file into the executable directory, but it still doesn't work. There are no errors with code (at least I don't think so, so I'll give a run-down). Here's what I have done so far:
#include <mmsystem.h>
#include <windows.h> (I don't know whether I actually need this one)
I also made sure to add the resource Winmm.lib to my program (both debug and release versions). I also put the .wav file itself into the executable program (C:\Program Files\Microsoft Visual Studio\MyProjects\Same Game\another game). Furthermore, I also added the .wav file directly to my project (Using Project->Add to Project->Files). Here is how I call PlaySound() then in my program:
PlaySound("ir_end.wav", NULL, SND_FILENAME | SND_ASYNC);
I also tried other ways, such as
PlaySound((LPCTSTR)_T("ir_end.wav"), NULL, SND_FILENAME | SND_ASYNC);
PlaySound((LPCTSTR)_T("C:\\WINNT\\Media\\ir_end.wav"), NULL, SND_FILENAME | SND_ASYNC);
and the like, but still nothing. What I want it to do is play a sound if I click a button. Geez, I never thought that it would be so complicated though! The program pauses slightly as if it's loading the sound, but nothing comes out. Maybe the problem lies in something else, not my code. Anyway, thanks for all your help so far.
|
|
|
|
|
Haha, nevermind; I got it to work. All I had to do was restart the computer and everything was fine...
But once again, thanks for all your help!
|
|
|
|
|
here is my problem I am writing an app in VC++.net using mfc and I am also using STL vectors. My app crashes everytime at the same place when I try to run it stand alone but when i run it from VC++.net it works fine. Does anyone know why this is. It only happens with apps that use the STL and it only happens with .net. With 6.0 it works fine. Can anyone help me?
|
|
|
|
|
I suspect a loop or invalid access to the STL container.
Kuphryn
|
|
|
|
|
Dear Friends
I wish to set Aspect Ratio using API.Kindly write to me what is the particular command to get the screen resolution paramaeter and to set the aspect ratio accordingly.
Thanking you.
With Regards,
Adarsh
|
|
|
|
|
Can't say I ever needed the aspect ratio for the screen resolution.
Isn't it enough with width and height?
if (lpdd->SetDisplayMode(width,height,bpp,0,0)!=DD_OK)
jhaga
|
|
|
|
|
::GetSystemMetrics(SM_CXFULLSCREEN)
::GetSystemMetrics(SM_CYFULLSCREEN)
and
SetMapMode
The SetMapMode function sets the mapping mode of the specified device context. The mapping mode defines the unit of measure used to transform page-space units into device-space units, and also defines the orientation of the device's x and y axes.
int SetMapMode(
HDC hdc, // handle of device context
int fnMapMode // new mapping mode
);
Parameters
hdc
Handle to the device context.
fnMapMode
Specifies the new mapping mode. It can be any one of the following values: Value Description
MM_ANISOTROPIC Logical units are mapped to arbitrary units with arbitrarily scaled axes. Use the SetWindowExtEx and SetViewportExtEx functions to specify the units, orientation, and scaling.
|
|
|
|
|
Thanks a lot.
With Regards,
Adarsh
|
|
|
|
|
I want to connect to my mail server and get my emails.This is my code:
WSAStartup(0x0101,&wsa);
sock=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
HOSTENT *hp = gethostbyname("mail.parsonline.net");
sin.sin_addr.s_addr=*((unsigned long*)hp->h_addr);
sin.sin_family=AF_INET;
sin.sin_port=htons(110);
int i = connect(sock,(struct sockaddr*)&sin, sizeof(sin) );
char *buff="USER mazdakmansouri\r\n";int y;
send(sock,buff,strlen(buff),0);
recv(sock,buff,10,0);
i = WSAGetLastError();
But I recieve nothing andreturn value from recv() is -1 and after that line WSAGetLastError() return error 10053 which means "An established connection was aborted by the software in your host machine".Before that WSAGetLastError() return 0. (no error) Any suggestion?
Mazy
No sig. available now.
|
|
|
|
|
try
char szBuffer[128];<br />
recv(sock,szBuffer,128,0);<br />
i = WSAGetLastError();
I will let you work out why!
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
Thanks,it works now.
Mazy
No sig. available now.
|
|
|
|
|
How can I translate a relative PIDL to an absolute PIDL ?
|
|
|
|