|
You need to set the file pointer to the end of the file before writing to it if the file already exists. Otherwise, each time you open the file, the 'writing' will start at the very beginning of the file.
This will set file pointer to end of file, so you can 'append':
SetFilePointer(hOp, 0, NULL, FILE_END);
|
|
|
|
|
I tried to add scroll bar to the child window in a MDI.
In the mother window I modify code as below:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style =WS_OVERLAPPEDWINDOW|WS_VSCROLL|WS_HSCROLL;////Mewly added
if( !CMDIFrameWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
It works well.
However in the child windows.
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
///////////Mewly added///////////////////////////
cs.style =WS_CHILD|WS_OVERLAPPEDWINDOW|WS_VSCROLL|WS_HSCROLL;
//////////////////////////////////////////////////////////////////////////
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
The scroll bar will appear when running the program, however it doesn't function. I can't scroll the child window at all.
I also tried the method recommended by MSDN---- "derive a new class from CMDIChildWnd and replace all references to CMDIChildWnd in your project with references to the new class." The scroll bar wont even come out. Where did I make mistake?
Anybody can help me with the simple question?
Hello, Everybody!!!
|
|
|
|
|
Hi All,
I am getting this error while bulding the project.
LINK : fatal error LNK1104: cannot open file "msxfs.lib"
And when I give path of this lib file in project settings, it is giving me 42 errors and I am sure that my code doesn't have any error.
Please tell me how to fix this error.
Thanks in advance
Preeti9
|
|
|
|
|
I think the linker would disagree with you.
However, in the interest of fairness, how about posting some of the errors so the more-experienced of us might be able to help you out
|
|
|
|
|
Iam running VS.NET beta 2 and I would like to include a variable representing the version of the executable of my application into the msi project of the application. I would like for example to define the DefaultLocation of the Application folder as follows
[ProgramFilesFolder][Manufacturer]\[ProductName][MyUserDefined_Appli_Version].
Thanks for any hint
GA
|
|
|
|
|
I don't know how to do it with Visual Studio.NET beta 2; however, you can easily do it with Orca, an utility contained in the Windows Platform SDK.
Change the DefaultLocation to your string.
To modify the MSI file with Orca:
- Open the .MSI file with Orca
- Select the Property table in the left pane
- Add a new row to the table with the property name and value that you want.
- Property: MyUserDefined_Appli_Version
- Value: (whatever value you want)
- Save the file and close Orca.
"we must lose precision to make significant
statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Thanks for the hint. It only partly solves the problem since I want to work with the variable from within the VS.Net
|
|
|
|
|
hi all,
where does explorer saves the changes of the folder?
suppose i change the view from details to icon, then closes the explorer window then re-open it, the information is stored and i see the icon view..
question is, where does it store this info?
i've searched the registry, and the desktop.ini files but couldn't figure it out...
can any1 help?
thanks
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
YaronNir wrote: question is, where does it store this info?
Try:
HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\Bags or HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Bags
I believe that each 'number' under that key represents a different folder.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Very interesting
Owner Drawn
--Nothing special
|
|
|
|
|
thanks a lot for all your help, you sure hold a great knowledge
looking at those keys, there wasn't anything there that defines a folder, couldn't find any reference that would tell me which number holds which folder?
any documentation regarding?
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
This code does not work properly tell me the correct one
void CRichtextView::OnLButtonDown(UINT nFlags, CPoint point)
{
CFontDialog mydlg;
CTextfile dlg;
if(mydlg.DoModal() == IDOK)
{
dlg.m_rich.SetSelItalic()=mydlg.IsItalic();
dlg.m_rich.SetSelUnderline()=mydlg.IsUnderline();
dlg.m_rich.SetSelFontSize()=mydlg.GetSize();
dlg.m_rich.SetFont(mydlg.GetFont(),TRUE);
}
}
where Richtext is the project name and CTextfile is the dialog where Rich-Edit controll is placed
|
|
|
|
|
|
Are you trying to set values to controls before the dialog dlg has been created ?
If m_rich is a control in the dialog dlg , then the control needs to be created before setting values to it.
I assume that you will be doing a DoModal on the dlg dialog, because now, there's nothing going on after you assign the values to the m_rich member of the dialog.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hi all,
Could you please give me an advice what book is only for MFC GUI learning, more examples is good for me. (Title, author and SBNI).
This book must be for Visual c++.net year 2003, because I am new and not smart to figure out to keep track what book saying for older Visual C++ version.
Thank you.
MilkyWay
|
|
|
|
|
Microsoft Visual C++ .NET 2003 Kick Start by Kate Gregory
|
|
|
|
|
Thank you. I just ordered this book.
MilkyWay
|
|
|
|
|
You should also be aware that VC++ 2005 is out now. And the Express Edition is a free download for the next 11 3/4 months.
|
|
|
|
|
Nishant Sivakumar wrote: the Express Edition is a free download for the next 11 3/4 months
Actually, it remains free to use ever after. But the download is free until Nov. 2006.
On the downside you need one of the infamous Passport-IDs to register.
One of those "We want to know all about you and share it with whoever pays enough"-Spam inviters.
I really like anonymous EMail services.
(MS seems to detect spamgourmet)
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
jhwurmbach wrote: On the downside you need one of the infamous Passport-IDs to register.
I don't think this is much of a hardship. I get no spam with my hotmail. Also, as it's not my primary email account it doesn't matter.
Kevin
|
|
|
|
|
Nishant Sivakumar wrote: And the Express Edition is a free download for the next 11 3/4 months.
Doesn't have MFC though.
Kevin
|
|
|
|
|
Kevin McFarlane wrote: Doesn't have MFC though.
True!
|
|
|
|
|
Visual C++.NET Bible
Tom Archer
Excellent book!
And Tom frequents CP quite often to boot!
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
I'm trying to turn off incremental compilation in VisualC++ 6.0.
At the moment I'm using the following options but the compiler seems to be ignoring me and keeps creating the "vc60.idb" file.
cl.exe /nologo /c /W3 /Gi- /Zp1 /Od /GZ /FD
Any idea?
---
There are 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Go to [Project Settings], tab [C/C++],
select the cpp file(s) you are interested in,
select "Precompiled Headers" in the "Category" combobox and
then click on the "Not using precompiled headers" radio button.
SkyWalker
|
|
|
|