|
What does GetLastError() (or @ERR in the debug watch window) say?
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|
|
Not tried it, will do it this evening.
Thanks for the support.
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Hello,
Does anyone know if there is a comparable function in the Windows environment to the 'dig' function from Bind in the Unix/Linux environment?
I did get the dig.exe binary from isc.org, and the support libraries (libdns.dll libeay32.dll libisc.dll), but this seems convoluted to have to include these with my application.
I guess I could use nslookup, but I don't know how long it will be supported since it has been deprecated.
Thanks,
Murrah Boswell
|
|
|
|
|
My plan is actually quite simple. . . I want to create a 4-pane symmetrical splitter in the mainframe client area between a docked toolbar and a status bar for an SDI application. In order to properly set the initial pane sizes, I must use GetWindowRect for the status and tool bars to find the available client rectangle. Everything I have read thus far indicates that the splitter should be created in the overridden OnCreateClient funtion called by the framework. Now for my problem. . .
I cannot access these functions for the controls in the OnCreateClient function. I get assertion errors when I try to get their dimensions. I also cannot get the correct dimension in the OnCreate function. For testing purposes, I simply copied my code for getting these rectangles into the OnPaint function and accessing the correct sizes is no problem. Therefore, I can only assume that I cannot access them in the other functions because the creation of the controls is not complete until AFTER the OnCreate (in which the controls are created) and OnCreateClient functions have returned.
What is the appropriate method for getting the control dimensions with which to initialize the correct pane size in my splitter window? I noticed that in one article the calls to GetWindowRect for the controls were placed in the OnSize function. But, when OnSize is called, I want to set the panes to occupy the same proportion of the client area space as they did before the resize. I must, at some point, initialize their size to 1/4 the usable client area, but where it would be best to do this. . .I have no idea, but I know that I can't do it in OnCreateClient where it makes the most sense.
|
|
|
|
|
You should do this in OnSize . This is one of the first messages sent to a window, sent after WM_CREATE and before child-windows are created.
So, you might want to try to do it there anyway - it's not much use trying to access controls before they are created, as you've noticed
Beware, controls might not, for reasons that should be obvious, be created even in OnSize . You can check the m_hWnd -member of them to see if this is the case.
|
|
|
|
|
Thanks a lot. Your last comment was the most helpful. I guess I didn't realize the order in which the window initialization functions are called and I simply needed to check for the control's creation. Thanks again!
|
|
|
|
|
Scolex wrote:
I cannot access these functions for the controls in the OnCreateClient function.
That's because OnCreate() calls OnCreateClient() indirectly before the controls get created.
In the OnCreateClient() method, set a member variable to true indicating that the splitter window has been created. In the OnSize() method, after calling the base class, check to see if the splitter window has been created. If it has, get the height/width of the toolbar and the status bar and subtract both of those from the height/width of the client area. Then for each row/column call SetRowInfo() /SetColumnInfo() using half of the width/height for the second parameter, followed by a call to RecalcLayout() . Make sense?
|
|
|
|
|
DavidCrow wrote:
In the OnSize() method, after calling the base class, check to see if the splitter window has been created. If it has, get the height/width of the toolbar and the status bar and subtract both of those from the height/width of the client area. Then for each row/column call SetRowInfo()/SetColumnInfo() using half of the width/height for the second parameter, followed by a call to RecalcLayout().
Thanks a lot for the info. I have done as you suggested, but a previous problem is still causing me difficulty. Even if the splitter has been enabled and the frame has valid handles to the controls, when OnSize is called, the controls have not yet been sized to fit the frame window. Therefore, when I try to get their window dimensions I get 0, 0, 0, 0 and 0, 0, -2, -2 When exactly does the framework adjust the size of the controls to fit the parent window and how do I check for it? Oh, and thanks again for your assistance.
|
|
|
|
|
Oops..... Actually you already solved my problem. I am just an idiot and forgot to call the base class method..... I should have read more carefully.
|
|
|
|
|
Does anyone know anything about Tandem C, TACL or TAL ? It's related to HP NonStop servers, (formerly called Tandem), and I'd sure love it if one of you could point me in the right direction..
I'm looking for any info on these things. Google hasnt helped much, so if u know of some specific sites or messageboards, i'd be real grateful !
tia !
Bikram Singh
|
|
|
|
|
Anyone have any idea how I can change the speed at which the rebar opens/closes it's bars???
Is there a system setting or something I can change? And is there anyway I cause changes to occur only for the control I am hosting??
Thanks
Cheers
How do I print my voice mail?
|
|
|
|
|
:(Hello guru's
I am created one dialog box. From that dialog I am trying to access the next Dialog. LikeWise nearly seven dialog boxes. I acheive this by writing the code in the button.There are two main buttons in each Dialog. Next Button and Previous Button. Whenever I press the next I call the
dialogone objDialogOne;
objDialogOne.DoModal();
If I Press the Previous button, I use the same code. LikeWise Keep on going for the seven dialog box. At some sort of time the application hangs, I don't know why? Will it I have to destroy objects or Dialog. If so, I am having lot of controls like Combo box and Edit box and getting values from the user when the user press the button. If I Destroy the dialog box and delete the dialog will it affects the data that dialog holds.
Thanks and regards
The World is Too Much with us
|
|
|
|
|
Any reason why you are not using a wizard-style property sheet? It would sure be a lot easier than the road you are trying to take.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I don't know much about property sheet? but one of my senior programmer, says that he has facing lot of issues on propery sheet in WinCE, he ask me to do in Dialog.
Thank and regards
|
|
|
|
|
Anonymous wrote:
I don't know much about property sheet?
Which is all the more reason to at least try it, rather than letting a co-worker set the pace.
Anonymous wrote:
...he ask me to do in Dialog.
Does he not realize that a property page is a dialog?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hello,
I am using shellexecute inside a UI thread to run a dos type command, I would like the output from that command to be piped into a text file.. Any ideas?
some.exe >> c:\\text.txt
doesn't work.
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
First of all... The pipe is represented by the |, and it means that the output of a program is the input of another.
What you mean is simply the redirection of the output to a file. In that case, only one > (greater than) is necessary.
If some.exe > c:\\text.txt using SellExecute doesn't work, by using system("some.exe > c:\\text.txt") should.
Jaime
|
|
|
|
|
> = redirect output
>> = append redirected output
Neither > nor >> work with Shellexecute. I may have to use CreateProcess instead of shellexecute because I am waiting on a single object 'ShExecInfo.hProcess' to give the user a chance to kill the running process.
Everything is already coded with ShellExecute using SHELLEXECUTEINFO and it works great minus not being able to redirect the output to a file... It would suck to have to go back through my code and change all the ShellExecutes to CreateProcess, and I dont think system() would fit my application.
Thanks anyway,
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I had to shellexec cmd.exe with params of "/c some.exe >> log.txt"
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I'm curious why you are not using handles with the call to CreateProcess() . The hStdOutput , hStdInput , and hStdError members of the STARTUPINFO structure contain handles returned by GetStdHandle() . You can then use ReadFile() to read from the different handles.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I should have used CreateProcess from the get-go, but I didn't think I would need the output so I opt'ed for the 'easier to use' shellexecute. Bad judgement on my part. I may go back through my code and change to CreateProcess instead of ShellExecute.
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hi Rob ,
I do not have an exact answer to ur query. but , if ur looking for ways
to redirect the out put of a child process (created using Win32 API )
, i have got some pointers.
Redirecting the output to file is actually piping the output to the file or
some other process in the chain. One can use Anonymous pipes to redirect
the output to a file . Exact mechanism which u have to look for is
How to Create Anonymous PIPES ?
How Handle to the process can be retrieved ?
( if ur using CreateProcess instead of shellexecute u can )
How u can pipe the process to anonymous pipe etc
when i gave a search in the google
(Search string - Anonymous pipe process creation win32) , i got an excellent article at the following url
http://www.codeguru.com/Cpp/misc/misc/article.php/c277
Hope this helps
Praseed Pai
www.praseedpai.com
|
|
|
|
|
how do I convert a handle to an HWND to CWnd?
Thanks
|
|
|
|
|
Cwnd::Attach(HWND)
dont forget to detach
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I have a handle to a window,
I need to get a CWnd pointer variable to point to that window..
ex:
suppose I have "DWORD Handle" that is returning the handle to a window in a DWORD
and I have CWnd *pointCWnd
how do I get "pointCWnd" to point to the window for which the handle was returned byt the handle. ?
|
|
|
|