Can't convert unsigned int to void * error message

Dear :
i have the following code :

CStdioFile file("C:\\report.txt",CFile::modeCreate | CFile::modeWrite);
file.WriteString("My infor");
SetFilePointer(file.m_hFile,NULL,NULL,FILE_END);// the Compiler issued error
said : E:\Private\Files\Dlg.cpp(321) : error C2664: 'SetFilePointer' :
cannot convert parameter 1 from 'unsigned int' to 'void *'
file.close();

Why? this error generated in Visual Stdion 6 , the same code implemented in
Visual Stdio 7 (Visual C++.NET ) run without errors .!!!!!
what cause the problem?

Regards


0
10/12/2004 2:02:32 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
855 Views

Similar Articles

[PageSpeed] 18

Raed Sawalha wrote:

>Dear :
>i have the following code :
>
>CStdioFile file("C:\\report.txt",CFile::modeCreate | CFile::modeWrite);
>file.WriteString("My infor");
>SetFilePointer(file.m_hFile,NULL,NULL,FILE_END);// the Compiler issued error
>said : E:\Private\Files\Dlg.cpp(321) : error C2664: 'SetFilePointer' :
>cannot convert parameter 1 from 'unsigned int' to 'void *'
>file.close();
>
>Why? this error generated in Visual Stdion 6 , the same code implemented in
>Visual Stdio 7 (Visual C++.NET ) run without errors .!!!!!
>what cause the problem?

The type of CFile::m_hFile is UINT in VC6 and HANDLE in VC7, and the type
"HANDLE" is just a typedef for void*. Note that you probably shouldn't be
calling SetFilePointer on CStdioFile, as it can throw off the buffering. You
probably should use the Seek member.

-- 
Doug Harrison
Microsoft MVP - Visual C++
0
dsh (2498)
10/12/2004 2:58:39 PM
Reply:

Similar Artilces:

