|
|
Hi all, again, this is just a quick question. I have managed to create my own OnOpen and OnNew functions in my project in the CMainFrame class, however, I`ve tried doing it exactly the same for OnSave (not OnSaveAs - yet, cos I can`t get this going) but the function never gets executed - despite me clicking the menu button Save (I get the crappy dialog box coming up with Save As on it for some reason???). Just wondered if anyone had experienced similar problems, and what the solution was. I`ve tried overriding in both CMainFrame and CMDIFrame class but neither works,
Cheers guys,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
Hi U can override SaveModified which is the function which gets called when
the 'Save' or 'Save As' Happens, This is the function that prompts the Saving
and then calls DoFileSave-->DoSave.
So if u want to tailor to ur own needs i would recommend
that u copy the original code and modify to tailor ur needs,
U can find the source in 'doccore.cpp'(mfc src).
regards,
Prem
|
|
|
|
|
Hello could anyone please tell me how I can print a complete dialog box. My dialog box contains bitmaps and some images.
I know how to print individual bitmaps, but I want to print the complete dialog box.
Thanks.
Gautam
|
|
|
|
|
Hi There is an exampe in the Platform SDK
known as 'Zoomin' which basically captures
the screen using Bit Blasting, u can use the
same and send ur dialogs image to the printer.
regards,
Prem
|
|
|
|
|
I'm creating a program in Visual C++ using the Microsoft Foundation Classes, and I'd like to open a Word Document when I click on a certain button in my program.
Does anyone know how I can do this or where I can find the code?
I noticed another question which is similar to this was recently posted, but I'm not sure how to actually Open Word at the minute.
Any help will be greatly appreciated.
Thanks
|
|
|
|
|
Look in MSDN at (Q238611) "Embed and Automate a Word Document with MFC"
HOpe this helps,
Bill
|
|
|
|
|
Call ShellExecute() and pass it the name of your .DOC file.
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
Test out a prerelease build of my Hotfix Checker v2.0! (133K)
|
|
|
|
|
hi,
I have problems dealing with text files while
trying to open them through ODBC.
i'm with Win98 and in control panel (ODBC DATA SOURCES)
i assotiate an DNS to tab separated .txt,
when i open it in my program with
rs.Open()
the error is
Syntax error in FROM clause.
State:37000,Native:-3506,Origin:[Microsoft][ODBC Text Driver]
i'm in a hurry, that's why i ask so much, not reading
10x, Stanislav
|
|
|
|
|
There seems to be an error in your SQL.
Can you post the SQL here?
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
hi!
i´m trying to open a word document, i can opent the word application, but i don´t know how to open the file inside.
Any ideas??
Thanks!!
Monica
|
|
|
|
|
Use the Open method of the Application.Documents collection.
You will undoubtably have more questions that can be answered by looking int the MS Word Help at the Microsft Word Visual Basic Referenc topic.
Hope this helps,
Bill
|
|
|
|
|
I have a com server application (.EXE). It was created using ATL, with MFC support. Following instructions from MSDN (Q181505
PRB: ATL COM AppWizard Doesn't Offer MFC Support for .EXE )I added #include <afxdisp.h> to my stdafx.h and changed #include <winres.h> to #include <afxres.h> in the .rc file as recommended.
All is well except that AfxResourceHandle seems to be NULL. This manifests itself when CDatabase or CRecordset tries to throw CDBException. In building the exception it attempts a LoadString which gets an assertion due to AfxResourceHandle being null.
Can any help me out here? I'm pretty sure AfxResourceHandle never got assigned, probably because its an ATL project. Is there something else I need to do?
I've seen two differnt MSDN articles on the subject and they don't agree!) The other one is
Q173974 HOWTO: Add MFC Support to an ATL Project.
Thanks for the help,
Bill
|
|
|
|
|
Look up the AFX_MANAGE_STATE() macro in MSDN. You need to add this to the beginning of every COM method and exported function.
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
Test out a prerelease build of my Hotfix Checker v2.0! (133K)
|
|
|
|
|
Thanks a bunch. That seems to fix it
Thanks for the help,
Bill
|
|
|
|
|
OOPS, thought that fixed it, instead I also eliminated the error condition, causing it to not use the global. Now when I force a file error, I get the same condition. Here's the code I used:
STDMETHODIMP CFunction::Execute(BSTR bstrRequest, long lRowID, long *lRetVal)
{
ASSERT(afxCurrentResourceHandle != NULL);
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
ASSERT(afxCurrentResourceHandle != NULL);
Both asserts fire! I think there must something wrong with the initialization.
I also placed an assert in _twinmain before any of MY code is encountered (up 'til now its all wizardry!)
if (bRun)
{
ASSERT(afxCurrentResourceHandle != NULL);
This one fires also.
What is wrong? Every thing else is standard ATL .exe project.
Thanks for the help,
Bill
|
|
|
|
|
Hello I try find a solution to show the linenumber in a edit control. But trying to get all the handles
- cursor movement
- scolling up/down
- moving the scoll-Slider ...
seems to be hard stuff .
Looking at 4GLs I saw something like 'synchronize scrolling', so that I can place a widget close to the edit control, just showing linenumbers 1,2,3,.. . Scrolling in one widget will scroll the other.
Any idea to solve this problem ?
Hansgeorg
|
|
|
|
|
Hi,
I have installed Windows 2000 Professional on my machine and now I am facing a very strange problem. I am not able to run my applications that use windows sockets to connect/listen to connections from other machines. I am able to make atmost 2-3 connections only at a single time. I am also unable to browse the network from windows explorer when some connections are already made. The error that I receive is 'Insufficent quota of resources exist'. Can anyone tell me what the problem is and how to solve it?
Thanks,
Krishnan
|
|
|
|
|
I can`t tell you what the problem is, only that I know a good few people who have experienced terrible trouble getting win2k to network properly, particularly when other OS's are connected. There is a non-descript delay in connecting the network upon startup, amongst other reports of high latency and failure to browse whole sections of the network. My advice is to try using a different OS, I`m using Win XP RC1 (I have RC2, but can`t be bothered to re-install it for such a minor upgrade in performance), and it is sh**loads better than win2k in my opinion, networking is a dream. If you really want it to run on win2k I think you`ll be in it for the long haul (but maybe I`m wrong!).
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
Hi,
I want to play audio from a Sony Digital Videocassette Recorder
DVR-28(D2).
In VC++ dialog window, i only need to set the play, pause, stop
and continue button. In addtion, i need get the timecode
of the audio(hh, mm, ss, ff) and display it in the dialog window. I really want to how how to apply the Api functions to do this,
and how to get the time code?
Any points are appropriate.
Thanks in advance!
chen
|
|
|
|
|
Hi all,
I am trying to update my custom controls to get the XP look and feel. The rendering of the controls using the XP themes API is not a problem but trying to determine when to use XP themes and when not is. I have created two test apps, one with a manifest and one without. When I use the IsAppThemed() API I get FALSE on the app with the manifest (visual styles enabled) and TRUE with the app without the manifest (no visual styles enabled) which strikes me as odd.
My question is how do I determine when I should render using visual styles and when not. Perhaps the anwser is simple but somehow I can't seem to find out what it is
Thanks in advance,
Jan
|
|
|
|
|
i strictly need to use the below code to include my toolbar in my mainframe
if (!m_wndToolBar.Create(this) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
m_wndToolBar.ModifyStyle(0, TBSTYLE_FLAT);
i found tat the tooltips will not be displayed. how do i go about to enable my tooltips to be displayed
|
|
|
|
|
I am making an SDI app that has different views and splitters.
The views are created and replaced dynamically so do i actually need to have a DocTemplate?
I want to be able to cycle through my documents available views by using GetFirstView() etc but manually attaching the views to the doc using AddView should work just as well i think.
hmm.. i think i was just thinking out loud then..
I think my main question is, are doc templates only useful for vanilla doc/view apps (ie word) where the doc is pretty much a virtual document and the views are interfaces to it as opposed to apps that may use the doc/view architecture for slight data/presentation seperation.
wow that was a long sentence, yeah i think i'm rambling a bit
apologies for all the questions, im just trying to see how other people do things so i can find the best ways
ash
|
|
|
|
|
I use document templates as I think they make the document/view architecture quite nice and simple to use. They also tidy up a lot of the pointer creation stuff so that you don`t have to worry about that, which is nice. I personally would use one, but then again my applications tend to be MDI, not SDI, so you may prefer not to (I would, even still). Hope this helps make your mind up.
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
I am trying to debug an SDI app i am currently deveoping but DevStudio keeps locking up in a certain section of code so its nearly impossible.
When i step thru the code it locks inside one of my funcs that reads data from a socket. This has a large loop in it so i cant really step thru it fully but if i try to run to cursor at the end of the loop it just hangs the app and devstudio with it
The main thing that is frustrating me is that if i just run the prog in debug mode it runs ok. I am actually trying to debug another prob altogether but am finding it very difficult.
Has anyone else come across a prob like this before? Its making me crazy!
|
|
|
|