|
Hi praseed,
Thanks for your reply.
So, when do we use DWORD in C/C++? There is a lot of
DWORD value in the registry in the windows OS, but not
sure when to use it in programming.
Thanks
-----------------------------
C++ without virtual functions is not OO. Programming with classes but without dynamic binding is called "object based", but not "object oriented".
|
|
|
|
|
Hi ,
This is the defenition of DWORD in one of the microsoft's header file.
typedef unsigned long DWORD;
usigned long is only 4 bytes (32 bits ) on Intel and AMD 32 bit platform.
( ur confusion might have started from the fact that java long is 8 bytes )
if u use DWORD (win32 data types ) , ur code can be ported to 64-bit platforms without much problem ( at least that is what ms says ).
i feel , microsoft will make sure that DWORD is always 32 bits . Where as they cannot say the thing sure about c types like int , long etc. (with IA-64 or AMD-64 !)
praseed pai
www.praseedpai.com
|
|
|
|
|
By default, data items are aligned to a boundary that matches their size - not necessarily a DWORD. A short will be aligned on a two-byte boundary, a char on a one-byte boundary, and a double on an eight-boundary.
Also, the best way to use the pack pragma is to save and restore the previous alignment. This is done as follows :
#pragma pack(push, 1) // saves old packing and sets it to 1
...
#pragma pack(pop) // restores previous packing
__________________________________________
a two cent stamp short of going postal.
|
|
|
|
|
Hello,
I am having a problem with the CreateProcess method:
The following works, starting a Notepad
PROCESS_INFORMATION pi;
STARTUPINFO si;
ZeroMemory(&si, sizeof(STARTUPINFO));
si.cb = sizeof(si);
si.wShowWindow = SW_SHOW;
ZeroMemory(&pi, sizeof(pi));
CreateProcess(NULL, "Notepad.exe", NULL, NULL, FALSE,
0, NULL, NULL, &si, &pi);
but fails, if I replace the Notepad.exe with "iexplore.exe" for IE and "wordpad.exe" for WordPad. Any reason for this difference?
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
One possible reason is that notepad.exe is in the windows directory.
Kuphryn
|
|
|
|
|
That may very well be the problem. The MSDN docs says "The function will not use the search path.".
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|
|
Nice information, I will look into it.
Thanks for the support.
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
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!
|
|
|
|