|
Try SQLGetConfigMode(...) or SQLGetInfo(...)
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
I have created a dlgbox where i put edit box and button. In one of the edit box, i have attached a COleDateTime variable to it. So, the variable is initialized with GetCurrentlyDate, and keep this value all the time whatever i do to change it, it recognizes only the today date and just this date. It's problem for me because i want to be able to change the date and to use this new date for others parts of my application. How could i do that?
thanks in advance
gerald
|
|
|
|
|
I'd recommend using the date time picker control rather
than an edit box.
"das leid schlaft in der maschine" -Einstürzende Neubauten
|
|
|
|
|
Ok.
But how can i initialize a date to the date time picker control ?
|
|
|
|
|
I've been doing a bit of text-to-speech stuff using the Microsoft Speech SDK V5.0. What I'd like to do now, is distribute my app with the text-to-speech capabilities. However when installed, the installation program will also have to install the text-to-speech engine. I don't want to distribute the whole 110M worth of Speech SDK, so looking at the redistribution details, I need to install sp5ttint.msm, and spcommon.msm.
I can't actually find these two files. I've look on my system, and in the SDK cab file, and can't find them. I may just be thick, or blind, but does anyone know either how to install the text-to-speech engine, or where I can find these files please?
Thanks
|
|
|
|
|
I'm trying to add a tooltip for a listview control using SDK style programming. I want to display the tooltip based on the data displayed in the rows..I can't seem to find any code samples in achieving this process..
|
|
|
|
|
I'm not sure if this is what you want, but this is what I've used for my listviews:
const int LVS_EX_LABELTIP = 0x00004000;
ListView_SetExtendedListViewStyle(m_libraryPlans,LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP);
Hope this helps!
Derek
|
|
|
|
|
Hi, I have been creating a band object for IE starting from a base created with the band wizard here: http://www.codeproject.com/atl/rbdeskband.asp
To the class created i have added a CWindowImpl derived class (CMainWindow) which replaces the default window object created by the wizard (HWND m_hWnd). This class is used as a container to handle the command messages created by a toolbar. This toolbar is a member variable of CMainWindow. There are a few things i wish to sort out but am unsure how:
Firstly if i close IE with my band still visible, when i load IE up again the band is still there as it should be however the toolbar is not loaded (or at least not visible nor clickable). The toolbar creation code is handled in the OnCreate method of the CMainWindow (which does get executed everytime, i checked). Has anyone else come across this? perhaps the code should be elsewhere.
Secondly I am wondering how to get a handle to the parent rebar that my band object is in so that I can add chevrons to my band (or is there a different way of adding chevrons?).
Thankyou in advance.
Mat.
|
|
|
|
|
You could be having drawing problems because of the threading model you are using. If you are using my old wizard, there was a bug in it that the threading model was not getting set and thus you could only have one instance of the band at any time. Setting the threading model to apartment will fix this. You would look for this in the *.RGS file of your project.
As for the cheverons, the code in the SetSite method implementation gets the parent window handle that will allow you to do cheverons or what have you. This code is produced by the wizard by default and is near the middle of the function just before the call to RegisterAndCreateWindow. The parameter passed into the R&CW method is the handle to the rebar window.
Cheers,
-Erik
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My thoughts are my own and reflect on no other.
|
|
|
|
|
How can I check for timer's existance?
I can create a flag, set it with SetTimer and reset with KillTimer, but is the easier way exist? I'm using a pure API.
With the best regards, Vitaly.
|
|
|
|
|
I don't think there's any documented way of doing this. The funny thing is that if you create a second timer with given ID, the function returns TRUE, and GetLastError returns 0.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hello guru's
I've a interessting problem, and probably the most will say: please don't do that because of the extra headache
OK..
Because the fact I've a MDI application on which each doc/view can expect a lot of input. This input is no user input, but trace events read from TCP-socket. The communication handling for TCP/IP is already done it it's own thread, only passing data to the document when there's something to write. Also: I've a fast way of writing to the view, but some times the main application is very very slow in responding (moving/menu/toolbar etc) when more than 3 documents are handled with a lot of data. The problem is that all the doc/view handling is done under the hood of the applications main thread. This is the reason for wanting each doc/view in it's own thread.
Now I've read sometime somewhere that someone had put each doc/view in its own thread. The question is: how to do this for a MDI application
This is maybe also a very good article to store in CodeProject library.
Thanks in advance..
EiSl
|
|
|
|
|
I've a MDI application on which each doc/view can expect a lot of input.
What kind of input it is?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Tomasz,
Sorry I'wasn't complete
I've already updated the initial story.
The input is not from user, but Trace Events from a TCP-socket. A separate thread (launched by the doc) forms a complete protocol handler and connects to a device. When a trace-event is received, a string passed to the doc which updates the view.
It's also possible for the user to select a line in the view, and than press a button to add some comments. But this is rarely used, so: no user input to view.
Hopes this completes the story,
EiSl
|
|
|
|
|
I've never done MDI multi-threaded app, so can't really comment on this. There's a topic in Platform SDK titled "Using a Multithreaded Multiple Document Interface Application" (under Base Services/DLLs, Processes and Threads/Using Processes and threads). How this applies to MFC app is another story. Have fun!
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I've also found MTMDI sample in MSDN. It's a MFC program that uses multiple user-interface threads. However, it's 'old-style' MFC, without the doc/view.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I would probably create a thread that handles the TCP/IP connection itself, and when it has data for displaying in a view, would send a message to the approriate view.
Each view would have to register itself with the TCP/IP thread so that the thread would know who to send the data to, and the thread would have to maintain a list of views' pointers that are registered with it.
I think this might give you back your interface response because the views are now only displaying data that the TCP/IP thread tells them they have.
|
|
|
|
|
Hello John,
Thanks for reply!!
This is already how it's working now.
When a new document is created (OnNewDocument), a communication thread (WinThread) is started, which is using CAsyncSockets for communications. When data has to be printed, it is passed to the document.
But...
When I've have more than 3 documents active, and they generating quite a lot data, the main app starts become less responsive since all the documents/view updates are done under the hood of the main application thread. That was the reason for asking a thread handling doc/view archtecture.
EiSl
|
|
|
|
|
What kind of view are we talking about? CEditView? CListView? CFormView?
|
|
|
|
|
Hello John,
Does this really matters?!?
Ok in case of a CFormView yes it matters.
In my case we're talking about a read-only CEditView, but maybe this is changed to a CListView.
Sincerly,
EiSl
|
|
|
|
|
You'd probably be better off with a CFormview with a CListBox in it.
I'd be willing to bet that (with the CEditView) you are simply adding the newest message to the existing contents of the edit control. At first, performance is pretty good, but the longer the program runs, the worse less responsive the program gets.
If you change to a list box, you have better control over how much data is contained in the control (you could limit it to say 1000 lines). With an edit control, you have to call SetWindowText with a string that is larger each time. This takes a lot of processing time (a lot more time than adding a single string to a list box).
I would advise against using a list control unless you need multiple columns for some reason. A list box would be a better choice.
|
|
|
|
|
Thanks for your answer!
Most the time you read answer like: "better do this way" without a clear explaination why to do so.
I've never thougth about the combination of CFormView with ListBox, because I was only looking to derivation of the View. Since it only accepts xxxView I was thinking about the ClistView or CEditView and have chosen for the editview.
When everything is working fine I will take a look for changing that part, since it's quite easy to change.
Happy programming!
Eize
|
|
|
|
|
I had the same problem in a previous project that I inherited. We were storing messages coming across a network in an edit control. These messages could be anywhere from 2-64k in length, and that we got approximately 150 messages per minute, and we were simply adding them to the edit control with no thought of the size of the string *in* the edit control. Performance slowed to such a point that the CPU utilization was pegged at 100% and we got so far behind in the message queue that the only recourse was to do a hardware reset. The really embarassing part was that our app was the only one running. LOL
Anyway, we needed to have the edit control, so we changed the code buy only storing only the previous message in the edit control. Performance improved dramatically, and we regained keyboard control of the system.
Good luck on your project.
|
|
|
|
|
I don't think that a thread per doc/view is a good approach: there are a lot of complications, and it doesn't change the fact that only one thread can update the GUI at a time (the GDI calls are serialized).
A much better approach, which I have used successfully in a couple of commercial applications, is to have one worker thread per doc, with the original GUI thread handling all the views. The worker threads can update each documents contents to reflect the input recieved via TCP/IP independently.
You can run into some problems invoking window related functions from a worker thread because of the need to link C++ objects like CWnds with the associated Windows HWND (look up handle maps in the VC++ docs if you want the messy details). As long as the worker threads stick to updating the data in the CDocument derived class, you won't have problems. You may have to use critical sections or some other form of synchronization to stop the GUI thread from reading partially updated document contents though.
I get around the handle map problem by defining a user message UM_UPDATE_VIEWS. The worker threads POST (not send) this message to the main window after changing the document contents. The main GUI thread processes this message, by calling CDocument::UpdateAllViews() for the CDocument derived object passed as a pointer in the LPARAM. This way UpdateAllViews() gets invoked by the main GUI thread, so there is no problem with handle maps.
Stephen C. Steel
Kerr Vayne Systems Ltd.
|
|
|
|
|
I try to create an application which composed by a dialog box. The first aim of this application is to connect an access database, so i put a button to do that. After the connection done, i want to compare a Date which is kept in an edit box in my dlg box to dates in my database. So, I declare m_dlgDate as a COleDateTime variable. When I run the application, even if the dlg date and one of the data date are the same, my application return an AfxMessageBoxwith the message "Not Good Dates".
So, I would like to know if my declarations that's wrong or not??
gerald
|
|
|
|