|
Hello all,
Does anyone know how to figure out the default mail client and then start it from a dialog?
I want the user to be able to select an option to fire off the mail client from within my application.
Thanks,
Murrah Boswell
|
|
|
|
|
ShellExecute()
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Yeah, that's where I ended up!
Thanks!
|
|
|
|
|
(might sound outdated but I have a nice aplication for that..)
How can I create an Active Document Server that is in-place activated? (Like a Word document added to a project opens in-place in Visual Studio). Using MFC AppWizard and creating a full automation server, it still opens in a separate executable.
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
|
Itdid not, but it does tell me I'm on the right track
[edit] found the difference:
I have to insert it using "Other Document". Still get an Assert, but it mostly works.
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
Hi all, What is the best way to print inside MFC (Visual 2002). I have tried TextOut but that sucks because every printer is different. I am getting the idea that MFC can't do a very good job of printer because of limited functions? hopefully, its my limited knowledge.
|
|
|
|
|
I'm sad to say that it is your limited knowledge
With GetDeviceCaps , you can get the resolution for the output media (be it screen or printer). You can use the value - compared with that of the screen - to scale your drawing and font creation.
For text only, you can also create fonts in typographical points - CreatePointFont and CreatePointFontIndirect .
Finally, you might want to set the mapping mode to one of the physical coordinate systems - see SetMapMode on MSDN.
|
|
|
|
|
Hi Johan,
Thank you for the support. I will be working on this problem this weekend. Sadly, printing is my weakest skills but this project will force me to be better. I guess I have put off printing long enough. Thnx again.
|
|
|
|
|
It's not much different from working with the screen, actually. The big problem is designing drawing code that makes no assumptions regarding the output resolution.
|
|
|
|
|
My question concerns the setting of controls on "not-yet visited" property pages.
I have a PropertySheet dialog with 3 property pages. I have followed the common convention of creating this property sheet as found here at CP and also in the MSDN Library. The operation of this works good and I would say the creation of the Sheet/Pages is good too, except for what I want to do.
I am reading an external config file (text) and would like to pre-load my pages with values read from the config file. I can do this for the first page with no problems. When I try to load values into controls on other pages, it crashes with undefined window handles. HOWEVER, if I visit each page first and then pre-load my pages, everything is fine - what gives???
I have tried to circumvent the OnInitDialog() for each page, but this proved unsuccessful - same results.
Can anyone help me with what I want to do?
Thank you,
John John
|
|
|
|
|
|
Michael describes the default behaviour correctly. But if you're using version 4.71 or higher, you can specify PSP_PREMATURE as one of the values assigned to the dwFlags member of each PROPSHEETPAGE structure. Each page that has this value toggled on will be created when the property sheet is created (as opposed to waiting until it is first changed to).
|
|
|
|
|
|
I have a SDI application that I have added other classes to. Sometimes I need to access the doc file from those classes to update a document variable. I am not sure if I can get to the mainframe from one of the classes and access the doc file that way, or if I should use forward referencing to send messages directly to the doc file. Forward referencing sounds like it should be do-able, but I dont know how to capture the doc object in my other classes.
Thanks.
Jerry
|
|
|
|
|
If you have other classes that need to update a document, then I suggest that you put a pointer to the docuemtn in the classes from the beginning.
For window-based classes, you might want to consider sending messages to the main window using AfxGetMainWnd , this would probably feel natural for others reading/maintaining your code.
|
|
|
|
|
I have a client application that connects to a server application using connection based sockets. Is there any particular error message that I could capture on the client if the network cable is broken or broken and reconnected? I know there are some error message that can let you know if the network is down or unreachable.
Thanks.
Jerry
|
|
|
|
|
|
Does anyone know a TreeCtrl that will display and allow you to run files (via double click), that will integrate into a MFC dialog (Modeless).
I did find CTreeFileCtrl in this site but could not get it into my dialog, it seems that it works for SDI applications and could not figure out how to integrate it.
I have found a few Tree controls but again all seem to be for MDI or SDI applications.
grahamfff
|
|
|
|
|
Grahamfff wrote:
I did find CTreeFileCtrl in this site but could not get it into my dialog, it seems that it works for SDI applications and could not figure out how to integrate it.
From the article[^]:
To use CTreeFileCtrl, include FileTreeCtrl.cpp / .h in your project (in addition to SortedArray.h) and #include "FileTreeCtrl.h" in the module you want to instantiate it in. You can use the usual MFC ways of hooking up the class. If you are using the class in a dialog resource, then you can use the DDX function provided or call the CWnd::SubclassWindow() function directly. You can also create the control dynamically by calling its parent classes CTreeCtrl::Create() method.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
I am struggling with CPropertySheet / CPropertyPage to create a tabbed dialog box.
After creating a project, I Project/Add Component / VisualC++ Component / PropertySheet. Then, I selected a PropertySheet (instead of Wizard) with 3 tabs. The tabs showed up in the project as CMyPropertyPage1, 2, 3.
The CPropertyPage1 (2,3) is :: public CPropertyPage (subclass)
If I look at the header file CPropertyPage1.h, I see soemthing like:
// Dialog Data
//{{AFX_DATA(CMyPropertyPage1)
enum { IDD = IDD_PROPPAGE1 };
// NOTE - ClassWizard will add data members here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_DATA
Now, if I add some controls on any page, and double click on it for the handler code, Visual C++ asks me to create new class. Then, a new class is created based on CDialog. Assume its name is CMyPage1
CMyPage1 is :: public CDialog, and is also bound on the same dialog template:
// Dialog Data
//{{AFX_DATA(CPage1)
enum { IDD = IDD_PROPPAGE1 };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
So, my question is:
Both CPropertyPage1 and CMyPage1 are refering to the same dialog template (IDD_PROPPAGE1). MyPropertySheet adds the CPropertyPage-typed variables in its constructor. CMyPage processes the handler code.
What is the relationship between CMyPage1 and CPropertyPage1 ? It seems to me that they are 2 parts of each tab. Why the hell do we need to have 2 separate classes that refer to the same thing ?
Thanks a lot for enlightening me.
|
|
|
|
|
hongheo76 wrote:
Now, if I add some controls on any page, and double click on it for the handler code, Visual C++ asks me to create new class. Then, a new class is created based on CDialog. Assume its name is CMyPage1
The class wizard should have given you the option of using an existing class. Take that option and select the correct CPropertyPage* class. You should have only one class per page, not two.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
I have a dialog-based MFC application within which I need to do some serial I/O. Basically, I need to wait for a certain character to come in on the serial port. I'm successfully creating a file for the port in overlapped mode and starting ReadFile with a valid overlapped structure and event handler. Also, I'm using WaitForSingleObject() with a short timeout to check whether the event has been set or I've timed out.
What I want to do is cause my dialog to perform message handling (specifically redrawing) whenever WaitForSingleObject times out. That way the user will see a properly repainting display while we're waiting for the serial characters instead of what looks like a hung application. Any suggestions would be greatly appreciated.
Best Regards,
pHaze426
|
|
|
|
|
Put the serial port stuff in a separate thread and the GUI will remain responsive.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I could do that, but I'd still have to have the function launching the thread wait until the serial read completed before continuing with its tasks. Otherwise, I'd have to hook a callback function or something to handle a state machine that's called after each read. I just wondered if there was any other option as far as a function I could call to do processing while I'm waiting.
Best Regards,
Phaze426
|
|
|
|