|
A-M-S-S wrote: and i dont know how to set width and height of the dialog without using "SetWindowPos"
Why do you dislike SetWindowPos ?
A-M-S-S wrote: and i have another issue i want to resize my window and keep it in the center of screen all of that in runtime, due some user clicks.
Can't you handle WM_MOVE message?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: -- Iain Clarke
I'm a sig! Fame at last!
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
Iain Clarke wrote: I'm a sig
Yes, you're a signore, my friend.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
U can Use this OnInit....
<br />
CRect Rect;<br />
GetParentFrame()->GetWindowRect(&Rect);<br />
GetParentFrame()->SetWindowPos( NULL,0,0,900 ,200 ,SWP_NOMOVE | SWP_NOZORDER); <br />
SIZE size;<br />
size.cx=Rect.Width();<br />
size.cy=Rect.Height()/2;<br />
SetScaleToFitSize(size);<br />
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
A-M-S-S wrote: and i dont know how to set width and height of the dialog without using "SetWindowPos"
How about MoveWindow() ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You can use of MoveWindow on the WM_SIZE event.
|
|
|
|
|
Hello! I transferred a function from a client program into a windows service. At the client Programm I used PlaySound(WavFile, NULL, SND_FILENAME | SND_ASYNC | SND_LOOP); to play a wav file.
At the service there's no output at all. Anyone knows a solution like Setting Default Audio Device via program or another function that could make it work?
Or is there no possibility to do such things?
|
|
|
|
|
I would be doubtful about the ability existing. Can you imagine the consequences if it did?
You'd have all sorts of services deciding that they are the One True Service, making a hullaballoo, and no UI to shut them up. Volume settings are on a per user basis too, I think. So, which user profile do you use?
If noone's logged on, who's going to pay ettention anyway?
I suggest you have a really tiddle client program for the service to communicate with, and let *that* program make the noise - or a balloon tooltip, etc. Then "I" can kill it.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. You wouldn't be the first...
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
MarcoNedwig wrote: At the service there's no output at all.
That's probably a good thing.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You're right in saying that it's not so bad that it is this way, but how I would use the service it makes sense in my opinion.
I found a solution to solve my problem, but it's not as good as if I could do the action needed in the service.
The difficulty is that one or more programs consume the service but only one user must play the sound ( a telephone ring).
So I tell one instance via application logic to do it. Quick and dirty Ty for your helpful comments.
|
|
|
|
|
i need to get a file from windows XP machine to my XP desktop, in both machines IIS services running. I have no error in InternetConnect(), InternetOpen(). But FtpOpenFile() fails and returns "file unavailable error". Following is the code i did in FtpOpenFile,
FtpOpenFile(hConnect, TEXT("C:/good.txt"), GENERIC_READ, FTP_TRANSFER_TYPE_BINARY, NULL);
Anybody have any idea to overcome this. Somebody respond ASAP please.
modified on Thursday, February 07, 2008 7:47:52 AM
|
|
|
|
|
vptech19 wrote: FtpOpenFile(hConnect, TEXT("C:/good.txt"), GENERIC_READ, FTP_TRANSFER_TYPE_BINARY, NULL);
Does the file exist? Have you tried a (double) backslash instead?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
So now you have something akin to:
if (FtpOpenFile(hConnect, TEXT("C:\\good.txt"), GENERIC_READ, FTP_TRANSFER_TYPE_BINARY, NULL) == NULL)
DWORD dwError = GetLastError();
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
this is also didn't work out.
|
|
|
|
|
What does GetLastError() return?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
it returns 12003.
Please note that the user name i am logging have all the rights.
modified on Thursday, February 07, 2008 10:47:15 AM
|
|
|
|
|
Which equates to ERROR_INTERNET_EXTENDED_ERROR . Did you then call InternetGetLastResponseInfo() to get the error text?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Tried as InternetGetLastResponseInfo(lpdwError, lpszBuffer, lpdwBufferLength);
cout<<lpszBuffer;
if this is correct, it have 00394BD8.
|
|
|
|
|
vptech19 wrote: cout<<lpszBuffer;
cout << (LPCTSTR) lpszBuffer;
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
it is didn't work. if i use InternetGetLastResponseInfo() & ran the program means, it breaks the code.
But FtpOpenFile() returns the error code as 6 now. where can i refer the error codes?
|
|
|
|
|
vptech19 wrote: it is didn't work. if i use InternetGetLastResponseInfo() & ran the program means, it breaks the code.
So you have something like:
if (FtpOpenFile(hConnect, TEXT("C:\\good.txt"), GENERIC_READ, FTP_TRANSFER_TYPE_BINARY, NULL) == NULL)
{
DWORD dwError = GetLastError();
if (ERROR_INTERNET_EXTENDED_ERROR == dwError)
{
TCHAR szErrorText[256];
DWORD dwSize = sizeof(szErrorText);
InternetGetLastResponseInfo(&dwError, szErrorText, &dwSize);
}
} vptech19 wrote: But FtpOpenFile() returns the error code as 6 now.
FtpOpenFile() returns a handle to indicate success, and NULL to indicate failure. Since 6 is not NULL , I can only assume that FtpOpenFile() is not failing.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
vptech19 wrote: where can i refer the error codes?
System Error Codes[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I missed out some FTP configurations in Destination m/c, so now the FtpOpenFile() works fine.
The FtpGetFile() throws 12110(ERROR_FTP_TRANSFER_IN_PROGRESS) error. Do i need to include some kind of delay after FtpOpenFile()?. To debug this i tried to login thro FTP to the source m/c(other m/c) - it is success. But i wan not able to login thro FTP to my m/c from the source m/c. I feel this may causing the problem. Do i need to set any configurations anything else mentioned in "https://engineering.purdue.edu/ECN/Support/KB/Docs/FTPSetUpWindows" and "http://articles.techrepublic.com.com/5100-6345-5031102.html".
|
|
|
|
|
After you've called FtpOpenFile(), the only operations you can do are
InternetReadFile(), InternetWriteFile(), InternetCloseHandle(), or FtpFindFirstFile().
Once you've closed the file you can use FtpGetFile().
FtpGetFile() is meant to be used by itself - you don't need to (and can't) open the file first.
You use FtpOpenFile()/InternetReadFile()/InternetCloseHandle() when you want more control
over the file transfer.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|