|
Without playing around with this, I suspect that you'd have to override the OnSize() method for the dialog's CWnd. The original is probably taking into account the size of the taskbar. That's the first place I would look.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
I check the size of the window in OnPaint. The dialog
is sized as it should be-- full screen. It paints that
region where the parent shows through as well. It's as
if the parent window were made up of two parts, with
the region where the taskbar would have been, behaving
as if it were topmost. Most strange-- enough that I
suspect some unknown OS behavior or a bug.
(I'm running on XP here.)
|
|
|
|
|
I see this same problem. I am creating a full screen borderless window with flags TOPMOST for my screen saver window. On Windows 98 when I call the password verification dialog, the dialog only sometimes draws above the screen saver window. MS screen savers work fine, but they must be doing some magic thing to get theirs to work? I have tried several things, none of which seem to work including:
1) Setting my full screen window to the bottom of the Z order.
2) Creating the dialog in another thread.
3) Disabling the full screen window painting when the dialog is active, thinking it might be painting over the dialog.
But none of these things seem to work, any ideas here, I imagine it might be the same problem as Scott H. Settlemier is having.
Stop playing AC2 and please help us oh great Win32 gurus...
|
|
|
|
|
I've had your same problem last week...
It's due to the system workarea.
You must resize the workarea at the beggining of your app. and resize again at the end of your app.
here's the code:
<br />
CRect rectWorkArea;<br />
<br />
rectWorkArea.left = 0;<br />
rectWorkArea.top = 0;<br />
rectWorkArea.right = ::GetSystemMetrics(SM_CXSCREEN);<br />
rectWorkArea.bottom = ::GetSystemMetrics(SM_CYSCREEN);<br />
<br />
SystemParametersInfo(SPI_SETWORKAREA,0,&rectWorkArea,SPIF_SENDCHANGE);<br />
then you can resize your dialogs and windows as always...
NOTE:
I had to resize the windows using this:
<br />
this->SetWindowPos(&wndTopMost,0,0,::GetSystemMetrics(SM_CXSCREEN),::GetSystemMetrics(SM_CYSCREEN),SWP_SHOWWINDOW);<br />
TopMostFlag is an option...
this had to be done in order to avoid flickering when I used the common way of resizing...
Hope this helps...
|
|
|
|
|
NEW INFO:
I checked the clip box in OnPaint. It was
0,30 to 1024,768!!! But the area showing
through was at the bottom. It looked like
the window had been somehow moved from
where I set it with SetWindowPos. So I
checked the window rect and the window
was now 0,-30 to 1024,738!! I had set the
coordinates to 0,0 to 1024,768.
The SetWindowPos call did not use SWP_SHOWWINDOW
since I wanted to wait until all of my initialization
had completed in OnInitDialog. When I added
SWP_SHOWWINDOW, the problem cleared up.
So it looks to me that there may indeed be a Windows
bug here. Something shifted my window up, just
the amount that is the size of the taskbar.
If I place the taskbar to the side, the window will
get shifted to the side.
Very perplexing...
Any clues as to what is happening?
|
|
|
|
|
That is most likely the task bar shifting the window about. The taskbar must always be visable and will move windows accordingly if they get in the way. Try setting the taskbar to 'AutoHide' then see if you have these same issues, I bet you won't. But I wonder if the taskbar should even be moving your window since you are manually forcing it be fullscreen, I would think the taskbar should only move windows that are maximized, not that set the window position and size directly.
|
|
|
|
|
Right, I don't think anyone should be moving the window
after I have set its position. It is not a maximized window,
merely a full screen window. That the problem does not occur
if I pass SWP_SHOWWINDOW in the call to SetWindowPos, makes
me suspect that this is not just unexpected behavior, but
a bug. (after all, it shouldn't matter a lick to the OS
whether the window has been painted already or not!)
|
|
|
|
|
I am opening a text file with fopen. I can read in text strings and assign them to a CString. I am trying to set the CString in a CStringArray for later use but the computer doesn't like it.
CString s;
FILE *pSkinfile = fopen ((LPCTSTR) lpFileName2, "rt");
if (!pSkinfile)
{
return false;
}
do
{
fgets (szLine, 256, pSkinfile);
for(zero = 0; zero < numSurf; zero++)
{
match = strncmp (szLine, stringArraySurfaces.GetAt(ij), n_lengthArray[ij]);
if(match == 0)
{
sscanf (szLine, "%s", S1);
->This line screws it up stringArrayPath.SetAt(ij,S1);
}
ij++;
}
ij = 0;
}while(feof(pSkinfile) == 0);
fclose (pSkinfile);
Is this because I'm reading in a stream and can't output to a variable?
|
|
|
|
|
You didn't say what the error was, so I may be way off base. Did you set the size of stringArrayPath using SetSize. The SetAt function will not grow the array, so you need to be sure you are writting to a valid location. You should either set the size of the array or use the SetAtGrow function or the Add function.
Gary Kirkham
A working Program is one that has only unobserved bugs
|
|
|
|
|
Or better yet, use
int nStrings = -1;
std::vector<CString*> pszStrings;
then for each new string:
{
nStrings++;
pszStrings->push_back(new CString);
pszStrings[nStrings]->Format("%s",YourStringToSet);
}
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
AS has been said, you should use vector. I'd also use iostreams, then if you use std::string it's as easy as using getline to read in the strings, none of this stuffing around with C.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
There is no reason not to use MFC. The problem lies with the stringArrayPath.SetAt(...); you have not preallocated the size of the array and should have used stringArrayPath.SetAtGrow().
First, though, drop the fopen and use the CStdioFile class.
For the loop, simply use:
<br />
CString str;<br />
<br />
while (file.GetString(str))<br />
{<br />
<br />
stringArrayPath.Add(str);
<br />
stringArrayPath.SetAtGrow(entry, str);<br />
}<br />
<br />
|
|
|
|
|
I'm getting an error error 1063 in StartServiceCtrlDispatcher.
Can someone tell me what this is?
Also, how do I get a description for error 1063?
Thanks,
Maloo
|
|
|
|
|
In Visual Studio 6.0:
Menu: Tools->Error Lookup
Enter the number then Lookup
1063 = "The service process could not connect to the service controller. "
Try a search on Google Groups: there are a few threads that reference this issue.
Debbie
|
|
|
|
|
Hi,
I derived a class from CTreeCtrl and added a handler for
OnLButtonUp. But clicking on an Item never gets it fired. After some debugging I found that it only gets called if you don't click on an Item, but within the client area or if you doubleclick an item. Couldn't find anything in the MSDN.
van Padoea.
|
|
|
|
|
are you transfering buttondown to base class?
t!
|
|
|
|
|
I do but that doesn't matter because it won't come there anyway!
void CSelectionTree::OnLButtonUp(UINT nFlags, CPoint point) <br />
{<br />
UINT uFlags = 0; <-- will not reach this!<br />
HTREEITEM hti = HitTest(point, &uFlags);<br />
<br />
if( uFlags & TVHT_ONITEMSTATEICON )<br />
{<br />
if(GetCheck(hti))<br />
SetItemImage(hti, 2, 2);<br />
else<br />
SetItemImage(hti, 0, 0);<br />
}<br />
<br />
CTreeCtrl::OnLButtonUp(nFlags, point);<br />
}
|
|
|
|
|
i know you speaking about
but i spoke about down message (or maybe any pretranslate, ...)
make minimal tree example and it must work
t!
|
|
|
|
|
Hi,
I'm having some problems reading a file containing null-terminations.
When I try reading the file into a string, it stops at the first binary null ('\0').
On unix we have an excellent command, the tr command.
It would solve the problem:
To delete all NULL characters from a file, enter:
tr -d '\0' < textfile > newfile
Is there a way of either translating the NULL's, removing them or even skipping them?
If anyone have suggestions, please respond.
|
|
|
|
|
You can use memcpy to reading the file into a string. You need to get the string's pointer first.
|
|
|
|
|
If you just need the whole files content, without any line-breaks etc, reading it in binary mode is the way to go.
Then you can copy it into a std::vector < char > , and use std:: algorithms on it.
--
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
I've got a wizard generated ActiveX Control (generated by the "MFC ActiveX Control Wizard", not "ATL COM AppWizard"). I've got an enum defined in my IDL which defines valid input for a property like this:
library MCOMBOLib<br />
{<br />
importlib(STDOLE_TLB);<br />
importlib(STDTYPE_TLB);<br />
typedef enum _ComboboxStyle <br />
{<br />
[helpstring("Dropdown")] cbsDropdown = 0x0002L,<br />
[helpstring("DropdownList")] cbsDropdownList = 0x0003L<br />
} ComboboxStyle;<br />
[ uuid(0ABDCD25-EF65-46C6-8F0D-F181400B4A74),<br />
helpstring("Dispatch interface for MCombo Control"), hidden ]<br />
dispinterface _DMCombo<br />
{<br />
properties:<br />
[id(1)] ComboboxStyle Style;<br />
}<br />
[ uuid(51771D17-EB86-4830-8DF6-D6F8183881C5),<br />
helpstring("MCombo Control"), control ]<br />
coclass MCombo<br />
{<br />
[default] dispinterface _DMCombo;<br />
}<br />
The problem is, that when I try to use the value in the constructor (to give the style property a value, it doesn't seem to find the enum at all) . Could anyone shed some light on this?
TIA!
|
|
|
|
|
Hello.
I'm writing an ActiveX control which was created by MFC ActiveX ControlWizard. I run the ActiveX control in Internet Explorer. I'm trying to obtain a pointer to the container to be able to change the html-page from the ActiveX control.
In the control class which is derived from COleControl I have to following code:
LPOLECLIENTSITE lpSite = GetClientSite();<br />
LPOLECONTAINER lpContainer; <br />
if(lpSite == NULL) AfxMessageBox("Click OK to crash..."); <br />
lpSite->GetContainer(&lpContainer);
The problem is that GetClientSite() returns NULL so the application crashes.
Any help is greatly appriciated. Thanks in advance.
/Charlie.
|
|
|
|
|
Hello
I have a question about the use of CHtmlView I have never used this before so I am a bit confused at the moment.
I am going to use this view to produce some statistics from a SQL Server database. The app that I've created used to display the result in a basic window but this got a bit boring to look at, so I thought that I could "Hot" things up a bit by using the html support. The option for what kind of statistics that is going to be produced should not be selected in the new View but from another window.
But my question is about the best way to use this view. should I make my app to create the *.htm document from scratch and the browse to it. Or is there a better way for this ?
Cheers
/Henrik
|
|
|
|
|
you can inject the data into a a CHtmlView in many ways - you can use the about: protocol or you could use the DOM - both of these are documented and are only really good for injecting HTML and images coming from a 3rd source eg the disk or maybe resources (ie res: protocol)
My favourite way is an Asynchronous Pluggable Protocol that I did for on old employer that I could use to deliver html and images on the fly to the viewer and I do not have to open any sockets to do so.
Technically speaking the dictionary would define Visual Basic users as programmers. But here again, a very generalized, liberal definition is being employed and it's wrong - just plain wrong - Tom Archer 5/12/02
|
|
|
|