|
Can anyone tell me why this might not work on a windows 98 machine.. works fine on most 95, NT and 2000pro machines.. The txt file is not being created by the 98 machine.
//Operation that goes to the url and pulls the source
CString CUserProfileDlg::GetFile(const char *url, const Char *filename)
{
char httpbuff[HTTPBUFLEN];
TCHAR szCause[2048];
CString Cause;
Cause.Format("YES");
TRY
{
CInternetSession mysession;
CStdioFile *remotefile = mysession.OpenURL(url,1,INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_RELOAD);
CFile myfile(filename, CFile::modeCreate|CFile::modeWrite|CFile::typeBinary);
int numbytes;
while (numbytes = remotefile->Read(httpbuff, HTTPBUFLEN))
{
myfile.Write(httpbuff, numbytes);
}
}
CATCH_ALL(error)
{
error->GetErrorMessage(szCause,2046,NULL);
Cause.Format("%s",szCause);
}
END_CATCH_ALL;
return (Cause);
}
//Operation of creating the text file
GetFile(strU+strB+strQ, _T("Source.txt")); //grabing html source
Thanks,
Rob Jones
|
|
|
|
|
Hello,
I am developing an application on WinNT 4.0, sp6 using VC++ sp5 and the application functions normally on that platform. However when I test it on W2k Adv Server, sp2, I notice that some controls "flicker" whenever the mouse cursor "hovers" over some of the controls. Does anyone have any pointers as to where I should begin investigating these strange occurances? Specifically, this flickering effect seems to occur with controls I have embedded in CToolbars and Stingray's Objective Grid, and NOT with controls in CFormViews. Are there specific window messages I should be intercepting with these controls (CComboBox's, CListBox's) so that they do not repaint needlessly?
Any pointers/suggestions are welcome. Thanks.
|
|
|
|
|
Hi,
Iam looking for good DirectDraw tutorial and basic program, which creates window and in fullscreen mode show text.
Thank you for links or program ...
Wizi
libor.bares@seznam.cz
|
|
|
|
|
|
Does any have the problem processing the VK_LEFT\VK_RIGHT key in CDialog?
I was trying to do an animation in dialog which a small bitmap will move around the dialog box when an arrow key is pressed (super mario style ), however I'm having problem processing the arrow keys in the OnKeyDown().
I tried to trace the messages, and it seems the window is getting the the WM_KEYDOWN message when an arrow key is pressed, but it just ignores it!! (No problem with keys like VK_DELETE, VK_END.. etc., tho).
Is there anything special I should know about processing the arrow keys in a dialog box?
Thanks!
|
|
|
|
|
OK, I just found out the answer.
The problem was in the WM_GETDLGCODE. Apparently window dosn't trust anybody but him self to handle the arrow key and tab keys.
What I did was just simply return DLGC_WANTMESSAGE in the the OnGetDlgCode() function. (Thanks, MSDN, for burying this tiny IMPORTANT notice in MILLIONS of articles)
|
|
|
|
|
How can you change the text color based upon a variable, in a Statusbar pane?? I still new at this. The identifiers of the statusbox are private and not reconized by the onctlcolor function. What can I do??? Need help??? Thanks in advance.
Thank-you
Sincerely,
RAH
|
|
|
|
|
i have an owner drawn CListCtrl with a subclassed ownerdrawn CHeaderCtrl.
i can successfully detect the item(s) i want to hide in both the CListCtrl::DrawItem() and
CHeaderCtrl::DrawItem() functions. i simply do not draw then. this is fine except that the
header control still draws the button like appearance of the column that i don't want.
does anyone know how to catch the message that is drawing this before DrawItem() is
called. and if so, what message is it?
am i even doing this right?
scott.
|
|
|
|
|
How I can paste a bitmap which is contain in the clipboard to a file? I really don't know how to do it. Could someone help me? Thank You.
Yours sincerely,
Raymond
Visual C++
|
|
|
|
|
Check out the bitmap saving class added to Code Project last week.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
How I can paste a bitmap which is contain in the clipboard to a file? I really don't know how to do it. Could someone help me? Thank You.
Yours sincerely,
Raymond
Visual C++
|
|
|
|
|
Does any one have an example of exporting records/tables in an access.mdb file to a ascii text file in MFC.
Any help will be greatly appreciated.
ojacksonw@yahoo.com
ojacksonw@yahoo.com
|
|
|
|
|
I've been playing with ADO and it's pretty easy to read them out using ADO and access the records. It would be trivial to then write them to disk.
There are some ADO classes on this site ( not that I used them, but they should explain it better than I can )
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
Thanks for the response. Iwould appreciate any help with the code. I am able to add and delete records using DAO and I need a comma delimited text file to use with another program upon exporting.
thanks
|
|
|
|
|
someone can help me to implement a function that allows users to select a region of the screen with mouse ?
Thank
Leo.
|
|
|
|
|
Hi,
I've got a Dr Watson eachtime I want to print with a program generated on a Win200 machine.
(The programm is created with Windows Installer 1.1)
It use a CPrintDialog.
In the Dr Watson file, there is a Kernel32!RaiseException with a return code = c06D007e
Can someone help me ???
Guitch
|
|
|
|
|
You, or someone else, create a program with Windows Installer that has printing capabilities. I must have missed that day of the class. I think you mean that you are using a program installed via a Windows Installer package. Do other programs have similar errors? Do you have the code for this program?
|
|
|
|
|
Hi,
I'm trying to implement a drag drop within my MFC, MDI based app.
I have a CTreeView derived view, and I've implemented drag drop with it. I want the user to be able to drag treeview items and drop them on another window in my application.
I haven't implemented everything yet, but I'm taking it step by step. Here's what I've done
1. Handled the TreeView notification TVN_BEGINDRAG. Used the TreeCtrl to create a drag image list, done a BeginDrag and a DragEnter, set a member pointer to this window (m_p_wndDragSrc) in my main frame, and then SetCapture() in the main frame, my CMDIFrame derived window...
2. The CMDIFrame window handles WM_MOUSEMOVE to update the imagelist/pointer location.
That much all works fine.
What I want to happen is that when a drag starts, if the cursor is moved over a different child window in the main frame, that window should be brought to the front.
I've tryed code like this in the CMainFrame::OnMouseMove function:
CWnd *p_wndUnderPoint=ChildWindowFromPoint(point);
if (p_wndUnderPoint && (p_wndUnderPoint != this))
p_wndUnderPoint->SetFocus();
Unfortunately, this doesn't do anything. I've tryed all sorts of possible CWnd:: functions, like SetFOcus, BringWindowToTop and so on. But none of them have the desired effect.
Can anyone give me some pointers? (pun. bad one. sorry)
Thanks in advance for your help
Jon
|
|
|
|
|
If you get any answer,Please E-mail to me.
datablader@263.net
Thank you!
|
|
|
|
|
In my formview I've placed a flexgrid. I've also rezised it to fit the window by using WM_SIZE. Because the flex grid is placed on a formview you can see a small border around the flex grid when you run the application. I don't want to see this border. Can anyone please give me an example in how I remove it. I've read that WM_NCPAINT maybe can be useful but I don't know how to use it.
|
|
|
|
|
Hi,
I'm trying to put large text files in rich edit controls but a rich edit only accepts 4K standard.
Somebody able to help me?
Thanks.
|
|
|
|
|
|
I am modifying a project that uses Shell_NotifyIcon to add an application to the system tray. What I want is to prevent the same application running more than once. The project is not using MFC and I would prefer to keep it that way. Is there any way to detect the applications running in the System Tray using the API?
|
|
|
|
|
You could use the ::FindWindow(..)
hope that helps
|
|
|
|
|
You can enumerate the processes on the system, but this works differently for Win 9x and NT systems.
I can dig out some sample code if you need it, as I've used it to detect if a program was running, and if so to wait for it to finish.
Giles
|
|
|
|