|
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.
|
|
|
|
|
Can you at least show the relevant code?
"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
|
|
|
|
|
Most decidedly, this has nothing to do with CFile itself, but that you're doing something wrong. Can you show us your code?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Without seeing your code, most likely you're trying to open the file with read/write access, which will fail. If you show your code, perhaps we can be more helpful.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Hi
I used following code to replace my application menu.
CMenu mu;
mu.LoadMenu(nMenuID);
SetMenu(&mu);
DrawMenuBar();
The new menu was loaded. But whenever I tried to get MENU Handle, I will get an assertion error.
CMenu* pMenu = GetMenu();
HMENU hmenu = pMenu->GetSafeHmenu(); --->Assertion error.
How can I solve this?
Thanks,
modified on Wednesday, November 18, 2009 9:04 AM
|
|
|
|
|
I'm not an expert about, but I suppose in not a good idea using a CMenu temporary object.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Do you have any good idea to do this?
What is good way to replace my application menu?
Thanks,
|
|
|
|
|
CPallini wrote: I'm not an expert about, but I suppose in not a good idea using a CMenu temporary object.
Apparently[^], using a local object is the canonical way to set a menu, but CMenu::Detach()[^] nneds to be called before the temp object goes out of scope.
Ah, the beauties of MFC
|
|
|
|
|
Nemanja Trifunovic wrote: Ah, the beauties of MFC
(I would like to know Rajesh's thoughts about...)
Nemanja Trifunovic wrote: Apparently[^], using a local object is the canonical way to set a menu, but CMenu::Detach()[^] nneds to be called before the temp object goes out of scope.
Of course, the canonical way depends on the documentation author of the moment... [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
OK, I just read this post.
Well, I see that MFC is *actually* beautiful. One mistake is that most frequently done by newbies is putting a CFont object on the stack, setting the font of a control with this, and then wondering why it "didn't work". But they'll eventually get things to work and will appreciate the framework.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
transoft wrote: CMenu mu;
mu.LoadMenu(nMenuID);
SetMenu(&mu);
DrawMenuBar();
Is mu local or does it have class scope?
What line of what file is asserting?
"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
|
|
|
|
|
The Debugger did not guide me to there.
Thanks
|
|
|
|