|
For the mime settings I believe you have to read them from the registry.
And the simplest way to obtain a path to the windows dir is GetWindowsDirectory() and GetSystemDirectory() or just use ExpandEnvironmentStrings()
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
Andreas Saurwein wrote:
GetSystemDirectory()
Thanks, thats what I needed
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
"You can't seriously believe that you could get away with suing someone over quoting text from a message posted in a public forum, can you?" - John Simmons
|
|
|
|
|
If you delete a record from a database, do the remaining records arrange themselves so that if #5 was deleted, #6 now becomes the new #5 etc?
Or does some other type of reordering hapen? If so what control do we have over this ordering?
|
|
|
|
|
Depends of the primary key of the table....
I believe that that will happen.
Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Thanks. There is no primary key though....I am doing PutAbsolutePosition(index) and deleting them.
If there are none left, and I try to delete one, I am sure it will crash. so how would I test my delete condition? Check recordcount before each delete?
Important question: ReQuery(-1)
Do I have to requery? I feel that I should so that the deleted record vanishes (thats what I read anyways). Whats your opinion?
thanks,
ns
|
|
|
|
|
It depends. If you are using CRecordset and ODBC then they are not arranged. You sould use Move(0) to refresh current row. Also you can test if the row has beem deleted with the IsDeleted method.
Best regards,
Alexandru Savescu
|
|
|
|
|
When I copy a folder with my source and binary files to a different folder, it is necessary to re-build the whole project, even though it was
built successfully at a previous location. Why is that? How can I avoid it when moving projects do a different location on a hard drive?
Thanks,
Michael
|
|
|
|
|
Because Microsoft probably does something like taking the checksum of the path and file, so that if there any changes to the file or location... most likely it will need to be recompiled. Since you are moving all of your files, all files have changed. Cheers!
<><><><><><><><><><><><><><>
Matthew R. Miller
mattrmiller@computersmarts.net
www.computersmarts.net
|
|
|
|
|
No, MSDEV will not recompile, as it simply does a touch (Unix word for last modified date comparison).
And I swallow a small raisin.
|
|
|
|
|
If any of your projects create COM objects, the build process automatically registers them. The registration process places entries in the registry that associate the class and interface ID's with your object, and the location of that object's code on disk. Therefore, when you move the object's code to a different place, Windows can no longer find it. Rebuilding the project re-registers the objects and fixes the problem.
Gary R. Wheeler
|
|
|
|
|
Hi,
I have a problem which can be reduced to the following question: how can I place programmatically the cursor to a given position in my view?
In more detail: I make some manipultions of the UI and at this time the focus in the main window gets lost. I tried
1. Setting focus to the MainFrame
pFrame->SetFocus();
2. Setting focus to the view
pView->SetFocus();
3. Showing the caret at its previous position
pView->SetFocus();
pView->SetCaretPos(pointCaret);
pView->ShowCaret();
without success, the cursor remains lost.
Its about a CHtmlEditView.
Any help would be highly appreciated.
Thanks
R.
|
|
|
|
|
You'll need to use the SetCursorPos() function rather than SetCaretPos().
John
|
|
|
|
|
In my view class I have a CFileDialog:
int nRetMainDB = fileDlg.DoModal();
if (nRetMainDB == IDCANCEL)return;
Now if the user presses cancel I want the app to exit. With the return that I have above,
it doesnt terminate the program , just crashes! Why? and how do I exit?
Thanks,
ns
|
|
|
|
|
Maybe PostQuitMessage() will help you...
Gero
|
|
|
|
|
I usually do the following:
if (nRetMainDB == IDCANCEL) { exit(0); }
|
|
|
|
|
I appreciate both the responses. I implemented the PostQuitMessage(0) since I'd gotten it first and it seems to be doing fine! Thanks for the exit(0) too.
ns
|
|
|
|
|
I have a menu in a dialog but the accelerator keys don't work eg Alt-F does not drop down the file menu.
How do I make it work?
Thanks
Dave
Dave Huff
Igor would you give me a hand with the bags?
Certainly - you take the blonde and I'll take the one in the turban!
|
|
|
|
|
Works for me - I've created dialog-based app, added menus to main dialog and about box and everything works as expected.
Are you playing with PreTranslateMessage?
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
This is not a dialog based app but a dialog called by an SDI app. I am not touching PreTranslateMessage.
Dave Huff
Igor would you give me a hand with the bags?
Certainly - you take the blonde and I'll take the one in the turban!
|
|
|
|
|
I made a SDI application that opens a dialog (modal) with a menu.
work fine.
Are you using modeless dialogs?? (i did not try it)
Casa.Sapo.pt
|
|
|
|
|
for dialogs, you can load the accelerators yourself, in PreTranslateMessage:
BOOL ColorEditWnd::PreTranslateMessage(MSG* pMsg)
{
if (m_bUseKBAccel)
{
if ((pMsg->message == WM_KEYDOWN) && (pMsg->hwnd == m_hWnd))
{
HACCEL hAccel = LoadAccelerators( AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_EDIT_ACCELS) );
if (::TranslateAccelerator( m_hWnd, hAccel, pMsg ) )
{
return TRUE;
}
else
{
return CWnd::PreTranslateMessage(pMsg);
}
}
}
return CWnd::PreTranslateMessage(pMsg);
}
-c
Gourmet, n:
Anyone whom, when you fail to finish something strange or
revolting, remarks that it's an acquired taste and that you're
leaving the best part.
|
|
|
|
|
Please dont suggest loading the accels on every keystroke. Do it in OnInitDialog at least.
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
that step was left to the reader.
thanks for contributing.
-c
"I am angry that so many of the sons of the powerful and well-placed... managed to wangle slots in Reserve and National Guard units...Of the many tragedies of Vietnam, this raw class discrimination strikes me as the most damaging to the ideal that all Americans are created equal and owe equal allegiance to their country."
--Colin Powell
|
|
|
|
|
In a dialog based application all keyboard events go to the control that have the focus. If you do not have any control on the form then I am pretty sure it will work. To use keystrokes you must, as Chris said, override the PreTranslateMessage method.
Best regards,
Alexandru Savescu
|
|
|
|
|
When I click on an item in a listctrl, it doesnt make it highlighted and blue. How do I get this to happen?
|
|
|
|