|
I am writing a database program using ADO and Visual C++.
Let me explain my problem.
m_pConn->Open(L"Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=Inventory.mdb;",
L"", L"", adOpenUnspecified );
...
pRs->Open( _variant_t( bstrQuery ),
vNull,
adOpenDynamic,
adLockOptimistic,
adCmdUnknown );
if( m_pRs->Supports( adDelete ) && m_nNoRows > 1 )
{
m_pRs->Delete( adAffectCurrent );
m_pRs->MoveNext();
if( m_pRs->GetADOEOF() )
m_pRs->MovePrevious();
}
CString strFilter = "vField LIKE 'smth%';
m_pRs->Filter = _variant_t( (_bstr_t)strFilter );
//
After I set the filter and I delete a record, if I try to
move to the previous record (even though the record is not
the first) I get an error which suggests that the row where
I am trying to move is either marked for deletion or has
been deleted. Why? The database supports MovePrevious and
I don't use batch mode. This problem occurs only if I
set a filter. The filter works fine too. It selects only
the records that I want it to select.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Hi:
I'm working on a Custom editbox acivex control,my activex have a property called "R2L Readling"(a Check box).when the user set this property the style of editbox will change to "Right to Left Reading order" at Run-Time,i have used the following code to do this:
////////////////////////////////////////////////////////////
ModifyStyleEx(0,WS_EX_RTLREADING|WS_EX_RIGHT|WS_EX_LEFTSCROLLBAR);
InvalidateControl();
////////////////////////////////////////////////////////////
all things work properly but "WS_EX_LEFTSCROLLBAR" doesn't work !!!
in the other hand the left-scrollbar doesn't appear.please help me.
excuse me for bad comments.english isn't my native language.
Best Regards.
|
|
|
|
|
Not all styles can be changed at run-time. You may need to delete and recreate the control. I really have no idea if WS_EX_LEFTSCROLLBAR is one of those or not. Never used it.
Joel Lucsy
|
|
|
|
|
how to make program appear, each time I boot computer, in system tray (like ICQ)?
|
|
|
|
|
One solution is Shell_NotifyIcon().
Kuphryn
|
|
|
|
|
Thanks for answer. Can you explain me in details what is Shell_NotifyIcon() and how use it.
|
|
|
|
|
Creating icon in system tray I can do now. My current problem is to put that icon to system tray, when Windows 2000(for example) starts.
|
|
|
|
|
See the MSDN article Q179365.
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shell_notifyicon.asp
|
|
|
|
|
how to prevent my program appear in task bar?
|
|
|
|
|
Hide the main window. In MFC this will do the trick:
AfxGetMainWnd()->ShowWindow(SW_HIDE)
Of course, you won't be able to interact with the app while it's hidden unless you provide a means of making it visible or allowing it do display a context menu. A common convention here is do add an icon to the system tray while the app is hidden.
Anna
Homepage | My life in tears
"Be yourself - not what others think you should be"
- Marcia Graesch
"Anna's just a sexy-looking lesbian tart"
- A friend, trying to wind me up. It didn't work.
Trouble with resource IDs? Try the Resource ID Organiser Visual C++ Add-In
|
|
|
|
|
I believe you can take off the WS_EX_APPWINDOW extended style from the window.
|
|
|
|
|
I am not sure if I am doing something wrong, but it doesnt seem to like me using a vector in my managed c++ app.
??
Appreciate your help,
ns
|
|
|
|
|
|
That is exactly what I needed to read...........many many thanks!
Appreciate your help,
ns
|
|
|
|
|
I'm trying to implement a floating window, like a tooltip, to follow the mouse to show display info on our data.
I'm now using the tooltip, and it works ok, not great, but ok; the view gets invalidated, and forces a redraw. ( I was using a simple CWnd before to simulate this, and it was ok also)
Are there other alternatives for that kind of floating window ?
Thanks
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
If you create a special window class with the style CS_SAVEBITS (among others), you shouldn't have a problem with redraw. See AfxRegisterClass or ::RegisterClass in the MSDN.
Chris Richardson
You can stash and you can seize
In dreams begin, responsibilities U2 - Acrobat[^]
Stop being PC and accounting for everyone and his momma's timeframe. Just enjoy your - Rohit Sinha in the content-challenged thread
|
|
|
|
|
Yeah !
I learn something really usefull today!
Thanks so much!
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Does anyone know the limits to the length of a (Win2K/NT/XP) username and domain name? Are these #defined anywhere? Thanks,
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
I want to display a .jpg file in a Dialog. How to do that??? Is there any Control available for that.
|
|
|
|
|
there are probably ten different articles on this site that can help you do that. try looking in the "Bitmap and Palettes" section.
-c
|
|
|
|
|
If you are using VC++ 7, then you can use CImage class. If you don't but have the latest Platform SDK, then can use the Image class of the new GDI+ library. If neither, then download the CXImage class from code project.
All this classes with allow you to access to an HBITMAP that you can use it anywhere.
|
|
|
|
|
With an MFC Menu, is it possible to not just disable but *hide* menu items without having to delete them from the menu?
|
|
|
|
|
Yes, it's possible, but not recommended, it confuses the user that sometimes a menu item is visible, and sometimes it's not.
look for :
BOOL CMenu::RemoveMenu( UINT nPosition, UINT nFlags );
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|