|
Hello,
How can i make right aligned Tree control ?
I want to show the icons in right of tree ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
In standard way - nowise. There is only sole method to do it - to write own tree. It might be possible to use ownerdraw style, but as I understood you need to mirror whole tree, with buttons, lines and etc, didn't I? In this case ownerdraw style won't help.
|
|
|
|
|
We are using one ocx control to play our custom files from internet explorer. This main ocx will load more than 10-15 ocx/dlls. At this point it will cause a crash in Windows 95 systems. We are using internet explorer v5.5. McAfee antivirus protection is enabled in the client system. We should have to load one simle ocx control or simple applet, before loading the main ocx(or plugin dll) to get the crash. We are building all the components in this project in release (minimum dependency ) - MFC statically linked.
We can also simulate this problem when loading these components from the creation time of the main ocx(plugin dll)using loadlibray(API).
It is a very critical client side problem and should have to be solved as early as possible. So we want an urgent solution for the same. Looking for a positive support from you.
|
|
|
|
|
I haven't done any GUI stuff in quite a while, so I wonder what I am missing here. MY forte has been mostly backend code and implementing algos. I know I sound like a VB guy (I clicked everywhere but nothing seems to happen!), but I really am so desperate that I really did click everywhere, but nothing seems to happen. Please help me out someone. It's something very obvious, I know, but when I don't get it, I don't get it. I need someone else to tell it to me. All of us have these moments, I am sure.
I have a combo box in a dialog box which shows up as a tab window. I have filled all the data that must initially show up in the combo and specified these styles for it:
visible
tab stop
type: drop list
owner draw: no
vertical scroll
The problem is that when I click on the combo box, it doesn't uh, drop down. Though if I use the up down arrow key, I can navigate through the options. I haven't yet attached any code to it to see if I can get the selected item back, but I am sure I would. What could be the problem? This combo box is inside a tab control which is inside a form view in an SDI app. The dialog box which contains this combo box has the following styles defined:
Style: Child
Border: none
All other check boxes are unchecked.
I tried to do the same thing in another project, a dialog based one, just to test things, and here things are absolutely fine. All the styles are the same, except for the dialog box, but I don't see how that should make any difference.
Someone please help me, I would be very grateful.
Thanks in advance,
Muralia
|
|
|
|
|
Don't feel bad, a friend spent two days trying to figure this out, and I looked at it at least four times before I got it. Go to the dialog editor, click on the arrow in the combo box, and then grab the little box in the middle of the bottom line and drag it down. You're setting how far it will drop, and for some moronic reason, the default is zero, so it won't drop at all.
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
|
|
|
|
|
Wow, that did it! Thanks a lot. You are my saviour!
|
|
|
|
|
Hi,
Is there any way to Invalidate the window without using
Invalidate() or RedrawWindow(..RDW_INVALIDATE )?
|
|
|
|
|
Why do you need another way ?
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
|
|
|
|
|
I want to send WM_ERASEBKGND message to the control.
|
|
|
|
|
Neha wrote:
I want to send WM_ERASEBKGND message to the control.
SendMessage(YourHandle, WM_ERASEBKGND, YourHDC,0)????
But for what? It can't give you anything useful. Use InvalidateRect if you want to repaint certain rectangle of the window.
|
|
|
|
|
Use RedrawWindow with the RDW_ERASENOW flag, and if you want a WM_PAINT message to be sent before the function exits use the RDW_UPDATENOW flag as well.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
InvalidateRect, InvalidateRgn, UpdateWindow, ValidateRect adn ValidateRgn are all implemented in terms of RedrawWindow with a different combination of flags.
Just look at the documentation for all of hte flags for RedrawWindow in order to do the task that you are looking to do. You can force the window to repaint before the function returns, or you can simply queue it to repaint a certain portion. You can force the child windows to repaint as well as the parent windows of your current window.
Here is an article that I wrote that goes into detail about RedrawWindow and the update region of a window:
Guide To Win32 Paint for Intermediates[^]
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi CPians,
Is there an easy way to detect if a DLL is 16 or 32 bit?
Also what about EXEs?
Regards,
Victor
phpWebNotes is a page annotation system modelled after php.net.
http://webnotes.sourceforge.net/demo.php[^]
|
|
|
|
|
Probably by looking at the header. 16-bit binaries have a NE header, 32-bit have a PE header.
--Mike--
Friday's GoogleFight results: Britney Spears 2,190,000 - Erica Weichers 23
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Thanks for the hint
I had a look at a 16-bit/32-bit EXEs/DLLs and noticed the NE / PE. However, all files start with MZ which most probably reflects a DOS EXE header that acts as the stub. Do you know how to retrieve the information of the NE/PE. I assume the offset in the file might be different due to different stub sizes.
Regards,
Victor.
phpWebNotes is a page annotation system modelled after php.net.
http://webnotes.sourceforge.net/demo.php[^]
|
|
|
|
|
Matt Pietrek, "Windows 95 System Programming Secrets", Chapter 8. May be, it will help you.
|
|
|
|
|
Use SHGetFileInfo.
If uFlags contains the SHGFI_EXETYPE flag, the return value specifies the type of the executable file.
Read in MSDN about SHGetFileInfo.
|
|
|
|
|
Thanks a lot Dudi, I finally got a chance to test it and it worked like a charm..
Regards,
Victor
phpWebNotes is a page annotation system modelled after php.net.
http://webnotes.sourceforge.net/demo.php[^]
|
|
|
|
|
Ok, I keep hitting else statement saying a 'Duplicate value found in tree' following the first insert. I haven't a clue as to why, does anyone see something I am missing? Thanks in advance.
struct stars
{
char name[25];
char designation[12];
char constellation[3];
unsigned int right_asc_one;
unsigned int right_asc_two;
signed int decline_one;
unsigned int decline_two;
float vis_magnitude;
};
void BinaryTree::InsertNode(stars value)
{
TreeNode *newNode,
*nodePtr;
newNode = new TreeNode;
strcpy(newNode->value.name, value.name);
strcpy(newNode->value.designation, value.designation);
strcpy(newNode->value.constellation,value.constellation);
newNode->value.right_asc_one = value.right_asc_one;
newNode->value.right_asc_two = value.right_asc_two;
newNode->value.decline_one = value.decline_one;
newNode->value.decline_two = value.decline_two;
newNode->left = newNode->right = NULL;
if (!root)
root = newNode;
else
{
nodePtr = root;
while (nodePtr != NULL)
{
if (strcmp(value.name,nodePtr->value.name) < 0)
{
if (nodePtr->left)
nodePtr = nodePtr->left;
else
{
nodePtr->left = newNode;
break;
}
}
else if (strcmp(value.name,nodePtr->value.name) > 0)
{
if (nodePtr->right)
nodePtr = nodePtr->right;
else
{
nodePtr->right = newNode;
break;
}
}
else
{
cout << "Duplicate value found in tree.\n";
break;
}
}
}
}
Nick Parker
Not everything that can be counted counts, and not everything that counts can be counted. - Albert Einstein
|
|
|
|
|
I do nto see anything wrong. Why don't you try to see in the debugger which strings are actually stored and compared ?
~RaGE();
[Edit] I looked at it once again, and i am pretty sure you're trying to insert two times the same values.
|
|
|
|
|
Hello, I can't seem to find an elegant way to do this. I've checked all the docs I could find, went through MSDN but I think I'm missing something fundamental here:
I have a _bstr_t variable (well, technically it's an imported com function that returns a _bstr_t) and I need to use it with the CString Format function,
I.E. (simplified greatly):
CString strThis;<br />
_bstr_t _bstrThat("hello");<br />
strThis.Format("%s",_bstrThat);
Now that obviously wouldn't work so I tried various ways of casting the _bstr_t without consistent success (LPCTSTR).
What I've done that works every time is:
strThis.Format("%s",CString(_bstrThat));
But that's obviously a really bad solution (there are dozens of com calls to construct each CString required in the format function.)
I know that I can assign them to individual CString variables easily, but that would be an even worse solution in this case due to the large number of functions that need to be called in the COM server for each CString query.
(Why do I need to do this you might ask? I'm working between a COM control and a database and need to take data out of the COM control and construct a SQL query to update the database.)
Any help would be greatly appreciated.
|
|
|
|
|
A _bstr_t has overloaded operators for both const char* and const wchar_t*, so you can do something like:
strThis.Format( _T("%s"), (LPCTSTR)bstr );
and it does the appropriate conversion (unicode to TCHAR).
Dave
|
|
|
|
|
Sounds absolutely ideal and solves the problem I was seeing when I tried that but missed the _T conversion macro so was getting some strange results.
That points me in the right direction, I'll dig into the docs again now that I have an idea where I went wrong.
Thank you.
|
|
|
|
|
This should work:
strThis.Format("%s", (LPCTSTR)_bstrThat);
However, this is also perfectly fine:
strThis = _bstrThat;
or
strThis.Format("%s",CString(_bstrThat));
I don't know where you get this: there are dozens of com calls to construct each CString required in the format function. Did you actually step through the CString or bstr_t code? And even if all those calls are being made, like you say, so what? Are they really slow?
Yet other ways:
USES_CONVERSION;<br />
strThis.Format("%s", W2A(_bstrThat));
or perhaps even:
strThis.Format("%S", _bstrThat);
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Alvaro Mendez wrote:
I don't know where you get this: there are dozens of com calls to construct each CString required in the format function. Did you actually step through the CString or bstr_t code? And even if all those calls are being made, like you say, so what? Are they really slow?
Hello Alvaro, thank you for the suggestions. What I meant by the dozens of COM calls was that I have to call the COM object which is an interface to an accounting program 12 (or more) times to retreive a complete dataset to use in my SQL append query. This means that I would need (using the current method) to call the CString constructor 12 times to construct one SQL statement. I didn't mean that COM had anything to do with CString itself.
It isn't in fact slow at all, the bottleneck is in the database update, not reading the data from the COM component and building the SQL query, that's just my "old school" programming subconscious(circa 8088 Assembler)that screams loudly when a single bit is left on the table.
|
|
|
|
|