|
I don't know the mode the os used. How can I find out? The file I want to read is a sql server transaction log file. I know that this is possible as I have seen products that will do this, I just don't know how. I have only tried to open the file with c#'s System.IO binary reader for now. I haven't looked at c++ yet. I figured that I would though.
|
|
|
|
|
If you are using CFile then use: modeRead | shareDenyNone. This will work if the file isn't opened for shareDenyNone access. This is what I do in ED (see sig). You may want to see if you can open the file using ED. It should open in "view" mode.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Thanks everyone. It did open in ED. So I will try to open it with cfile.
|
|
|
|
|
jspano wrote:
It did open in ED. So I will try to open it with cfile
You don't need to use CFile. All of the file open functions support the same options.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Thanks. Can you suggest the one that is most optimal for performance? The best solution would be to open the file and somehow put the bytes into a managed FileStream or ByteReader etc in .Net.
|
|
|
|
|
Sorry but I'm not using .Net. If you are only interested in reading the file then I'd like at using a simple memory mapped file. It will also depend on what you want to do with the file, how big it can be etc. Do you need fast random acces to lines within the file etc.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
basically I would need to read from start to finish the whole file into memory. This might not work always though, since the files could be huge. Up to say 100megs or more. What techniques do programs like your or word do for large files? as the user scrolls around go get more data?
Thanks
|
|
|
|
|
ED uses a propriety database style system where it has instant access to any line and lines can grow or shrink, be deleted or inserted as required (ie. be edited).
If you just need to read the file then I'd definitely use a memory mapped file (mmf). You could build a simple STL vector<> with pointers to the start of each line. Have a look at the article here on CP on PugXML where you will see code I've added to read the XML file using mmf.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
I am not sure if you know that it is in fact locked by the OS (I assume you realy do not know). Try opening it with FILE_SHARE_READ. There are very few instances when you will be denied this access, the main reason is for security on WinNT/Win2000/WinxP. Of course if this is not a system level (kernal-level) file then there is a very good possiblity that the program that has it open is greedy and does not want to share reading privaliges why it has the file open.
At the minimum, give Me/Us a code snippet of how you are atempting to open the file.
Trust in the code Luke. Yea right!
|
|
|
|
|
Hi, I am deploying the application for our client. I am able to create setup.exe to copy required files and registering the DLLs using InstallShield for VC++ 6. But the application also requires a DSN. How can I add the Oracle odbc driver and define the DSN in setup.exe?
-Elizabeth
Eilzabeth
|
|
|
|
|
Lokks like you need to create DSN when you "setup". You know you can create DSN in application. Do you? In my Opinion, Create DSN is the job for IT people of client.
|
|
|
|
|
Ideally, I would like the application (or setup.exe) to install ODBC manager (if not there) and the ODBC driver and configure the DSN all in one place. I tried
SQLManageDataSources(this);
in the CWinApp class to open up the ODBC Data Source Admin dialog but got an error message saying "undelared identifier".
-Elizabeth
Eilzabeth
|
|
|
|
|
Ok, ive just created a CDC for the screen, done a little drawing, but want to get rid of my drawing...is it possible to inform a region/rect of the screen that it should repaint?
| Website: http://www.onyeyiri.co.uk
| Sonork: 100.21142 : TheEclypse
| "If a dolar was a chicken would the chicken be evil?"
|
|
|
|
|
One solution is InvalidateRect().
Kuphryn
|
|
|
|
|
thanks, works great
| Website: http://www.onyeyiri.co.uk
| Sonork: 100.21142 : TheEclypse
| "If a dolar was a chicken would the chicken be evil?"
|
|
|
|
|
see: InvalidateRect, RedrawWindow
|
|
|
|
|
I was looking for a way to determine if one polygon is contained in another. I need it to work with float points (instead of integers). I need this to be fast, so a system api would be great.
I've looked at the CRgn class, but it is integer based. I've looked at some of the openGL glu methods, but my lack of familiarity with them has led to much confusion.
Is there some api out there that does this? Of am I going to have to re-invent this wheel?
Thanks in advance!
shao_lo@eudoramail.com
|
|
|
|
|
You can use CRgn::CombineRgn and not have to worry about floats or ints. Just create two regions that represent the polygons. Let's say that rgnInner is the region that should be contained within rgnOuter. Then create a third region using CombineRgn(&rgnInner, &rgnOuter, RGN_DIFF). This gives you the region consisting of the areas of rgnInner that are not contained in rgnOuter. If the return value is NULLREGION, that means that rgnInner is fully contained within rgnOuter.
|
|
|
|
|
There is no API for doing what you want that I know of and if there is please (please) let me know. The one reply I saw to your inqirey looked more like clipping one region to another region. But according to your qestion you want to determine if one polygon is in-side of anouther polygon. I do not know of any algorithm that can solve your problem.
Trust in the code Luke. Yea right!
|
|
|
|
|
Hello,
whats the difference between unlink and remove ?
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
The end result appears to be the same. remove() did mention something about ANSI, however.
|
|
|
|
|
unlink() is the POSIX standard function for file deletion, remove() is the ANSI C function. They may behave differently on directories.
|
|
|
|
|
I've been working on a little app for use with wireless keyboards that don't have num/cap/scroll lock lights. It's just a small app that always sits on top and tells you if any of those locks are on.
I've implemented a global hook ok for the keyboard and the application can recieve messages from the hook when it has and hasn't got focus. The problem I'm having is I want it to update 3 little icons in CStatic controls on the app that represent cap/num/scroll lock. This works fine when the app has focus but when it loses focus it no longer repaints the icons. The app is still getting the messages because It can display a messagebox for me but it's just not updating the icons.
I've looked though the MSDN I've used loads of functions to force the redraw but nothing seems to work. I've probably just missed the easyest one that works so any sujecstions will be great.
Thanks
Darren
|
|
|
|
|
Call Invalidate() and see if that forces a repaint.
Kuphryn
|
|
|
|
|
You'll probably have to do UpdateWindow() too.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|