|
A CString doesn't contain the actual contents of the string, but a pointer to it. So you can't just write a binary copy of the struct to a file. Either use the MFC serialization mechanism or define your own I/O routines for the struct that save and restore the text in the string.
|
|
|
|
|
|
how can i display the progress of the CFptConnection::GetFile() method using the CProgressBar?
thanks
|
|
|
|
|
You wont be able to do it with the CFptConnection::GetFile() method, you'll have to use a combination of CFptConnection::OpenFile() and CInternetFile::Read(). Then all you need to do is a simple calculation based on the file size and the amount that you have downloaded.
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
I'm having a hard time trying to create a new dialog box and getting it to open whenever the program opens in a Dialog Based application in MFC. Can ANYONE help?
I Want Chicken, I Want Liver, Meow Mix, Meow Mix, Please Deliver...
|
|
|
|
|
If you want to show a dialog when the program opens you can declare the dialog instance and the DoModal. Note: This is not the way to create a splash screen.
Ex:
CMyDialog dlg;
dlg.DoModal();
You should include the above code on the PreCreateWindow or similar.
Hope it helped!
|
|
|
|
|
Hello,
UC I have made a program to retrieve data from the database for some person.
Now,everytime he formats the disk or takes the program along with the database to another system,he should install the database using ODBC...present in control panel.
How to automate this installation task from the program?
That person is extremely new to computers and can just work on it and nothing else.
Please help me fast.
Thanx:
|
|
|
|
|
I haven't done this but the ODBC info is apparently in the registry: On this W2000 machine under HKEY_CURRENT_USER\Software\ODBC\ODBC.INI. Try exporting the appropriate entry as a .reg file.
|
|
|
|
|
I have a tree view on the left and a formView on the right
i need to make the tree view as dockable window
how do i do it ?
Can anybody tell ?
parag
|
|
|
|
|
Does anyboday knows how to show ClassWizard in VisualStudio.NET ?
|
|
|
|
|
There is no Class Wizard in VS.NET. However you can make command and message handlers through property window.
_________________________________
Get RadVC today. Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
Alright, i wrote a small program to download a file using a CInternetSession and a CInternetFile.
1) How do i retrieve the total FileSize of the file that should be downloaded?
2) The File is Truncated at random positions (?), when writing the buffer (file->ReadString(line)) to a file with fputs(outfile,line). How can i fix this ?
any help would be greatly appreciated !
|
|
|
|
|
please help me, i am quite clueless about that . Or is there another way of downloading files from the net ?
|
|
|
|
|
Hi u can d/l files using CPftConnection and look for files on the server using the CFileFind class.
CpthConnection *pFtp;
pFtp = InternetSession.GetFtpConnection(...);
|
|
|
|
|
Are you trying to download binary files or text files?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
i want to download binary files using http
|
|
|
|
|
You initally stated using CInternetFile which is the base class for CHttpFIle and CGopherFile (spelling?).
I use this call to find the length of the returned data for CHttpFile calls. I do not know if it works with CInternetFile.
pHttpFile->QueryInfo(HTTP_QUERY_CONTENT_LENGTH, strRetBufLen);
The call pHttpFile->GetLength() returns the length of the sent string.
Hope this helps.
|
|
|
|
|
Hi all,
I wanna find all records that the name field is "Ali" or like "Ali" ... for example "AliReza" or "alireza" !!!
How can i do that ?
Can i use of Find function or i must use of SQL string ???
I'm using of DAO ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi.
The solution is very simple:
SELECT * FROM Table WHERE Name Like 'Ali*'
The question is, how to implement this:
1) If you're using Recordset-classes derieved by the classwizard, you
have to modify the CDaoRecordset::m_strFilter member
(like CMySet::m_strFilter = "Name like 'Ali*'). Remember that there is no
'WHERE'.
2) If you're using recordsets returned upon an querydef, just open the
querydef with the whole SQL-string, including that 'like' condition.
If you have further questions, you can contact me by eMail, as I'm often in touch with DAO and SQL in my projects.
--------------------------------------------------
"Pseudocode is code to demonstrate a concept, not designed to be run.
Like certain Microsoft software. "
|
|
|
|
|
Thanks aloooooooooot for your helps ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
How can i add a tooltip to a buttons and to ToolBar burrtons?
thanks
|
|
|
|
|
Hi,
- to add a tooltip to a button control use CToolTipCtrl::AddTool (...)
- to add a tooltip to a ToolBar I use the Ressource Editor to add menu-items. The ids of my menu items are associated with my toolbar buttons (they have the same ressource id). In the properties dialog of a menu item, put any text in the "statusbar-text" field. The part of the string after a '\n' is used as tooltip for the toolbar automatically by the framework.
Nice day ,
~ Florian
--
Florian Heidenreich
WWW: http://www.mp3tag.de
eMail: codeproject@mp3tag.de
|
|
|
|
|
thanks, but i am using a simple application based on a dialog, with no framework, i create this toolBar manualy, at run-time. i've tried what u said and it didnt work... any other ideas?
thanks
|
|
|
|
|
the problem i came across: i want to be able to zoom in or zoom out a bitmap
(original size is 800*600)on a dialog,every time when the user clicks the zoom button,
i stretch the bitmap by ratio of 2,4,8,16,32 of the original size.When i set my
system's color mode to 24bit true color and the ratio reach to 8,it doesn't work,
whereas under the mode of 16bit enhance color or 32bit true color,it work!
BUT WHY?Had i forgotten anything?
the code is:
CMyDialog::OnPaint()
{
CPaintDC dc(this);
HDC hdcMem1=CreateCompatibleDC(dc.GetSafeHdc());
SelectObject(hdcMem1,m_hBitmap);
int nRaster=dc.GetDeviceCaps(RASTERCAPS);
if((nRaster & RC_STRETCHBLT) !=RC_STRETCHBLT){
dc.TextOut(100,100,"Not surport StretchBlt()");
return;
}
dc.SetWindowExt(m_szImage.cx,m_szImage.cy);//m_szImage if the size of the bitmap;
dc.SetViewportExt(m_szImage.cx,m_szImage.cy);
dc.SetStretchBltMode(COLORONCOLOR);
BOOL ret=StretchBlt(dc.GetSafeHdc(),0,0,m_szImage.cx,m_szImage.cy,hdcMem1,0,O,800,600,SRCCOPY);
DeleteDC(hdcMem1);
}
Thank in advance;
Truely yours julia.
|
|
|
|
|
I'm really sorry to tell you this, but it is a known bug. StretchBlt was purposefully limited, and accidentally overlimited. To do what you want, you need to stretch to an intermediate bitmap, so the stretch is performed in two steps. Or move to GDI+.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|