|
hi,
i want to know how to access some part of data in excel sheet and copy to text file using pure c++.....please send me a code if u know this.....
|
|
|
|
|
I have code that do that, but is in MFC, is good for you ?
|
|
|
|
|
Here at CodeProject we have an article on such topic: "Accessing Excel Spreadsheets via C++"[^]. It uses ATL and COM , I don't know if you include those libraries into the 'pure C++ world'.
Veni, vidi, vici.
|
|
|
|
|
You may use different methods to read Excel files. Which one to use depends on the version of the Excel files (XLS and/or XLSX) and if Excel is installed or not:
- Using
Excel Automation (COM / OLE Dispatch) with the Excel type library. This requires an installed Excel on the machine running your application (which defines what Excel file versions can be read) and the Excel type library on the development machine. - Using
ODBC or ADO (OLE DB ). These are database interfaces that handle sheets from Excel files like databases tables. Drivers for XLS files are present on all Windows systems. Drivers for XLSX files are installed by Office 2007 or with the 'Microsoft Access Database Engine 2010 Redistributable' package. - Using a library. Examples are the ExcelFormat Library[^] here at CodeProject and the commercial LibXL[^] library.
Once you have decided which method you want to use, search for samples here at CP and in the web using the above keywords. But be prepared that reading Excel files is not done with a few lines of codes.
|
|
|
|
|
Dear coders, for few days, I struggle to solve a simple problem: to scroll the window after zooming, in such a way, that mouse position stay in the exactly same logical position ... and I didn't succeded.
The view is based on CScrollView, mapping mode is always MM_TEXT, zomming is changing by 10%. Nothing special.
Have you see how Window Photo Viewer (from Windows 7) work on zooming ? I want to implement the same behaviour ... does anybody do that before ? Anybody have similar code ?
modified 19-Nov-12 4:19am.
|
|
|
|
|
|
Is it possible to write precommit hooks for svn in c/c++?
If so how to write a hook which will ask the user to update document version everytime the user checks in the document in svn. My knowledge is limited to the fact that the .exe to be created should be named Precommit and be placed in the repository where the user performs any action in repository.Please guide me.
|
|
|
|
|
SVN will automatically update the version when the document is checked in. It also provides a user API that you can interface with. See here[^] for further information.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hello Mukul,
I found this online source to be quite illuminating. Take a look at it. Hopefull you willl find it both helpful and beneficial.
"http://stackoverflow.com/questions/9773678/how-to-write-a-svn-hook-script"
Best of Luck,
Happy Reading,
With Kinds Regards,
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:38am.
|
|
|
|
|
I didn't find any useful code online for implementing the RealTime scheduler in c++. is there anyone can help provide ? Thanks advance!
|
|
|
|
|
|
Hi All,
Can you please tell me, what all the things i need to take care when i am trying to port my device driver 32 bit to windows 7 64 bit?
|
|
|
|
|
Googling with following phases seems to turn up results.
how to convert from 32bit to 64bit windows 7
gotchas converting from 32bit to 64bit windows 7
tutorial converting from 32bit to 64bit windows 7
converting 32bit to 64bit windows 7 site:codeproject.com
Last of those turned up the following (could be more.)
Lessons on development of 64-bit C/C++ applications[^]
|
|
|
|
|
...except this is a driver, not an app...
|
|
|
|
|
|
Thanks for the reply.
In our case we have a different types of data types used in the app(ie UINT8,UINT16,UINT32) and the different types of pointers(ie PUINT8,PUINT16,PUINT32).Here do i need to change the types to 64 or not?Because i am getting the crashes in the driver driver in different places.
|
|
|
|
|
Yea. You must.
Be careful when performing unsigned and signed operations. Consider the following:
ULONG x;
LONG y;
LONG *pVar1;
LONG *pVar2;
pVar2 = pVar1 + y * (x - 1);
The problem arises because x is unsigned, which makes the entire expression unsigned. This works fine unless y is negative.
In this case, y is converted to an unsigned value, the expression is evaluated using 32-bit precision, scaled, and added to pVar1.
On 64-bit Windows, this 32-bit unsigned negative number becomes a large 64-bit positive number, which gives the wrong result.
To fix this problem, declare x as a signed value or explicitly typecast it to LONG in the expression.
|
|
|
|
|
Thanks for the reply,
in case of pointers for eg PUINT8 OR PUINT16 do i need to change the datatypes to PUINT32 or PUINT64?
and for normal variables UINT8 OR UINT16 do i need to change the datatypes to UINT32 or UINT64?
if not in which cases i have to change the data types.
I am totally new to the drivers programming,Please suggest me some links.
|
|
|
|
|
|
Use size_t types pretty much every where.
|
|
|
|
|
How to check memory usage with in the application by itself?
|
|
|
|
|
On what operating system? If you want to keep track of total memory usage, you'll need a way to determine the size in memory of all code (e.g. application and dynamically linked libraries) and stack, which will vary depending on OS.
For dynamic heap memory usage, you can make your own implementation of new/delete that counts allocated heap memory - this is the approach taken by memory leak detectors. Have a look at VLD which is an open-source memory leak detector for Visual C++.
|
|
|
|
|
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
CString csMsg;
PROCESS_MEMORY_COUNTERS_EX procMemInfo = {0};
procMemInfo.cb = sizeof(procMemInfo);
if (GetProcessMemoryInfo(GetCurrentProcess(), (PROCESS_MEMORY_COUNTERS*)&procMemInfo, sizeof(procMemInfo)))
{
if (procMemInfo.PagefileUsage==0)
procMemInfo.PagefileUsage = procMemInfo.PrivateUsage;
ULONG ulWorkingSetSize = (ULONG)(procMemInfo.WorkingSetSize / 1024 / 1024);
ULONG ulPagefileUsage = (ULONG)(procMemInfo.PagefileUsage / 1024 / 1024);
CString csProcessMemInfo;
csProcessMemInfo.Format(_T("WorkingSetSize=%lu MBytes, CommitChargeSize=%lu MBytes"), ulWorkingSetSize, ulPagefileUsage);
csMsg += csProcessMemInfo;
}
MEMORYSTATUSEX memStatus = {0};
memStatus.dwLength = sizeof(memStatus);
if (GlobalMemoryStatusEx(&memStatus))
{
ULONG ulUsedVirtual = (ULONG)((memStatus.ullTotalVirtual-memStatus.ullAvailVirtual) / 1024 / 1024);
ULONG ulAvailVirtual = (ULONG)(memStatus.ullAvailVirtual / 1024 / 1024);
CString csMemStatus;
csMemStatus.Format(_T("UsedVirtual=%lu MBytes, AvailableVirtual=%lu MBytes"), ulUsedVirtual, ulAvailVirtual);
csMsg += csMemStatus;
}
|
|
|
|
|
Use the API GetProcessMemoryInfo()
|
|
|
|