|
Hi,
I tried below code to visible tree control item; I have derived my class from CTreeCtrl.
if (stricmp(SelectStr.c_str(), CompareStr.c_str()) == 0) {
SelectItem(hItem);
EnsureVisible(hItem);
}
In spite of the code calling EnsureVisible on the tree ctrl, the selected node remains hidden under the horz. Scrollbar. You have to click the down arrow on the vert. scrollbar exactly once to see the (pre)selection.
This problem is only when I have horz. Scrollbar on my tree control.
Even I tried this one also,
//HTREEITEM htreeItm = GetFirstVisibleItem();
//if( EnsureVisible(htreeItm)){
// int cool = 0;
// cool = 1;
//}
But it’s returns false when I have horz. Scrollbar.
Can anybody please help me?
Thanks,
Rakesh.
|
|
|
|
|
Hello,
My application is pretty heavy.
It takes about 10 seconds until it's shown to the user, until then, the user don't see a thing.
I want to change the cursor to hourglass before the window is shown.
BTW, my window is created, I just don't show it, until all its components are loaded.
How can I implement this?
I tried to use SetCursor, but when I move my mouse over the background windows it changes back to arrow right away.
Thanks,
Meni.
|
|
|
|
|
If you are using MFC, create a CWaitCursor object, it will manage the hour glass as long as the object is instantiated.
<br />
{<br />
CWaitCursor waitCursor;<br />
<some lengthy operation><br />
}<br />
Change of fashion is the tax levied by the industry of the poor on the vanity of the rich
Fold with us! ¤ flickr
|
|
|
|
|
Sorry, it doesn't help.
I'm not using MFC. I'm using win32...
|
|
|
|
|
|
The problem is that: when the window is still invisible and I set the cursor to hourglass, even if i'll alter the WM_SETCURSOR handling it won't solve it, because my window doesn't get the WM_SETCURSOR messages, because the mouse is over other windows!
How can I implement it, so no matter where my cursor is, it'll show an hourglass cursor.
Thanks you.
|
|
|
|
|
Hi,
I guess your Application Window is not shown till all of the component get loaded.
setCursor has effect for the window only, since the window is not actually shown, set cursor won't have effect.
I think typically scenarios are handled by "Splash Screens". A simple window, its sole purpose is to give the user a feel that application has started and also it can show the progress of loading. Try Something like splash screens.
Best Regards
Raj
|
|
|
|
|
Before going to splash screen strategy, where did you find that icons are applied on windows only? Can you please send a link?
How about lets say capturing the mouse (or something) and then set the icon?
|
|
|
|
|
That doesn't really need a link - its pretty obvious in today's forced multi tasking environment. The window the mouse is over gets the WM_SETCURSOR messages.
The only way to do your plan is to create a transparent window covering up the whole desktop (which can be a headache on a multimonitor system), or just simply do a splash screen.
The splash screen has the advantage of being able to display some sort of progress as your application initialises bit-by-bit.
Iain.
|
|
|
|
|
Hi,
Please search for links.
Simply think can you set cursor for non window application application.
Mouse capture is released when the user explicitly switched to next application(for eg: pressing WINDOWS key, Alt + tab), this can happen as your application is not started in 10 seconds.
|
|
|
|
|
use 'BeginWaitCursor()'and 'EndWaitCursor()'
between these two function calls write ur body of the function.
the moment it calls the BeginWaitCursor() arrow cursor will change into hour glass and when it reaches EndWaitCursor() hour glass will change into arrow cursor.
for ex:
void C01Dlg::OnRelay()
{
BeginWaitCursor();
//
//your function body
//
//
EndWaitCursor();
}
wherever you move ur mouse pointer it will be a hour glass only..
try it out.
ok..
bye.
-- modified at 7:48 Tuesday 26th June, 2007
regards
sudhakar
|
|
|
|
|
Can anyone point me to a good resource that explains - in some detail - all the project settings and the like in Visual Studio (both VC6 and VS2005).
t.i.a
Lee
|
|
|
|
|
Look in MSDN[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
MSDN ?
Are you able to use it to find usefull information on it ?
|
|
|
|
|
when stepping through the code is failing with the following message:
"First-chance exception at 0x7c90eb74 in socketTest.exe: 0xC0000008: An invalid handle was specified."
However if I run from the command line all is ok.
Any ideas why?
|
|
|
|
|
If the exception is in your code, then what's the code causing the exception?
If the first-chance exception occurs in another module, but the app continues to run normally,
then the exception was handled by the other module.
Try continuing to step through the code after the first-chance exception - if the exception isn't
handled you'll find out very soon
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Mark Salsbery wrote: If the exception is in your code, then what's the code causing the exception?
I don't know. It runs without any exceptions in debug and release mode. Only when stepping through in the IDE throws an exception.
The code is something like:
<br />
smtpSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);<br />
if (smtpSocket == INVALID_SOCKET) <br />
{<br />
throw "Can't create socket ...";<br />
WSACleanup();<br />
return;<br />
}<br />
It throws an exception at the socket call and if I continue it throws another at the WSACleanup call.
The strange thing is that it only occurs, as I sad when stepping through the code.
|
|
|
|
|
Have you called WSAStartup() somewhere?
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Mark Salsbery wrote: Have you called WSAStartup() somewhere?
Yep. Just a couple of lines before
<br />
int errorCode = WSAStartup(MAKEWORD (2,2), &wsdata);<br />
if (errorCode !=0)<br />
{<br />
ThrowWsaError(errorCode);<br />
return;<br />
}<br />
<br />
if (LOBYTE(wsdata.wVersion) != 2 || HIBYTE(wsdata.wVersion) != 2) <br />
{<br />
throw "Winsock DLL version error ...";<br />
WSACleanup();<br />
return;<br />
}<br />
<br />
smtpSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); <br />
The truth is that I also tried another example (an excerpt from a book) and it happening there also. I tried with VC6, VS2005.
Anyway it runs fine just the question "why" bothers me...
|
|
|
|
|
Zoltan Balazs wrote: It throws an exception at the socket call and if I continue it throws another at the WSACleanup call.
If the socket() call is failing, and you get to the WSACleanup() call, that doesn't sound like
it's running fine.
Strange
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
I know.
Try it
|
|
|
|
|
I did!
On a Win32/Multithread DLL CRT/Unicode build, running VS2003 .NET on XP Pro SP2.
I wish I COULD reproduce it! That would make a possible solution SO much easier
Just to make sure I'm following...On the same build, it runs fine outside the debugger
environment (including getting an actual valid, working socket), but when run in the debugger,
the socket() call fails, yet none of the exceptions go beyond first-chance (meaning they were
handled). Is that correct?
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Mark Salsbery wrote: Just to make sure I'm following...
Yes, that's correct.
I tried and reproduced also using VS2003 on XP Pro SP2.
The compiler command line is
/Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Gm /EHsc /RTC1 /MT /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /nologo /c /Wp64 /ZI /TP
and I'm linking against ws2_32.lib.
All has the default settings, just created an empty console project and added ws2_32.lib to the linker.
And thanks for taking the time to check this out.
|
|
|
|
|
I tried your code again on VS 2005 Express (I usually use 2003 .NET) and was still unable to
reproduce it.
I wonder if something is up with your TCP configuration. Here's the output messages I get at
the calls in question...
socket(...)
'TestWin32Console.exe': Loaded 'C:\WINDOWS\system32\wshtcpip.dll', No symbols loaded.
WSACleanup()
'TestWin32Console.exe': Unloaded 'C:\WINDOWS\system32\wshtcpip.dll'
'TestWin32Console.exe': Unloaded 'C:\WINDOWS\system32\hnetcfg.dll'
Something may be failing in your wshtcpip.dll, causing the exception.
Otherwise, I have no clue on this one. I've never had the same problem using Winsock2 and I
haven't heard of others with the same problem either
If I think of something I'll definitely let you know!
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
The strange thing is if I press "Ignore" the socket creation will succeed and I can debug my app.
I will try this on another computer.
|
|
|
|