|
Have you tried setting the state directly by:
CTreeCtrl::SetItemState( hItem, TVIS_SELECTED, TVIS_SELECTED );
Dave
|
|
|
|
|
thanks, it is "as is" ok, but...
tree.SetItemState(hSel,TVIS_SELECTED,TVIS_SELECTED);
HTREEITEM h0=tree.GetSelectedItem();
as test, h0!=hSel.
even hSel looks as been selected (it has a selection mask).
do u have more good idea?
thx again
includeh10
|
|
|
|
|
This maybe a vague question but.. I have a fairly simple CAsyncSocket chat application (client/server). I would like to be able to send or receive files through CasyncSocket. Is this possible or do I have to use some other Class?? If its possible where would be a good place to start researching this? If it's not possible what class would be the best for sending and receiving files?
Thanks in advance!!
Rob Jones
|
|
|
|
|
Never mind I figured it out.
|
|
|
|
|
I need your help programmers , i need it for a project .
|
|
|
|
|
Look at the following article first:
http://www.codeguru.com/ieprogram/enumIE.html
After you find the active instance of IE, you can simply use the COM Interface IWebBrowser to do what you want.
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
Can some one help me?
in my program i need to know when the user hits Enter.
can some one tell me how do I test if the user has hit enter?
thank you.
(I'm programming in C)
|
|
|
|
|
In WM_KEYDOWN, check for VK_ENTER. Something like that.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
In the past, whenever I began noticing erratic behavior in VC++ 6.0 IDE, I would delete the ".dsw" file and let it create a new one when next I do a "Rebuild All".
This time I did exactly that, but when I did a "Rebuild All", strangely, VC++ didn't create a new ".dsw" file, and naturally when it went to link the files, it produced all sort of linkage errors.
First of all, why didn't VC++ create a new ".dsw" file, and perhaps just short of reinstalling VC++, what can be done that will let it resume following tradition? (I've already tried shutting down VC++ and then bring it back up, followed by reloading the project (etc.), but that didn't help.)
As a footnote, there is a Gbyte of memory on the machine, so that is not a factor, and while it is true I haven't hugged my machine lately, this is no way (I feel) for it to treat its user who has never lifted a finger in abuse to it.
Thanks.
William
|
|
|
|
|
AFAIK, .dsw files are the visual studio workspace project file, and should be recreated when loading a .dsp file and doing a "save all". normally, when Visual Studio starts going bad, it's the .ncb file that needs to be removed. and always to be done when the projects are closed.
Max.
|
|
|
|
|
Interestingly, I did delete the ".ncb" file after closing the project, and VC++ would dutifully create another one.
To add to the frustration, it is ONLY when I do a "Rebuild All" that I get all those linkage errors. If I were to just do a "Build", I'd get a clean compile and no error messages, but I'd also NOT get an object module and the program would not run.
UPDATE!!!
After several tries involving reloading the project, VC++ did create a new ".dsw" file, but the creation of a link module still doesn't happen.
William
|
|
|
|
|
You should not delete dsw file. It's a workspace file containig list of projects (stored in dsp files). Delete ncb file when the IDE is making problems.
If you already deleted the dsw file, try to open the dsp file, VS should create an dsw for it - only this one. If you had other projects in the workspace, add them manually.
Pavel
Sonork 100.15206
|
|
|
|
|
I want to get a handle to one of my toolbar buttons to disable it when its function is inappropriate. Yet, none of the CToolBar methods seem to have anything to do with disabling buttons... or am I missing something?
Seems like disabling (graying-out) a button should be easy enough, but my documentation says nothing about it. Anyone...?
|
|
|
|
|
|
Aha.
Anyone know offhand the easy way to get a handle to my mainframe's m_wndToolBar so I can send this message?
|
|
|
|
|
It's kept as m_wndToolbar in your CMainFrame class, however the proper way to disable buttons is to write an UPDATE_COMMAND_UI handler for that particular button's ID. That way MFC will automatically call your handler so you can disable the button (and associated menu item, if there is one).
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I have a dialog based app, whose main dialog (dlgMain ) has 3 buttons: "Exit App" (which exits the app), "Create Modeless Dialog" which creates a modeless dialog (dlgModeless ), and "Options", which displays a modal options dialog.
dlgModeless also sports an "Exit App" button. dlgModeless 's handler for "Exit App" simply delegates the task to dlgMain by posting it the appropriate WM_COMMAND message.
The user performs the following actions:
- Clicks "Create Modeless Dialog" in
dlgMain , causing the modeless dialog to appear.
- Clicks "Options" in
dlgMain , causing the modal Options dialog to appear.
- Clicks "Exit" in
dlgModeless , causing dlgMain to exit. While exiting, dlgMain properly destroys the modeless dialog. The problem is the modal "Options" dialog is still hanging around as an orphan window. I need to modify dlgMain 's "Exit App" handler to ignore the command if a modal dialog is being displayed.
My question is, how do I detect this without using ugly booleans? I was looking for Afx.../CWnd/Win32 calls to check this, but have come up empty handed.
Thanks,
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Two ways come to mind:- Make the modal dialog a member of your app or main frame class, then you can call
IsWindow() to tell if the dialog is open. - Call
IsWindowEnabled() on your main frame, which will return TRUE if it is disabled because the modal dlg is open.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hi Mike,
Actually the example I gave was a simplistic version of the real problem. In reality, the main dialog can display one of numerous modal dialogs (in response to various commands). I was hoping there would be a generic way to check if a window has a descendant modal dialog in progress.
Your IsWindowEnabled() trick fits the bill poifectly! Now why didn't I think of the obvious?
Many thanks!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Greetings...
I want a have Excel like flat tab in my application at the bottom of my tab control.
Can somebody suggest me a way or any article on net which tells me how to go through it.
I am not using MFC, only Win32 APIs
Thanks in advance.
Ritesh
|
|
|
|
|
I know this is MFC but the extended styles should apply for MFC and Win32 API. I'm not sure what the Excel like tabs are like but this style makes buttons out of the tabs. Is that what you're looking for?
m_pTabCtrl = new CMyTabCtrl;
CRect cltRect;
GetClientRect(&cltRect);
m_pTabCtrl->Create(WS_CHILD|WS_VISIBLE | TCS_BUTTONS | TCS_FLATBUTTONS, cltRect, this, IDC_TAB1);
DWORD dwExtStyle = m_pTabCtrl->GetExtendedStyle();
m_pTabCtrl->SetExtendedStyle(dwExtStyle | TCS_EX_FLATSEPARATORS);
m_pTabCtrl->ShowWindow(true);
TC_ITEM TabCtrlItem;
TabCtrlItem.mask = TCIF_TEXT;
TabCtrlItem.iImage = -1;
for(i = gSites.size(); i > 0; i--)
{
TabCtrlItem.pszText = gSites[i-1].GetId();
m_pTabCtrl->InsertItem( 0, &TabCtrlItem );
}
m_pTabCtrl->SetCurSel(0);
|
|
|
|
|
Hello there,
I'm writing a database program ...
I used ADO and Microsoft.Jet.OLEDB.4.0 for opening my Access 2000 database ...
I must install Jet 4.0 for using Access 2000 ???
or MSDAC 2.6 ???
I downloaded both of them, but i want to know which of them is neccessery to install for using ADO with Access 2000 ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
MDAC contains all you need for ADO with Access 2000.
Michael
Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
|
|
|
|
|
Thanks
Other question about MSDAC, in microsoft data access downloads i saw thease item available for download:
MSDAC 2.7 (it is version that is currently in xp os)
MSDAC 2.6(SP2)
MSDAC 2.5
Some of my users use still Win98, which item is better to update ?
MSDAC 2.7 or MSDAC 2.6 ??
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hadi_Rezaie wrote:
I must install Jet 4.0 for using Access 2000 ???
or MSDAC 2.6 ???
Both of them. The Jet files are not a part of MDAC from version 2.5 (or 2.6?) up.
Pavel
Sonork 100.15206
|
|
|
|