|
Thanks, Kuphryn.
Actually I did call it in OnCreate, but also crash with Release build.
The point is it always work with Debug Build, but crash the second I press the hotkey with with Release build.
Do you have any Idea?
|
|
|
|
|
My application tries to print out in MM_HIENGLISH mode, however, the output on page is always offset a little. I have to call CDC::SetWindowOrg() inside CMyView::OnPrint() to balance out the offset. The funny thing is for different printer the offset is different. Can anyone help me out on the issue? I am using VC++ 5.0 Professional in Windows XP platform.
|
|
|
|
|
Hi there!
I have a problem with my MDI-application.
When the application starts, i want to have an OpenFile dialog. I have
cmdInfo.m_nShellCommand = CCommandLineInfo::FileOpen;
in CMyappApp::InitInstance() and
DoPromptFileNames(filename, AFX_IDS_OPENFILE,OFN_HIDEREADONLY | OFN_FILEMUSTEXIST , TRUE, NULL)))
in CMyappDoc::OnOpenDocument() , everything works fine, the dialog opens on startup.
Now the problem: by pressing the 'Cancel'-button, one would expect nothing to happen, no view to open, just the dialog to disappear.
But the view opens just like it would if one selected a file, and produces lots of trouble cause it actually has no file to handle.
I tried to work around this by closing it right away by calling CWnd::DestroyWindow() in my view's OnInitialUpdate() if there's no file to handle, but then I get in trouble with my CDoc*...
What I want is just a simple solution for this: Open a fileOpen-dialog, just close it by pressing 'Cancel' and closing it and launching my view by selecting a file...
I hope it is understandable, my english isn't actually the best
thank you and greetz
Tib
----------------------------------------------------------
I once had a nightmare in binary --- I think there was a 2
|
|
|
|
|
You should just need to return FALSE from your OnOpenDocument() function to cause MFC to not create an empty document/view.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
Thanks for your help...
I already tried that and it destroyed my MainFrame...
dunno how to fix it, so I do not open an openFile dialog on startup, would have been nice, but is not necessary.
Best regards
Tib
----------------------------------------------------------
I once had a nightmare in binary --- I think there was a 2
|
|
|
|
|
Hello,
I am writing an small setup program and I need to install some fonts. I had look in MSDN and in many other places, but I can’t find the solution. AddFontResource works but only on the current session after a reboot the font is gone. I also tried CreateScalableFontResource with AddFontResource but I can’t get it to work. I copy the ttf font file to the windows fonts folder and it does not work. Here is a sample function:
void InstallFont(CString sFontFileName, CString sFontLocation){<br />
<br />
CString sFontResource(GetWindowsFolder() + sFontFileName + ".fot");<br />
CString sWinFonts(GetWindowsFolder() + "Fonts\\" + sFontFileName + ".ttf");<br />
<br />
::CopyFile(sFontLocation + sFontFileName + ".ttf", sWinFonts, TRUE);<br />
<br />
CreateScalableFontResource(0, sFontResource, sWinFonts, NULL);<br />
AddFontResource( sFontFileName + ".fot" );<br />
}
If you have any ideas please help. An example will be perfect. Thanks.
|
|
|
|
|
Is the problem something to do with the windows security?
|
|
|
|
|
We have had the same problem. Just copying the .ttf into the fonts directory is not enough. You also need to add some registry keys settings to get teh font to work correctly. Try copying in the font, use word etc to use it, which sometimes gets the font working initially. Then search the registry for the fonts filename, and hopefully that will return the reg keys you need to add, to get the font registering correctly when you first add the font.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
How can i detect USB isdn modem with VC++ and how can i get 2 isdn phone lines through it?
I can't manage to detect it through SetupDiGetDev if i set INTERFACE flag with modem GUID. I wonder if i'm doing something wrong. Can someone give a example to me?
Thanx in advance for answer!
|
|
|
|
|
I ran into some serious bugs in the adobe reader 6.0 activex control. (pdf.ocx has problems when trying to load .xfdf file) I've been at Adobes forums and posted about this topic. People say that the control has zero support. What is a good pdf viewer control that has support for .xfdf ?
(auto merge with linked pdf and no need to save the result. Just needs to have basic viewing features and has to be able to print)
|
|
|
|
|
My boss wants to be able to change Files of Type pulldown dynamically inside
a CFildDialog callback. For example, we would start with a list of 5 file
types and the last file type is "More...". If the user clicks on "More..."
then the Files of Type combo is to be repopulated with 25 file types, for
example. Then the last entry is "Less..." and so the user can reduce back
to 5 file types.
Has anyone seen this done in a commercial product or a demo? I'm no
stranger to explorer style hookprocs, written them in (and out of) MFC.
I can capture the child control notification, I clear the combobox,
repopulate with a new list. However, the next time the user comes along
and picks a type, I get a null pointer in COMMDLG32.DLL.
Should I give up or is there hope?
|
|
|
|
|
Ok, I read about CImage on MSDN, and I have to include atlimage.h in StdAfx.h
I did it, but it says there is no such file. Where can I download it and where must I store the file (which directory)?
Thanks,
~Michael
|
|
|
|
|
|
hi friends,
i m facing one problem while using services.
the problem is..........
The service behaves well initially when i start manually through service interface(service is not autostart, one has to start manually). As soon as i LOG OFF from the system & again LOG IN to the system i found that service stops however when i check the service interface it shows that service is running and even TASK MANAGER displays the EXE of SERVICE as running status.
i hope u understand my problem.
waiting for reply.
|
|
|
|
|
I hope you registered ur service by /Service
Toughest Steel Comes From Hottest Furnance
|
|
|
|
|
hi thnks for reply , but can u elaborate more how to register service using /Service
|
|
|
|
|
I assume that urs in an ATL Exe Service, so you register it
by servicename /Service
by doing so it wont stop ther service even if you log out.
Toughest Steel Comes From Hottest Furnance
|
|
|
|
|
Anybody knows how to use the TrackMouseEvent function???
I need a some sample code. I geting .
|
|
|
|
|
I'll try it but I didn't use it for a long time. I used the TrackMouseEvent() for an owner drawn caption where I needed to track whether the mouse has left the caption.
Header:
bool m_bMouseTracking
Constructor:
m_bMouseTracking = false;
void OnMouseMove(UINT nFlags, CPoint point):
if( !m_bMouseTracking )
{
TRACKMOUSEEVENT tme;
tme.cbSize = sizeof(tme);
tme.hwndTrack = m_hWnd;
tme.dwFlags = TME_LEAVE | TME_HOVER;
tme.dwHoverTime = 1;
m_bMouseTracking = _TrackMouseEvent(&tme);
}
void OnMouseLeave(WPARAM wparam, LPARAM lparam):
...
m_bMouseTracking = false;
But I think you can use TrackMouseEvent() only with Windows98 and newer. If you want to be compatible to older OS's too, you should look for SetCapture() and ReleaseCapture(). Then you can check on which OS your app is running and switch to the appropriate tracking mechanism...
CU... mYkel
|
|
|
|
|
Hi,
when I include the boost library into my project, I get min and max as "ambiguous symbols".
it is enough to include boost/config.hpp
Now my project is fairly big (and I already removed two "using namespace std" instances in a header file), yet the error persists, and I have no idea how to track it down.
Any ideas?
Flirt harder, I'm a coder.
mlog || Agile Programming | doxygen
|
|
|
|
|
Have you tried defining the macro NOMINMAX in your project settings? This effectively removes Windows min and max macros.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Ok, so say I hava an MS word doc set up like:
blablabla...
Some Header
Some table
Col 1 | Col 2
--------------------------
data1 | Some text
data2 | Some text
data3 | Some text
blablabla...
And I want to extract the header and table data via C++... (7.1)
Where does one start? Any references, ideas, article suggestions.....
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Start by reading about Word's automation Object model.
You can, I recall, access the document's collection of tables.
Having done this, you should be able to refer to properties of the table to extract text from it.
If you know VB it's helpful
[Hey, you at the back! Stop throwing that stuff at me... ]
Steve S
|
|
|
|
|
i get the handle to a textbox in any opened window on my desktop using Enumhcildwindows function <under hooking="" system=""> and i want to set a text in this textbox automatically.i need a function to do this task..
thank you
E-Email: app_prog@yahoo.com
Hawk,amr
|
|
|
|
|
VERIFY (::SetWindowText (hWnd, _T("foo")));
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|