|
Hallo
What to look for or how to manage, if i'd like to open my MFC Programm by double Clicking the corresponding file??
Th@nks to @all
|
|
|
|
|
Hi,
If it is SDI/MDI Application, it is quite easy...
You need to have IDR_MAINFRAME which values are like this SDI\n\nSDI\nSDI Files (*.dra)\n.dra\nSDI.Document\nSDI Document....
After creating the document template call, EnableShellOpen();
RegisterShellFileTypes(TRUE); function. This will do..
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
Click .dsw file
hjghjghjghjhgjgh
|
|
|
|
|
I have this new little app which is an SDI with a splitter window.
Anyway, when user right-click a treectrl, a floating menu appears and if user clicks one of it, a modal dialog box appears. Now the problem is that the dialog box seems to freeze, ie. no button/editBox etc respond to mouse. If user clicks on any point outside the window (eg. another application), then comes back to this window, this dialog box becomes 'live' again.
I think it may be something to do with hotspot?? anyone knows how to solve this problem???
please...
|
|
|
|
|
I think, you are doing the following
--> Click the POP up menu,
--> IT fires the event, in the event handler you are creating the Dialog Window.
Before create the modal dialog, delete the pop up menu and create dialog
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
MailtoGops wrote:
Before create the modal dialog, delete the pop up menu...
With MFC, this is handled automatically. One simply needs to call TrackPopupMenu() .
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Yes the dlg window is created when clicking the pop up menu. I have no problem with cleaning up the pop menu as it is a local variable, see the code below:
{
..........
CMenu zooMenu;
zooMenu.LoadMenu( IDR_MENU1 );
CMenu* pPopup = zooMenu.GetSubMenu( 0 );
pPopup->TrackPopupMenu( TPM_LEFTALIGN|TPM_RIGHTBUTTON,
point.x,
point.y,
this );
}
It must be because something else. any other idea?
|
|
|
|
|
Hi,
I am working on VC++ base application.
Would u suggest me how to get the physical font path, when we know the font name only.
Thanks in advance,
Ramesh.
|
|
|
|
|
|
one of the buzz about com components is that they allow location independence; to include com comp "import" key word is used along with name and path so where is location independence?
|
|
|
|
|
That is only one way of importing a COM definition.
You can also use the progid or libid:
<br />
#import "libid:0B482F67-46DD-4b1a-BD7C-204444F452E0" named_guids<br />
#import "progid:SomeCOMLibrary.MyCOM.1" named_guids<br />
Using the import directive in this way will ensure path independence from your client program.
I Dream of Absolute Zero
|
|
|
|
|
//onaccept i do like this
CUserSocket *usersocket;
usersocket=new CUserSocket(this);
if(Accept(*usersocket))
{
m_usersocketlist.AddTail(usersocket);
}
//I delete all the usersockets
POSITION pos;
pos=m_usersocketlist.GetHeadPosition();
while(pos!=NULL)
{
CUserSocket* pa;
pa=(CUserSocket*)m_usersocketlist.GetNext(pos);//save pointer
delete pa;//accert here
}
m_usersocketlist.RemoveAll();
when i delete pa
it give an accert in dbgheap.c Expression:_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
how can i delete a socket and free the memeory
-- modified at 9:20 Monday 19th September, 2005
|
|
|
|
|
Hello,
I need to print files using MS Word automation and MFC. I use the PrintOut method available in the application object and it prints perfectly fine. But i'm not finding any method of printing files to a particular tray of the printer.
Code for the same is attached
******************************************************************************
Word::_ApplicationPtr m_pWord;
Word::_DocumentPtr m_pDoc;
/* ms-word print api */
m_pWord->ActiveDocument->PrintOut(covFalse, // Background.
covOptional, COleVariant((long)4), // Range.
covOptional, // OutputFileName.
covOptional, // From.
covOptional, // To.
covOptional, // Item.
COleVariant((long)1), // Copies.
COleVariant(PageRange ,VT_BSTR), // Pages.
covOptional, // PageType.
covOptional, // PrintToFile.
covOptional, // Collate.
covOptional, // ActivePrinterMacGX.
covOptional, // ManualDuplexPrint.
covOptional, // PrintZoomColumn New with Word 2002
covOptional, // PrintZoomRow ditto
covOptional, // PrintZoomPaperWidth ditto
covOptional
);
******************************************************************************
For tray selection am using the following methods, but the desired results are not being achieved. The mentioned method is placed before PrintOut function is called.
******************************************************************************
m_pWord->Options->DefaultTrayID = Word::wdPrinterLowerBin;
******************************************************************************
Thanks for any help provided
Vikram Attiganal
|
|
|
|
|
Hi All,
My application has strings hard-coded in code. To Provide multi-language support in my application, i need to make these strings as a part of resource in the project.
If anybody knows any tool that will move these hard-coded strings to the Resource and write the code at those places to load them from the resource whenever needed, please tell me where to get tool or if u have it, send me at abhijeet23@gmail.com
Thanks in Advance..
Abhijeet Jadhav
|
|
|
|
|
I don't know of a tool to extract the string ( and put them in a text file ) , and replace them with SIGNIFICANT ids; you'd better take a few hours doing it manually.
as for the second part, you need to create a resource DLL ( see here [^] ) and load the DLL depending on the current user language.
and in your code, use CString::LoadString( UINT id ); to load the string from the resources.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hi All,
My application has strings hard-coded in code. To Provide multi-language support in my application, i need to make these strings as a part of resource in the project.
If anybody knows any tool that will move these hard-coded strings to the Resource and load them from resource whenever needed, please tell me where to get tool or if u have it, send me at abhijeet23@gmail.com
Thanks in Advance..
Abhijeet Jadhav
|
|
|
|
|
Hi,
When you disable the titlebar (and thus the minimize-button) in a dialog, the application wont minimize anymore on a taskbar click.
I was wondering if you can recreate that behaviour, so that the application minimizes even without a titlebar.
I tried already using an own WndProc-Method to catch the messages of the taskbar to look for a WM_LBUTTONUP or DOWN to minimize and restore the application myself, but the GWL_WNDPROC of SetWindowLong seems to only work for windows of the own process, so that didnt work...
Has anybody got an idea or maybe done that himself already?
thanks alot!
|
|
|
|
|
I hope this is what you're looking for. I've used ShowWindow(SW_MINIMIZE) to minimize my application. (Alternatively, ShowWindow(SW_MAXIMIZE)) Or you might want to check out CWnd::SetWindowPlacement().
Hope this helps!
Danny
|
|
|
|
|
Hi Danny,
This is the way to minimize the window, but my problem remains... I need to know when to call ShowWindow(SW_MINIMIZE) and RESTORE, so when someone clicks on the button in the taskbar i need a way to catch that clicking.
Minimizing my application itself isn't the problem, but getting it on that taskbar click is
thanks for answering though!
|
|
|
|
|
Ah, I see. Sorry, I don't know about what you're looking for. Are you working with an SDI, MDI, or Dialog app? If a dialog, are you opposed to putting your own minimize button on the dialog. If SDI or MDI, can you put an entry in a menu or toolbar? Admittedly, this isn't as good of a solution as being able to do the common taskbar click, but as far as handling WM_LBUTTONDOWN messages, I think that only works within your own app, unless you don't release the mouse if it's clicked outside your app I suppose, (by overriding the WM_CAPTURECHANGE message?)
Or... why do you want the title bar gone? Just so the user can't move the window around? You can remove the user's ability to do this.
Danny
|
|
|
|
|
It's a Dialog and the reason for not having a normal titlebar with minimize-button (and thus the normal taskbar behaviour) is, that my boss wants a customized titlebar.
The Dialog has a button for minimizing and that works as planned, but it would be nice if the application would still behave like any other dialog does (so minimize when clicking on the button in the taskbar).
I can get a handle to the taskbar itself, but i dont know how to be able to hook on its messaging system to be able to react to those WM_... mouseactions myself.
i got the idea with SetWindowLong from this article: http://www.pocketpcdn.com/articles/close_app.html , but for GWL_WNDPROC under NT/2k/XP MSDN says: "You cannot change this attribute if the window does not belong to the same process as the calling thread."
-- modified at 10:21 Monday 19th September, 2005
|
|
|
|
|
Hi there!
I'm devolping an communication program, and sometimes I need to do some sleep's. The problem is that I use some external components that use the PostMessage API, and while the app is sleeping, the messages aren't dispatched..
I've developed a funcion with the folowing code:
void DispatchMsg()<br />
{<br />
MSG msg;<br />
DWORD dwi=GetTickCount();<br />
while (::PeekMessage(&msg, NULL, NULL, NULL, PM_NOREMOVE))<br />
{<br />
::TranslateMessage(&msg);<br />
::DispatchMessage(&msg);<br />
if ((GetTickCount()-dwi)>2000)
break;<br />
}<br />
}
But it seems that some time I get some repeated messages... I've also tried replacing the PM_NOREMOVE by PM_REMOVE parameter in the PeekMessage, but some times the app seems to hang...
Do you have any ideias?
Thanks all for your time.
ALMC
|
|
|
|
|
See MsgWaitForMultipleObjectsEx in MSDN.
"tous les sifflets des trains, toutes les sirènes des bateaux
m'ont chanté cent fois la chanson de l'Eldorado"
rechi+
|
|
|
|
|
How should I use it? Create a foo mutex or event?
I have a main wnd for the app, and a second wnd to receive messages from the comunication component.
I need to call the component api, wait some time so it can send messages to my wnd, and then process them...
ALMC
|
|
|
|
|
Do you want to freeze the window for a while, waiting for the api to throw a message to the queue?
"tous les sifflets des trains, toutes les sirènes des bateaux
m'ont chanté cent fois la chanson de l'Eldorado"
rechi+
|
|
|
|
|