|
Hi,
prithaa wrote: can i get rid of the cursor or this is not possible.
You need to handle the WM_SETFOCUS message and not call the base class handler to hide the carot.
Best Wishes,
-David Delaune
|
|
|
|
|
thank you naveen
thank you david
|
|
|
|
|
I have a CTreeCtrl defined in my header with a instance of m_cTree. Here's a brief description of how the Tree looks:
[+] Reports (main Heading)
[+]Construction (child of Reports)
[+] Materials (child of Construction)
Materials Report.txt(the ".txt" is only to show you this is the actual report)
[+]Maintenance (child of Reports)
Maintenance Report.txt(the ".txt" is only to show you this is the actual report)
[+] Cost (child of Maintenance)
[+]Exspenses (child of Reports)
[+] Job Cost (child of Exspenses)
Exspenses Report.txt(the ".txt" is only to show you this is the actual report)
======================= end of example ======================
In OnNM_ClickTreeCtrl()
I cannot get the reports using this:
HTREEITEM hItem= m_cTree.GetSelectedItem();
HTREEITEM hChildItem = m_cTree.GetChildItem(hItem);
CString sSelText= m_cTree.GetItemText( hItem );
What is returns is whatever is selected including the button("[+]", the main heading, each child and finally the report. How do I only receive the click on the Reports themselves, not all the headings?
PLEASE use my example in your explaination, WITH(please) the appropriate code.
Thanks in advance.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Larry Mills Sr wrote: In OnNM_ClickTreeCtrl()
Its better to handle this in the selection changed event(TVN_SELCHANGED) other wise, if some one operate the tree control through keyboard, your application wont work.
Larry Mills Sr wrote: How do I only receive the click on the Reports themselves, not all the headings?
You can use the item data corresponding to each item, to identify whether the items is report or not. I mean, while inserting the report, you should set the item data(SetItemData) as some value, say X. When the selection change occurs, retrive the item data correspoding to that item, check whether the item data is X.
|
|
|
|
|
Could you please provide a workable example for TVN_SELCHANGED?
Here's How I set up the TreeCtrl:
strItems[0]= _T("Reports");
strItems[1]= _T("Construction");
strItems[2]= _T("Materials");
HTREEITEM hReportsItemRoot= m_cTree.InsertItem(strItems[0]);
HTREEITEM hConstItemRoot= m_cTree.InsertItem(strItems[1], hReportsItemRoot);
HTREEITEM hMaterialsItemRoot= m_cTree.InsertItem(strItems[2],hConstItemRoot);
In your explaination, could you please use my example data, Please.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Hi
I have an application written in VB that checks whether a new wav file has been added to a folder by using the following:
MyFile = Dir("C:\MyDirectory\*.wav")
If MyFile contains a string, the file is then moved to another directory to manipulate.
I wish to do the same in VC (6.0) - have you any suggestions?
Thanks for any help that you can give!
Mike
|
|
|
|
|
mike.r.winter@btinternet.com wrote: I wish to do the same in VC (6.0) - have you any suggestions?
Take a look at the FindFirstFile/FindNextFile[^] functions; they may be what you need.
|
|
|
|
|
Excellent - thanks very much - using the example got exactly what I wanted!
Thanks very much
Mike
|
|
|
|
|
After importing the idl file "msado15.idl" in the idl file of my DLL and the build i have many errors like this:
1>c:\sac\see_ac_services\debug\msado15.tli(2103) : error C2065: '_result' : undeclared identifier
1>c:\sac\see_ac_services\debug\msado15.tli(2105) : error C2065: '_result' : undeclared identifier
1>c:\sac\see_ac_services\debug\msadox.tlh(495) : error C2327: 'ADOX::_Index::Properties' : is not a type name, static, or enumerator
1>c:\sac\see_ac_services\debug\msadox.tlh(1059) : error C2327: 'ADOX::_Table::Properties' : is not a type name, static, or enumerator
1>c:\sac\see_ac_services\debug\msadox.tlh(1172) : error C2327: 'ADOX::_Column::Properties' : is not a type name, static, or enumerator
1>c:\sac\see_ac_services\debug\msadox.tlh(1265) : error C2327: 'ADOX::_Group::Properties' : is not a type name, static, or enumerator
1>c:\sac\see_ac_services\debug\msadox.tlh(1364) : error C2327: 'ADOX::_User::Properties' : is not a type name, static, or enumerator
1>c:\sac\see_ac_services\debug\msadox.tli(245) : error C2065: '_result' : undeclared identifier
1>c:\sac\see_ac_services\debug\msadox.tli(246) : error C2065: '_result' : undeclared identifier
1>c:\sac\see_ac_services\debug\msadox.tli(248) : error C2065: '_result' : undeclared identifier
knowing that I have imported the "msado15.dll" in my DLL (in the stdAfx.h file)
So someone know where is the problem and help me please ?
|
|
|
|
|
I added
#import <c:\Program Files\Common Files\system\ado\msado15.dll> rename("EOF", "adoEOF") and it compiled fine. What do you have before this statement?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
what i did is like below :
i imported the msado15.idl (import "msado15.idl) in the begining of my IDL file (before the def of my Library) to use the ADO connection type as parameter of method.
But it compile with errors like i posted.
|
|
|
|
|
Are there any other ado include files in stdafx? if try moving it to after import line.
-Suhredayan
|
|
|
|
|
- No, there is no include ADO in stdAfx.h
- The two line :
#import "C:\Program Files\Fichiers communs\System\ado\msado15.dll" rename_namespace("Internal") rename( "EOF", "EndOfFile" )
#import "C:\Program Files\Fichiers communs\System\ado\msadox.dll"
are imported in most files of my project.
- My problem is related with the IDL file of my DLL and it begin when i try to put ADO connection as parameter of method in the IDL -> So i need to add the line import "msado15.idl"; and here i get about 2000 errors like this :
1>d:\travail\see_user_access\version 2.20\source\sac\see_ac_services\debug\msado15.tlh(1024) : error C2327: 'Internal::_ADO::Properties' : is not a type name, static, or enumerator
1>d:\travail\see_user_access\version 2.20\source\sac\see_ac_services\debug\msado15.tlh(3124) : error C2327: 'Internal::_Record::Fields' : is not a type name, static, or enumerator
1>d:\travail\see_user_access\version 2.20\source\sac\see_ac_services\debug\msado15.tli(109) : error C2065: '_result' : undeclared identifier
1>d:\travail\see_user_access\version 2.20\source\sac\see_ac_services\debug\msado15.tli(1104) : error C2065: '_result' : undeclared identifier
1>d:\travail\see_user_access\version 2.20\source\sac\see_ac_services\debug\msadox.tlh(1265) : error C2327: 'ADOX::_Group::Properties' : is not a type name, static, or enumerator
1>d:\travail\see_user_access\version 2.20\source\sac\see_ac_services\debug\msadox.tlh(1364) : error C2327: 'ADOX::_User::Properties' : is not a type name, static, or enumerator
1>d:\travail\see_user_access\version 2.20\source\sac\see_ac_services\debug\msadox.tli(857) : error C2065: '_result' : undeclared identifier
C2065: '_result' : undeclared identifier
1>d:\travail\see_user_access\version 2.20\source\sac\see_ac_services\debug\msadox.tli(927) : error C2065: '_result' : undeclared identifier
So i hope i explained more my situation and you can find where is the problem?
|
|
|
|
|
Hi all!
I have a weird problem. I have an application written in c++ and compiled with visual studio.net and connecting to an Oracle with MS ODBC driver. Now the app is built under vs 9 and the ODBC driver is changed to the Oracle's one. (ODBC: Oracle in Orahome92). The connection string had to be changed to the Oracle's one syntax. Unfortunately the SQLDriverConnect crashes with access violation. In the Call stack the last source before asm is the delayhlp.cpp but nothing relevant info can be found. The interresting part is that I build a little sample application using the same Visual studio (9), same ODBC (oracle), same connection string ("Driver={Oracle ODBC Driver};DSN=db;Uid=admin;Pwd=admin;";) and there it works. No error with the function. Can anybody advice? Of course, if I missed some details, let me know.
-mfg-
adam
|
|
|
|
|
See if this[^] gives any lead.
|
|
|
|
|
Hi,
unfortunately I knew it and this is why I changed the MS ODBC driver to the ORACLE ODBC driver. The problem is more complex, since this is working in one project and does not in another.
-mfg-
adam
|
|
|
|
|
Hello,
Before I ask my question I think a little background is required.
First off, I'm not a computer programmer by trade; it's something I do for fun so please forgive me if I get a few terms incorrect.
A while ago I set out to learn how to use OpenGL. Using Visual C++ Express and Win32 API, I managed to create a little program where an image from file was loaded, and the user could walk around the image and when the user clicked the mouse button the image exploded into a million little pieces and fell down like snow. I tuned the parameters so that it looked just right.
Being pleased with my creation, I thought I'd show it to a few friends. On transferring the executable to a friends machine (which had a superior graphics card and Processor) I was stunned to see that the application was very slow.
Could somebody tell me why this may be the case? and how I can correct this?
Thanks in advance,
Anil
|
|
|
|
|
Maybe your friend has some other processes running in the background that use most of his CPU power. Then there's memory size, if he doesn't have too much free memory windows might start swapping while your program runns and that can and will slow things down (check if there's a lot of HDD activity while your program runs). Or it is a driver issue, for some reason OpenGL misses to detect/work with his 3D hardware so it reaches back to software emulation mode, this is not likely but who knows, do other OpenGL programs, games run fine and fast on his comp? Could also be that althorough his computer has a "superior graphic card" as you wrote, it does not have support for some feature you used in hardware so OpenGL uses software emulation which is much slower. Or it is a hardware issue, does he play 3D games, do those run fine on his comp? Can't think of anything else right now, mabye others will give you some more ideas...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Hi Thanks for your reply,
I shall try to answer your question. I hope they will prove to be usefull
Code-o-mat wrote: Maybe your friend has some other processes running in the background that use most of his CPU power
I tried the program after a reboot. Granted there may have been some applications running in the background, but I would imagine it would be minimul
Code-o-mat wrote: Then there's memory size, if he doesn't have too much free memory windows might start swapping while your program runns and that can and will slow things down (check if there's a lot of HDD activity while your program runs)
I do not know how much memory (RAM) his machine has, but I'm pretty sure it has more than my laptop.
Code-o-mat wrote: Or it is a driver issue, for some reason OpenGL misses to detect/work with his 3D hardware so it reaches back to software emulation mode, this is not likely but who knows, do other OpenGL programs, games run fine and fast on his comp?
I've not tired other OpenGL programs I've written. Games run well on his machine.
Code-o-mat wrote: Could also be that althorough his computer has a "superior graphic card" as you wrote, it does not have support for some feature you used in hardware so OpenGL uses software emulation which is much slower
I believe he has a Nvidia card (8800GT?). I have an "integrated card" apparently. I didn't use any extended features of openGL. Infact i stuck with the basic Microsoft implementation, which i believe is version 1.1.
Code-o-mat wrote: Or it is a hardware issue, does he play 3D games, do those run fine on his comp?
3D games work really well on his machine. I've seen him play Counter Strike (Is that an OpenGl Game?), Command and Conquer 3, and Lord of the Rings online. To date I've not seen the frame rate drop, and he has the luxury of always selecting the best graphics options.
Something else I have just thought of is that my processor is a single core, but his is has a quad core. Could that be an issue? also I compiled my code on vista, but he uses XP. Perhaps theres some compiler options in Visual C++ that I need to look at. Any help would be appreciated.
|
|
|
|
|
Hi,
I have opened a comms port and I am reading data being sent to me. The program runs OK for a day or two (or three!) then ReadFile() returns FALSE with GetLastError() returning 5 (Access Denied). If I exit the application and re-start it, it works again.
The data rate is trivial so it doesnt appear to be due to an overflow.
The comms port is on a USB/serial adapter and the program is compiled using MSDEV 2008. I am not using overlapped access.
Anyone have any ideas what could be causing this or what I could try?
Thanks
Tony
|
|
|
|
|
softwaremonkey wrote: Anyone have any ideas what...I could try?
Have you tried this?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Just a stab in the dark, but maybe you should open the file (comm port) with SHARE_DENY_xxxx flags, to make sure another program does not come along ang grab the comm port out from under you.
When this happens, can you rerun your program straight away? Could you "just" detect this failure, close your file handle, wait a second or three, then reopen the comm port? Whether that it bad will depend heaviliy on how much the comm port is in action.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi,
Windwos Font baseline is not aligned. Different font has different baseline.
I think I am using "ANSI_CHARSET". (I used "GetTextMetrics" to find out that "tmCharSet = 0")
If I select "SimSun" Font, the char will shift a little bit below the baseline. It is weird.
I tried to use "WORD" to repeat this. I found out:
If I type some chars using other font and then change to "SimSun" Font. All preceding chars were shifted a little down after a char using "SimSun" Font was input.
How can I find out how much I need to shift and what kind of font I need to shift?
Thank you very much,
modified on Tuesday, October 27, 2009 1:38 PM
|
|
|
|
|
I answered this question a couple of days ago; I don't think anything has changed much in the intervening time.
|
|
|
|
|
Hi
I did not get solution from you. The reason I post again I want to see others know the solution of it or not. It looks like not many are very familiar with Windows Font. I might need to deal with it myself. It will take a lot of time.
Thanks,
|
|
|
|