|
We have an MDI app where each MDI window has toolbars of its own (ie. there are multiple docking toolbars on the main frame wnd and at least one fixed position toolbar on the MDI child wnds). And all of the buttons, on all of the toolbars, have tooltips.
but...
When you start the program, the only tooltips that will show are those that belong to toolbars on the main frame wnd. The only way to make tooltips start working on the child wnds is to move the mouse over a separator on the child wnd toolbars first. After you do this, tooltips work fine for everything. Clicking buttons doesn't help, moving over enabled/disabled buttons doesn't help; the separator is the key. And, you don't have to hover over it, just a quick fly over on your way to a button will do it.
This is sub-optimal.
Any ideas?
CheeseWeasle
|
|
|
|
|
I am finding this returns -1 in all cases in my program on a Windows 2000 machine. However when I run exactly the same code on another computer with in Windows XP it works correctly and returns 0, 1, 2 etc...
I need this as I have to know which image is being dragged across from the ListCtrl to a TreeCtrl.
Sounds strange to a novice like me and anyone who has come across a solution please HELP!
Failing this if anyone has bright ideas on a better method nice to hear from ya.
Btw, the imagelist was inserted using the InsertItem(int, LPCTSTR) not that that should make a difference.
Thanks
Noel
|
|
|
|
|
Noel Mulvihill wrote:
I am finding this returns -1...
And "this" is???
|
|
|
|
|
Sry - 'this' refers to the function GetHotItem() called as part of OnLButtonDown() in my CListCtrl. When one clicks on an image list - I expect the index of the currently selected image (0,1,2.. etc) to be returned.
This happens when I run in XP, but not when I run in Win 2000 (I just get -1).
Ta,
N
|
|
|
|
|
I wonder if it could be a difference in the underlying common control?
|
|
|
|
|
I don't know. I sort of thought it might be linked in some way to messages given some problems with CListCtrl other people seem to have with - and it's mentioned in MS Knowledge Base in the following article "PRB: No ANSI Notifications from Control Created in OnCreate"(Article ID: Q148533).
I tried the solution in this article but it didn't seem to work and probably needs to be modified anyway - even if I am (somewhere!) on the right track.
|
|
|
|
|
Here is a simple one for those of you who did it before:
Let's say I know the exact path inside the registry to a certain key and I just need it's value, how do I read the registry ?
Thanks,
Shay
|
|
|
|
|
RegQueryValueEx() , or use CRegKey::QueryValue() .
|
|
|
|
|
First of all, thank you.
but can you be a bit more specific and give me a short example?
If I use RegEdit to look for the parameter I am interested in, it is located in: MyComputer\HKEY_LOCAL_MACHINE\System\
It's value is :HOME1
Type:REGSZ
How do I read it into a CString or a char *
Thanks again,
shay
|
|
|
|
|
Shay Harel wrote:
but can you be a bit more specific and give me a short example?
Did you read the MSDN documentation for the two functions I mentioned?
|
|
|
|
|
Yes but I have problems finding what is the lSize ?
|
|
|
|
|
|
<br />
CString strMainKey = "System\\controlset001\\Control\\session manager\\environment\\";<br />
CRegKey regKey;<br />
CString reg_read;<br />
long lRes;<br />
unsigned long lSize;<br />
<br />
if (m_str_log_name=="")<br />
{<br />
<br />
lRes = regKey.Open(HKEY_LOCAL_MACHINE, strMainKey,KEY_ALL_ACCESS);<br />
regKey.QueryValue(reg_read.GetBuffer(0), "SYMMHOME1", &lSize);<br />
regKey.Close();<br />
reg_read+="\\symmwin\diag6";<br />
<br />
}
I am almost there but the problem is that after I do:
reg_read+="\\symmwin\diag6";<br />
reg_read turns to be only "\\symmwin\diag6"........
any idea why ?
|
|
|
|
|
Per MSDN, the third parameter to QueryValue is:
"[in, out] The size of the string data. Its value is initially set to the size of the szValue buffer."
So, you need to initialize lSize to the size of reg_read . However, reg_read.GetBuffer(0) is pretty useless in this case. I would opt for another value besides 0. Something like 256 should be enough to hold the value.
lSize = 256;
lReturn = regKey.QueryValue(reg_read.GetBuffer(lSize), "SYMMHOME1", &lSize);
regKey.Close();
if (ERROR_SUCCESS != lReturn)
|
|
|
|
|
I want to drag drop files from my application to Windows Explorer. To accomplish this I use COleDropSource and COleDataSource together with clipboard format CF_HDROP. This works.
Now I would like to rename the file during the drag drop operation. From reading the MSDN documentation I think that I have to use the clipboard format identifier CFSTR_FILENAMEMAP as an additional format on the COleDataSource object. This format should contain the new name. But I can't get this to work. Nothing happens. Probably I'm specifying this wrong.
Has anybody done this before? An example or some extra information would be very helpfull.
|
|
|
|
|
I'm trying to create a server which accepts client connections.
....
Address.sin_family = AF_INET;
Address.sin_port = htons(1212);
Address.sin_addr.s_addr = htonl(INADDR_ANY);
IntReturn = bind(Listen, (struct sockaddr *) &Address, sizeof(Address));
IntReturn = listen(Listen, 10);
IntReturn = sizeof(RemoteAddress);
Client[Computer].ClientSocket=accept(Listen, (struct sockaddr *) &RemoteAddress, &IntReturn);
...
Clients from any! ip can connect to my server on port 1212..
My server should not accept connections from any ip, so how do I get my server to only accept connections from example 10.0.0.105 ?
I thought about changing this line
Address.sin_addr.s_addr = htonl(INADDR_ANY);
to
Address.sin_addr.s_addr = inet_addr("10.0.0.105");
but this does not work, am I doing something wrong?
Thanks
|
|
|
|
|
Use a firewall. Winsock doesn't support connection filtering.
|
|
|
|
|
Well, thats not an option, since I'm using it on a LAN.
|
|
|
|
|
Get IP from the connected client. Check if the IP is an accepted IP and if it's an accepted/allowed IP then start sending datta etc. if not, just disconnect the socket.
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Hello
Does anyone knows a way to let CHtmlView open HTML pages with pictures in the TIFF format?
Thank you in advance
|
|
|
|
|
Hello
Please, help me!
I need a way to place a TIFF picture in the CHtmlView.
Does anyone know how to let CHtmlView to decode TIFFs?
Even a way to place picture code in BMP or JPG format into the WebBrowsers object model would help.
I think it can be done using IHTMLDocument or other similar interface, but could not find how
Thank you in advance.
|
|
|
|
|
I need to use truetype fonts in a drawing application; in the files generated
by this application, the fonts used are identified not by their font name but by a unique number. I could generate myself arbitrary ID's ans save the associations
ID --> Font name in a separate file.
But of course it would be better if Windows could give me a ID guaranteed to be unique
for each truetype font.
In MSDN i found the structure EXTLOGFONT, which has a member elfMatch :
"A unique identifier for an enumerated font. This will be filled in by the graphics device interface (GDI) upon font enumeration."
Is seems to be what i'm looking for (but not so sure : do these ID change at each
font enumeration ?)
Problem : in MSDN I can't find a function which would output this structure.
|
|
|
|
|
You can not rely on the IDs being unique. They are only unique internally to the running application and that number could be (will be) different every time.
|
|
|
|
|
Thanks. However i would like to experiment ...
Can you tell me how to get that structure ?
|
|
|
|
|
When I am setting up a listener socket, I found that if I use LOCALHOST with inet_addr, that socket can only accept connections from the local machine as indicated in 1) in the following code. However, if I use the machine name, I can accept connections from anywhere but the local machine, as indicated in 2). My question is, is there a way to set up a listener socket that can accept client connections from anywhere including the local machine? Any help will be appreciated.
if ((phostent_far_Hostent = (struct hostent far*)gethostbyname(getenv("COMPUTERNAME"))) == NULL)
{
return INVALID_SOCKET;
}
ZeroMemory((char*)&sockaddr_in_SockAddr, sizeof(sockaddr_in_SockAddr));
1) sockaddr_in_SockAddr.sin_addr.s_addr = inet_addr(LOCALHOST);
2) CopyMemory((char*)&sockaddr_in_SockAddr.sin_addr, phostent_far_Hostent->h_addr, phostent_far_Hostent->h_length);
sockaddr_in_SockAddr.sin_family = phostent_far_Hostent->h_addrtype;
sockaddr_in_SockAddr.sin_port = htons(int_Port_F);
int_SockAddrStructLen = sizeof (sockaddr_in_SockAddr);
if ((SOCKET_Socket = socket(AF_INET, SOCK_STREAM, 0)) < 1)
{
return INVALID_SOCKET;
}
if (bind(SOCKET_Socket, (struct sockaddr*)&sockaddr_in_SockAddr, sizeof sockaddr_in_SockAddr) != 0)
{
closesocket(SOCKET_Socket);
return INVALID_SOCKET;
}
|
|
|
|