|
thanks
works great.
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|
|
Hello,
I want to Know the Events that called, when i press the Close button from the Print Preview Button......
As if user presses both Print and Close button from the Print Preview window toolbar. the event that is called named
OnEndPrintPreview
and
OnEndPrinting
Actuallyu i want to differentiate both Events....
Thanks in Advance...
|
|
|
|
|
Hello All,
I am using the ATL OLE DB Consumer templates with the CDynamicAccessor on CCommand to access several databases. Access to table and commands are successful. With SQL Server there is no problem at all. However, with MS Access the column names are not order in the same way as the database. What am I doing wrong?
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
How do you know that the order is not in the same way as in the db? Perhaps you could try using RowsetViewer to get the columns schema.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Hello Steen,
Thanks for the response.
> How do you know that the order is not in the same way as in the
> db?
1. Even though I do not have Access installed, because of the testing I wish to achieve, I opened the data with Access on a different PC and could tell the column order.
2. Trying to read the values to fill the columns after the columns names does not work well-since there is no matching of types as obtained from the column information.
Any further help will be highly appreciated. Someone says it has to do with the bookmarks, any hint?
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
Hi Paul,
I tested the CDynamicAccessor on a Jet database and it delivers the columns in the same order as Access shows them. However, the DBSCHEMA_COLUMNS rowset shown in RowsetViewer shows another order - so I'm confused. Unfortunately this doesn't really help you much. Can you make your program independent of the column order?
The CDynamicAccessor returns a column 0 which contains the bookmarks. This column is returned if you set DBPROP_BOOKMARKS to true. This means that your first data column has ordinal 1.
>2. Trying to read the values to fill the columns after the columns names
>does not work well-since there is no matching of types as obtained from the
>column information.
I'm not sure what you mean?
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Hello Steen,
Thanks so much for this great support. I am really hot now and this support is highly appreciated.
I do not know if this is a bug in the CDynamicAccessor or the Jet. Please can you make your test source available for me to learn from it? I may be doing something wrong-just confused that it works well with SQL Server.
I was initially working with the CManualAccessor and for reasons I cannot tell the binding to the Access columns fails. I gave up and started with the slower CDynamicAccessor and this is the result.
Please help with any piece of information-I have to complete this work by Monday to start another project.
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
Just for the record, I have mailed you the project files and the database directly (more than 7 megs, not suitable for this forum
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
I haven't been working with OLEDB Consumer Templates for some time, but I remember that problem you're experiencing may be related to the bookmark column.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hello Tomasz,
Thanks for the support. It is only a simple stage of opening and reading the data to list view. Not using bookmarks, any further hint?
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
With Jet provider, you're getting bookmarks at position 0, as Steen pointed out. You don't have to ask for them, provider just gives you bookmark for free
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Are you sure that the Jet provider gives you bookmarks no matter what? In the help it says you can set DBPROP_BOOKMARKS to VARIANT_FALSE, and I translated this into you not getting the bookmarks. I tried opening a table (i.e. through IOpenRowset, using CTable<cdynamicaccessor>) while setting DBPROP_BOOKMARKS to VARIANT_FALSE, but that gave med a DB_E_ERRORSOCCURRED with the status field set to DBPROPSTATUS_CONFLICTING - maybe I'll have to turn off DBPROP_CANFETCHBACKWARDS and DBPROP_CANSCROLLBACKWARDS? I don't want to put too much time into it if you're certain that Jet will always return the bookmark column.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
No, I'm not sure. As I've mentioned, some time has passed since I was working with OLEDB for the last time. However, I remember problems with column ordinals. Our product had to work with SQLServer and Jet, we had to provide two slightly database layer .dlls, one of the differences was column ordinal handling.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hello All,
I have MFC-based ActiveX control. I implemented other Automation objects and interfaces-CCmdTarget stuff (some creatable).
Now, when trying to use the control in MFC applications, the ClassWizard does not generate wrapper for the automation objects (only the ActiveX control).
This is no problem in VB test application. Is there anything extra I need to do with the *.odl file for the ClassWizard to use it effectively. VC++ compiler-based COM wrappers could be generated as usual but this is not clean and nice to has clients to do. Any help?
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
You should have a .tlb file which in ClassWizard you can select New Class from Type Library and it will generate the cpp/h for the type-library. Also, if you don't want to have the header/cpp files you can always do an #import.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
Or if you want to take life into your own hands, use the APIs directly: CLSIDFromProgID, CoCreateInstance, IDispatch::GetIDsOfNames, IDispatch::Invoke, etc.
|
|
|
|
|
Thanks, now I get it. The ClassWizard is using the VB generated *.oca file. I used the From the Typelib and selected the *.tlb and it works.
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
Hi
How can I get mother-board serial number, programmaticaly?
Ernst
Thanx
|
|
|
|
|
My second attempt at this question ( Internet at work is screwed, especially for CP ).
I have a combo box in Win32, and I want the edit control to work. It appears I need to catch the <enter> key being pressed and impliment the behaviour I want. Spy++ can find WM_KEYDOWN?CHAR?KEYUP being called, but it is not called to the combobox ( subclassed it, nothing ) or the parent dialog ( nothing again ). Can anyone tell me what the (%#(%(# is going on and how I am supposed to do this?
Thanks.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Gotta ask the obvious first - Have you set the combo style correctly (should be drop-down, not drop-list)?
--Mike--
http://home.inreach.com/mdunn/
"Listen you footwarriors, can you hold down a bit with the firing? I've just got three impromptu weddings breaking out behind me!" -- Arthur Dent
your with and
|
|
|
|
|
Fair cop - yes, and yes, I can edit, but <enter> beeps and that's all. No messages anywhere, as above.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
hmm, I'm not quite clear on whether the edit box portion works at all. When you type, do the characters appear at all? Or do you just get a beep? Or both?
To answer your original question, you don't have to do anything special, since the combo box manages the edit box portion itself.
--Mike--
http://home.inreach.com/mdunn/
"Listen you footwarriors, can you hold down a bit with the firing? I've just got three impromptu weddings breaking out behind me!" -- Arthur Dent
your with and
|
|
|
|
|
I've created a box with CreateWindow and the style "COMBOBOX", and the DROPDOWN style. I can add and remove strings programatically, and select them. I can type in the edit box and strings appear. When I hit enter I get the bell, but the text I have typed remains and does not appear in the list box.
If the combo is supposed to handle it, it sounds like something has gone horribly wrong.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
The edit control is a child of combo - are you subclassing a combo itself or edit control hosted in the combo?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I've created a Combobox with a call to CreateWindow, with the COMBOBOX class. The resulatant HWND passed back is what I have subclassed using SetWindowLong. I don't know how to get to the edit HWND from where I am, or subclass it, and I think that is my problem.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|