How to Convert UTC to localTIme(C# )
I have got the value of user account's lastlogon time. Its type is Int64. This value is stored as a large integer that represents the number of 100 nanosecond intervals since January 1, 1601 (UTC)(Refer to MSDN). I don't know how to convert this value to localTime. The following is my code. ################################################################ DirectoryEntry deUser = new DirectoryEntry(ldappath); DirectorySearcher src = new DirectorySearcher(deUser); src.Filter = "(&(objectClass=user)(SAMAccountName=" + accountNa...

IE8 will not come up, only get error
I am using windows XP 64x. When I access my IE8 32 bit it will start to load the home page and immediatly show an error that it needs to close. It started acting odd, page change but still old address and slow, and then the fail to load. Also, I am getting a Google Installer error that says it needs to shut down. This will come up several times. IE 8 64x works fine. I ran a Malwarebytes and Adware program, and 2 different virus checks Any suggestion on repair or reload? I am not very good with computer terms , so any easy to understand help would be greatly appreciated...

Exchange 2000 SP3 Errors
Big problems everyone. We could use a little help. While attempting to perform a Windows 2k ---> 2003 / Exchange 2000 --- > 2003 migration, we are seeing the following: EVENT ID: Date: 4/16/2007 Source: MSExchangeIS Time: 19:14 Category: Connections Type: Error Event ID: 1021 User: N/A Computer: EX1 NT AUTHORITY/SYSTEM was unable to connect as /o=Organization/ou=Site/ cn=Configuration/cn=Servers/cn=EX1/cn=Microsoft System Attendant. Error 0x80040111. For more information, click http://www.microsoft.com/contentredirect.asp. We are unable to move mailboxes b...

how to convert date
Hi, I'm looking for some method to convert mail date, in format: eg. "Sun, 18 Sep 2005 20:57:08 +0200", to computer local time. I tried CTime but without resoults. m. Have you tried COleDateTime::ParseDateTime()? m.wski21.usunto@aust.com wrote: > Hi, > > I'm looking for some method to convert mail date, in format: > eg. "Sun, 18 Sep 2005 20:57:08 +0200", to computer local time. > I tried CTime but without resoults. > > m. >I'm looking for some method to convert mail date, in format: >eg. "Sun, 18 Sep 2005 20:57:08 +0200&qu...

Duplicate Messages #4
I've suddenly started receiving duplicate messages from one of the listservs to which I subscribe. I have rules set up on Outlook 2000 to send messages from the group to a particular folder. Now one copy goes there and a second copy turns up in my general Inbox. Other subscribers are not receiving doubles, so the problem seems to be at my end. Any idea what could cause this? ...

Convert text to time value
I have a series of time values in a 'General' format. They are of the type: 184525 Which is 18:45:25 or 6:45:25 pm. A time which is am would be of the type: 12345 Which is 1:23:45 am. Is there a way to convert those 'General' values to an Excel serial so that I can figure out the difference between two times? I've seen a bunch of examples on the net, but none of those that I have found deal with this format that I can tell. Thanks. Hi try =--TEXT(A1,"00:00:00") -- Regards Frank Kabel Frankfurt, Germany "Andy" <amelton@gmail.com> schrieb...

How do I convert dates to text keeping the format?
I'm trying to convert a column of data in date format *m/d/yyyy to a text format without converting to serial numbers. Ie: I want to retain the mm/dd/yyyy format. Is there a way to do this? =TEXT(A1,"MM/DD"/YYYY") "sprlarry" <sprlarry@discussions.microsoft.com> wrote in message news:69669AA6-FD15-47D7-843D-FC768728BF7A@microsoft.com... > I'm trying to convert a column of data in date format *m/d/yyyy to a text > format without converting to serial numbers. Ie: I want to retain the > mm/dd/yyyy format. Is there a way to do this? That ...

Excel: Auto converting text to numbers
I am downloading an Excel sheet, and the numbers come in as text. It basically comes in as "33 %" but Excel registers this as text, not a percentage. I have a cell that will be used to add the numbers, but since they are text it doesn't work. Given this information, is there a way to convert the imported data into numbers. I would prefer to include this into my formula. The potential numbers are: 0, 1, 2, 3, 4, 0 %, 25 %, 33 %, 50 %, 67 %, 75 %, 100 %, and N/A I would prefer a function, again if possible, that could convert any number. Please note, the space between the nu...

MFG 8.0 Error
I recently upgraded from ver 7.5 to 8.0 on our test server, but now I'm getting the error: "A count records operation on table MFGxxxList failed accessing SQL data" whenever I select any of the Manufacturing Lists. xxx represents the specific view e.g. MFGBOMList I think this may be a bug as when I try to view the records of the view MFGBOMList (BOMV1000) I get the same error as when I drill into the details. Has anyone else experienced this error and found solution? A problem has been identified in environments with more languages than en-us installed. This issue ...

Weird import error
I often import files that have .com & .org in addresses in the text. For some reason, the import usually drops the last "m" or "g" in the import process. Any idea why? It's been going on for quite a while, at least since Pub 2003, I just never got around to trying to figure out or ask why it would do that! I just circle it during proofreading (which I do on paper) & change it when I tune up the publication before finalizing it. Thanks. bj ...

how to convert excel's .cvf file to .csv file
...

error in outlook
I was wondering if any body is had an issue with oulook regarding the following error "OUTLOOK IS OUT OF SYSTEM RESOURCES", following by a Dr. Watson error. Dr. Watson error OUTLOOK.exe Exception: access violation (0x0000005), Address: 0x04c9bb30 The system is a NT box with 10GB HD, 128MB RAM and 433MHz cpu. This error ocurrs evey now and then it is not constantly happning. Usually is whil working in outlook. I hope some-one can help me. Thanks ...

OutLook 2003 SP1
Dear all, I've a problem with my medium-sized PST (1.1Gb, local hard drive). When I try to move message from this PST to another local PST (old_messages_04) I got this error message: "Can't move the items. The item could not be moved. It was either already moved or deleted, or access was denied". ScanDisk corrected some issue on PST files, and I already ran SCANPST.exe, but I got the same error. Could you help me? Did you've any site/links to follow? I altrady tried to look for help on internet unsuccesfully. Any help will be appreciated. Thanks a lot in advance ...

Error installing Extender.
Hi, When I try to install Extender on a machine, I receive the following error: "The required configuration information necessary for installing could not be found on this machine" I have GP 8.0 sp3, Latin American version. Any Idea?? I don´t know what need to check... -- Evelin. Ana - just a guess, but are you logged in as Administrator? Perhaps it's a issue with user rights to access/edit the registry. Brenner @ (www.KlenzmanConsulting.com) "Ana Evelin Rosa" wrote: > Hi, > > When I try to install Extender on a machine, I receive the following...

Convert Access97 to 2000
Hello, we're currently running access97 and would like to convert it to 2000, but we don't know what is the administrator password for this database. Also this database is running on multi user and have difference permission for diffence users. Could someone help me how to do make this happen but keep the currently permission retaint. Thanks ...

Chart Errors
I have created a chart using 100% stacked columns. I want my values to show the % each value contributes to a total. I.E. Overage, Current Collections and Total Goal. The chart looks great; however, whenever I update my current collections, the percentage doesn't calculate correctly. The chart seems to be adding all values together to come up with the percentage need and the goal doesn't seem to shrink. Any ideas? Are Overage, Current collections and Total Goal stacked on top of one another. If so, the % calculated would be based on the total of all three. "Scacci...

Your message was deleted without being read.
This option was available with exchange 5.5 and earlier outlook clients. Today, we are running exchange 2003 ee server along with outlook 2002 clients. Is there any way to tell if a global message is being deleted by users without being read without turing on the "read receipt" in tracking options? All I want to do is tell which users are deleting the messages internally. Thanks. mike No. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx &qu...

Error 800a03ea on winserver 2008?
I have a set of older .asp files that have been running uneventfully for several years on our old web server, but now as part of our testing on a new web server which has Windows Server 2008, I've discovered that the programs are NOT working, but rather throwing a syntax error 800a03ea on the very first code line, with the pointer at the "F" in function, in the include file the .asp progs bring in. My first guess is that because ws2008 is so much more stringent in security etc, something needs to be changed in my code, but then I found this on a board: "There is ...

Convert 2000 Calendar to web page
Greetings, When I convert my calendar for 2005 to a webpage, the page is off by 1 day. Is there a template or fix available to fix this? Thanks, Duane I can edit the html file but this should not be the case. Fixes? Suggestions...other than use Apple? "Duane Perry" <dlp_sr@yahoo.com> wrote in message news:yZRtd.5561$0r.1710@newsread1.news.pas.earthlink.net... > Greetings, > > When I convert my calendar for 2005 to a webpage, the page is off by 1 day. > Is there a template or fix available to fix this? > > Thanks, > > Duane > > Duane, ...

Dose SetWindowText() cause WM_PAINT message?
hi, all SetWindowText() will send WM_SETTEXT. It seems no WM_PAINT message follows. I have a class, like CMyStatic: public CStatic ......... OnPaint() ........ When I call myStaic.SetWindowText(....). OnPaint() is not called. The text is changed, but I also want to change some background,color,font ..... Does anyone know why? Thanks "Nicky" <Nicky@discussions.microsoft.com> wrote in message news:27D54057-AF3B-4081-B4FC-FEF2ACBF4E0D@microsoft.com... > hi, all > > SetWindowText() will send WM_SETTEXT. It seems no WM_PAINT message follows. > I have a class, like &...

XML Note convert to DataSet
Hello, I have this function: object acmResponse = acmLogin.acmString("4001", "", paramFormLogin + paramUserBasics);System.Xml.XmlNode[] acmNodes = (System.Xml.XmlNode[])acmResponse; What I have todo, to convert the XML Object in the DataSet Object? Thank you Matthias ...

Unread Messages #7
Every year, my outlook goes nuts and all my folders in my favorites folders disappear and are replaced with archived files. I have to reorganize it. I have done so again but I used to have a file for unread messages but I can't find it. I thought it might be in the search folders in the "all mail folders" but it's not there. This is a really handy folder that I use often. Can someone tell me how to relocate it? Thanks. File-> New-> Search Folder -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ ...

Downloading messages
Running OL2003 SP1 (sans French grammar checker) with pst file about 1GB. Had an old POP3 account that I needed to retrieve messages on, but unfortunately that POP3 also contained 400 messages, all spam but for 20. I really needed just 20 messages from this mailbox, so setup profile to download messages. The "Leave messages on the Server" was NOT ticked. After several hours of downloads, the same messages were being received over and over, but the dates and times changed, it looked as if the messages were never ending! The dates and times were from a few months back. When I re...

Convert
Is it possible to convert a Money file created in the USA version to that of the UK version? Thanks in advance The general way is QIF Export then Import. It's involved and has limitations like loan accounts don't QIF. See http://www.bollar.org/msmoney/#Q1. "Crispy" <nowayspammers@hotmail.com> wrote in message news:uQKSfzfyDHA.2500@TK2MSFTNGP09.phx.gbl... > Is it possible to convert a Money file created in the USA version to that of > the UK version? ...

Problem converting from Quicken to M2005
My Quicken files are mostly investment related, and generally converted fine. However all bonds (regular and muni's) converted as Investment type: Mutual Fund, not Bond. (1) How do I prevent that, (2) How do you change the Investment Type for an item? Thank you. In microsoft.public.money, Mike wrote: >My Quicken files are mostly investment related, and generally >converted fine. However all bonds (regular and muni's) converted as >Investment type: Mutual Fund, not Bond. (1) How do I prevent that, (2) Money typically converts custom data types from Quicken into funds. I thou...