|
Hi all, i want to lock a region of a file over the 32bits limit 2GB. With _locking i can't, because it only supports 32bits filesize. Does anyone know how to lock a file in a position greater than 4gb?
Thanks.
|
|
|
|
|
Hello,
Is your file already open? If not, you can open the file with a exclusive lock for the entire file using OF_SHARE_DENY_NONE . See the <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/openfile.asp" rel="nofollow">OpenFile</a>[<a target=_blank title='New Window' rel='nofollow' href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/openfile.asp">^</a>] API.
Hope this helps.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
In Win32; LockFile()
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hi,
Am new to VC++, and am developing a simple software with a dll, and an .exe accessing the functions of this dll.
Am statically loading the DLL into my application,and the log shows the library being loaded successfully. However when I try to execute(debug) the application(.exe), it crashes out by flashing a Developer Studio error message saying: "Could not execute:Path not found(win32 error 3)".
Any advice would be of great help!
Regards,
Adnan
|
|
|
|
|
Spykraft wrote: and an .exe accessing the functions of this dll.
What exactly your DLL do?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
HI,FRIENDS.
I M WORKING ON AN MDI APPLICATION IN WHICH A TOOLBAR HAVING COMBOBOX ON THE SELECTION OF THE ITEM OF COMBOBOX I WANT TO UPDATE DATA OF THE CHILDVIEW .
I TRIED TO CREATE THE OBJECT OF CHILDFRAME INTO CHILDDOC AND IN VIEW GETDOCUMENT FUNCTION CALLED BUT ITS GIVING ASSERTION ERROR.
I TRIED TO MAKE FIEND FUNCTION INTO CHILDFRANE IT DOESNT WORK.
I TRIED TO USE GETDLGITEMID ITS GIVING ASSERTION ERROR .
HELP ME
sourabh jain
patni computers system
|
|
|
|
|
sourabh272318 wrote: ...ON THE SELECTION OF THE ITEM OF COMBOBOX I WANT TO UPDATE DATA OF THE CHILDVIEW .
If I am reading you correctly, you should actually be updating the data in the document, and then let it notify the views that something has changed.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
sourabh272318 wrote: I TRIED TO MAKE FIEND FUNCTION INTO CHILDFRANE IT DOESNT WORK.
so, now the c++ standard defines evil functions ? :->
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Yes you access it using the "satan" keyword as opposed to "friend".
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
sourabh272318 wrote: I TRIED TO MAKE FIEND FUNCTION INTO CHILDFRANE IT DOESNT WORK
How about making Message Handdler in your View class and posting message to it when ever something changed
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hi
sourabh jain
patni computers system
|
|
|
|
|
Use GetParentFrame() .
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hi,
I'm using VS .NET 2003 and CR 8.5 ...
My project type is MFC Dialog-based program and i should display a ADO Recordset query result in viewer activex ...
It's what i've done:
1- I made the Report with Crystal Report 8.5 and with connecting to .mdb database via OLEDB connection ... (it's ok)
2- Then i insert the Viewer Control in my project and also made the ado recordset object with a simple query like this: "select * from some_table where code=1"
3- i wrote below code:
m_RptApp.CreateInstance( "CrystalRuntime.Application" );<br />
m_RptReportInfo = m_RptApp->OpenReport( _bstr_t(_T("rpt\\CompanyInfo_FA.rpt")) );<br />
Line1: m_RptReportInfo->Database->SetDataSource( _variant_t( (IDispatch *)m_pRec, true ) );<br />
m_ReportViewer.put_ReportSource( m_RptReportInfo );<br />
m_ReportViewer.ViewReport();
I tried this code for Line1 too:
m_RptReportInfo->Database->Tables->GetItem( 1 )->SetDataSource( _variant_t( (IDispatch *)m_pRec, true ) );
The Problem:
the problem is the program shows ALL records ... and NOT the filtered recs !!
1- Can u tell me what's wrong with my code ?!
2- ( ADO Question ):
say i have two _RecordsetPtr objects ..
for example: _Rec1, _Rec2 ..
_Recs1 fills by some records (by Open() mehod)
Is there anyway to copy some records from _Rec1 to _Rec2 ?!
for example i want to copy Record (pos) number 3, 10, 16 to _Rec2
( sorry for my english .. )
Regards,
Hadi
|
|
|
|
|
YEP !!!
SOLVED !
|
|
|
|
|
I have a dialog box with id IDD_AGREE_FRAME_ABSTRACTION . This class's all cotrols are populated from the view class using one LoadDetails() function which is implemented inside the dialog class. I have added an edit box to this dialog. But when ever i am creating any variable of type:
1. CString and attaching it to the editbox through class wizard/manually. It's giving me a message "An unsupported operation was attempted". When i click that msg box the application is getting crashed.
2. CEdit then i am getting the message and the application is crashing.
When i am debugging the application the message box is coming in the DoDataExchange i for that particular entry for that editbox control.
I deleted the entry in the DoDataExchange for the control and just tried to set a its text by using GetDldItem(IDC_EDIT_BLDG_AGE)->SetWindowText("biswa") but again the application is crashing.
For all the cases when its crashing it's giving the error as "Unhandled exception in the app.exe(MFC42D.DLL):0x0000005: Access Violation."
I am really surprised why this is happening for this dialog where as for other dialog there is no problem when i do the same. Also when i am removing the the DDX_Text entry for the control causing the problem the whole application is running fine.
Please help me on this. This is really important for me. If you need any more information then just tell me i can give you the detail history for this.
|
|
|
|
|
|
When the dialog is created in the view class it calls the DoDataExchange function and when it excutes the line
DDX_Text(pDX,IDC_EDIT_BUILDING_AGE,m_BuildingAge) it crashes and when i remove the entry it works fine. Also as i said when directly try to access by it using GetDlgItem then also it crashes.
One more thing i want to say this class was not visible when opened the class wizard. So i deleted the .clw file and agained opened it. That class was then visible but when i selected that i got parsing error for one of entries of DoDataExchange function that is DDX_Dollar(.....). That is why i added entry for this control manually.
|
|
|
|
|
just try the follow this may be reason....
in resourse.h
IDC_EDIT_BUILDING_AGE is defined right. it has some value say 1234
check there should not any other defined with the same value 1234.
just check it. as a one of the reasons.
Regards
Anil
|
|
|
|
|
When does LoadDetails() get called?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
The LoadDetail() is called in the OnUpdate() of the view class.
|
|
|
|
|
BiswaR wrote:
The LoadDetail() is called in the OnUpdate() of the view class.
Before or after the dialog's DoModal() method is called?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hi!
Does somebody know, how to to open notepad.exe?
In the opened notepad's page, the user should be able to write, save and close the file.
Would be great, if somebody could help me with this problem.
|
|
|
|
|
|
Hi!
Thanks, that was a big help.
Maybe you can tell me, too, how to insert text of a CString-object in the already opened notepad-File? Or do I have to do this at the same time and if yes: how?
With best regards,
Hanno
|
|
|
|
|
I don't know if this is possible. However, what you could to is first, save your text into a text file, then open this file in notepad with ShellExecute.
But, why exactly do you want to have such a thing ? Maybe there is another solution that is better.
|
|
|
|