|
That is because < and > are using by HTML for the tags.
Replace < with < and > with >
In fact you can simply click on the signs at the top of the editor to insert them.
|
|
|
|
|
Hi,
I have a simple application in MFC that creates files of (Name.ext) type. How can I make it launch the application by double clicking the file? Note, I can open the file from within the application?
|
|
|
|
|
If the file is an executable (like .EXE) you can use CreateProcess .
If the file is a document file (like .DOC) use ShellExecute with the "open" operation.
|
|
|
|
|
|
Thanks for the suggestion. I know how to open the app by double clicking, but what I am not sure how to do is how to handle double clicking a file created by the app. example:
my executable is "MyApp.exe", I use this to create files like "MyApp.dat". Where do I implement ShellExecute in the program to make "MyApp.dat" open up when double clicked?
Thanks
|
|
|
|
|
What is the format of your .dat file?
In which application do you intend to open it?
|
|
|
|
|
The App is a simple Dialog Application with an Edit Field that contains Text about the customer information. So, the data is simple CString Text. I would just like to have the file open when double clicking showing the customer Text as opposed to open the app and then point to the file.
Thanks
|
|
|
|
|
Maximilien has already answered that.
You have to associate .dat with your application.
|
|
|
|
|
I must be missing something, because I thought I had the association done. When I double click I get the App without the file info populated. But, I can look at my association code a bit more.
Thanks
|
|
|
|
|
Take a look at the documentation for CWinApp::EnableShellOpen() and CWinApp::RegisterShellFileTypes(BOOL bCompat) .
|
|
|
|
|
Did you use AppWizard to create the application? If so, it should have created a .reg file, and added a few lines (EnableShellOpen() and RegisterShellFileTypes() ) to the app's OnInitInstance() method to update the registry.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi All,
I am using CAcroAXDocShim classes for AcroPDF.dll in my project.
My projects main dialog uses this control to display the PDF's.
From my Main dailog, if i use the scrollbar, the PDF control dosent refresh properly.
i.e brown stripes gets in middle all over the PDF.
I taught of posting a refresh message to the PDF Control, but CAcroAXDocShim class dosent have a refresh method.
Can any one give me some suggestions on how i can get out from this refresh issue.
Thanks,
Kasi
|
|
|
|
|
kasi14 wrote: From my Main dailog, if i use the scrollbar,
Is it the ActiveXControl's scroll bar? or the DialogBox has its own scroll bar?
-Suhredayan
|
|
|
|
|
Is there any way to determine plunging or removing of a removable storage like flash memories to the system in MFC?
Of course not by setting timer?
|
|
|
|
|
Windows will broadcast a message, see DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE,
so all it takes is catching these.
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Thanks
DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE Messages work perfect.
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Can you respond to the WM_DEVICECHANGE message?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thanks
I have tested DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE Messages and they work fine
modified on Wednesday, November 18, 2009 2:28 PM
|
|
|
|
|
DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE are not messages.
They are parameters to the WM_DEVICECHANGE message as David said.
|
|
|
|
|
Hello all,
I am using Visual Studio 2008, and I created a new MDI application. In the setup of the application, I chose a file extension to use. In InitInstance of the class derived from CWinApp, I added this code as the first line of the function:
AfxMessageBox("InitInstance");
Also, in the class derived from CWinApp, I added as the first line of the function OnDDECommand:
AfxMessageBox("OnDDECommand");
When I run this program from the IDE, everything appears to be fine. However, when I run this from Windows explorer and double-click on the appropriate file (a file with the extension my program uses), I see the message: "Windows cannot find 'E:\Mikea Documents\mdi41.mdi4'. Make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search." I also saw the InitInstance message as was expected, but I didn't see any GUI, nor did I see any OnDDECommand message. The application remains open. Now, if I double-click on the file again, I see the OnDDECommand message and the GUI, but I didn't see the InitInstance message. The application now closes.
I have looked at different places on the internet to try to figure out why this is happening, but I haven't gotten anywhere. Does anyone have any ideas?
Regards,
Mike
|
|
|
|
|
My best guess is that of the Messagebox you have put in the InitInstance is behind this behaviour. The first time you double click on your file "mdi41.mdi4", your .exe application gets launched, however it is not getting intitalized correctly, untill you dismiss the MessageBox->"InitInstance" by clicking OK.
Once this happens, even though the document did not get loaded correctly, the Application may still be running (verify this using taskmanager). And next time you double click on the document again, the above mentioned running instance get the notification and loads the document correctly.
-Suhredayan
|
|
|
|
|
Hello,
I checked the Task Manager, and sure enough, the program was still running.
However, I want the program to show the InitInstance message and run the GUI regardless of whether the program is run from the IDE or the program is run after double-clicking the mdi4 file. Furthermore, I don't want to see the "Windows cannot find 'E:\MikeA Documents\mdi41.mdi4'. Make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search." message.
Regards,
Mike
|
|
|
|
|
Michael Adamus wrote: I want the program to show the InitInstance message
Try to show the message using modelelss dialogbox, or spawn a thread from InitInstance to display the message box.
Michael Adamus wrote: Furthermore, I don't want to see the "Windows cannot find 'E:\MikeA Documents\mdi41.mdi4'. Make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search." message.
This seems to be a bug within windows, it should have displayed a better error message, like for eg: "The DDE transcation failed", however if the actual issue (blocking InitInstance()) is addressed, then you might not face this one anyways.
-Suhredayan
|
|
|
|
|
Hi all,
I am trying to read a file having read-only property checked. i am not able to read the file and it is showing some exception from the file wincore.cpp stating "Accessing filepath\filename was denied"..
Is it a problem with CFile::moderead??
thanks,
rakesh.
|
|
|
|