|
|
dSolariuM wrote: I want to use __asm int 21h in the visual c++
What is that you want to do with that DOS interrupt? what service are you trying to use?
Windows has pretty much all the APIs that you could do with DOS interrupt 21h, Try that intead.
-Prakash
|
|
|
|
|
Are you running MSDOS? If not, you won't have much luck with INT21
We've moved beyond character mode screens and simple little disk structs.
Learn Win32 API
|
|
|
|
|
HI,
I need to read .doc,.xls,.pdf etc... file and then encrypt/decrypt the same but I am not able to read the file properly using CFile object.
How to read these files? what are the functions to read the same?
Any example if possible. I am not using Doc/View architecure. I am developing MFC Dialog based application.
Your help and time is much appreciated.
Thanks & Best Regards,
Mahesh
|
|
|
|
|
they are not text files, they are binary files, so, if you use fscanf() , cin or such basic functions, you'll get "strange" data.
search for any api provided with Office...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
Amarelia wrote: ...but I am not able to read the file properly using CFile object.
Why not?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
Hi,
Thanks for the reply,
I do it the following way...
CStdioFile fileToRead;
char * StringBlock = new char[64000];
fileToRead.Open(sCurrPath, CFile::modeRead | CFile::typeBinary, &feError);
nBytesRead = fileToRead.Read((unsigned short *)StringBlock, 60000);
The value of nBytesRead = 60000 after the last statement executes, but the StringBlock contains only few junk characters only. May be it encounters NULL or something like that which truncates it to only few chars. According to this the function reads the file correctly but the problem is in storing the data. I want to read maximum data possible at one go for the sake of my app's speed .
Please give appropriate solution.
Best regards and Thanks,
Mahesh
|
|
|
|
|
If the Read() tells you that it did read 60000 bytes, then that's the truth.
Your current problem is to display those bytes. Since most word processing files (all of them) contains a lot of binary information, your buffer is bound to have a lot of '\0'-chars.
Just trust nBytesRead.
|
|
|
|
|
You can get text from MS Office files by using COM, but this requires office installed.
Next, on new systems you can check IFilter interface - system uses it to index office files.
Finaly, you can use third party libraries. I can recommend http://www.wordcnv.com[^] - their libraries are very fast and support is the simply the best I have seen.
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
|
Hi,
i guess you need to go through automation please see any standard MFC book and you can sail through easily,reading of excelfile is most time consuming if they have large data ,if posible convert them to CSV ( if you can ) and then parse them as you do on a text file . actually you can convert all the above formats to text format and parse ,for that you need to CreateDispatch on the respective application object and ask them to save the coressponding data in text formats .
Regards,
FarPointer
|
|
|
|
|
I don't want to work with any afx_msg, I just want to test if the mouse button is clicked in the moment, something like if(GetKeyState(VK_SHIFT)&0x8000) function, but this is for keyboard using.
How can J do that,
Thank you
|
|
|
|
|
ZaebanB wrote: I just want to test if the mouse button is clicked in the moment...
Have you considered the WM_LBUTTONDOWN message?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
No, J don't want to catch any message.
|
|
|
|
|
Use GetAsyncKeyState .
Steve
|
|
|
|
|
|
I have two large projects, both containing exactly the same code, under Visual Studio 2005. One of the projects is under Source Safe and one is not. In the one that is not under Source Safe, Class View works fine. I can scroll the long list of classes, and when I select one, I can scroll the long list of members of that class. In the identical but Source Safe-controlled project, both the class list and the member list get redrawn about once per second, FOREVER. Literally hours after opening the IDE, they still flash. It is impossible to scroll either list because if you do, on the next redraw (after one second), it will scroll back to the top. The flashing stops if you display a context menu, but resumes when you dismiss it.
This makes class view totally useless. Any clue how I can fix this? I'm not saying that Source Safe is the cause, only that that and the fact that the one under Source Safe was migrated from VS7 and the one not under Source Safe was created with VS8 are the only differences between these two projects.
[Added later]
I see now that if I disconnect the flashing one from Source Safe, Class View stops flashing. But I don't want to work disconnected. My Source Safe archive is on a network share that is connected, so there are no troubles accessing it.
-- modified at 9:14 Thursday 19th January, 2006
|
|
|
|
|
I want an mfc app to start autometically just after booting. which way can i do that other than saving the .exe in startup?
|
|
|
|
|
place it in the startup menu, or in the relative registry key.
there are some answers for this problem on the articles of the site.
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
i want to know some other way than placing it in the start up... is there any?
|
|
|
|
|
|
put your app path here in the registry
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
-Prakash
|
|
|
|
|
|
So why not put a shortcut to your app in the Startup folder, rather than the app itself?
Shraddhan
|
|
|
|
|
How to read an ascii matrix from file?
The bigger problem is that I don't know the columns and rows number.
So I have to read the data (fscanf) but at the same time I have to catch the carriage-return (but fscanf can't help me!!)
Another question:
I have a function, for this, that works well but only with known matrix dimension;
it use fscanf and FILE object. Is possible to do the same using CFile and/or CString? (i.e. there is a cast from CFile to FILE?)
Thanks
Have a nice code day
|
|
|
|