|
It is not simple, I found this Java Lib to do this, but I never used it before
http://jakarta.apache.org/poi/hssf/how-to.html
Russell
|
|
|
|
|
I guess it can be done easily bu excel object library
|
|
|
|
|
Yes, of course. But I don't know how. It could be that other lenguages offers some shortcuts.
Probally it is also possible to prepare a macro to save the file as CVS format and then call it from the program...but again: I don't know how. It is onlyu an idea
Russell
|
|
|
|
|
Here is code snippet that I've written recenlty:
<br />
private void savetoexcelformat(string currentpath, string pathtosave)<br />
{<br />
object missing = System.Reflection.Missing.Value;<br />
<br />
Excel.Application app = new Excel.Application();<br />
app.Visible = false;<br />
<br />
app.Workbooks.OpenXML(currentpath, missing,missing).SaveAs(pathtosave, Excel.XlFileFormat.xlWorkbookNormal, missing, missing,<br />
missing, missing, Excel.XlSaveAsAccessMode.xlNoChange, missing, missing, missing, missing, missing);<br />
app.Quit();<br />
<br />
}
Just change Excel.XlFileFormat.xlWorkbookNormal to the format you need Also you will need to open your file by calling Open() function and passing necessary parameters. My file was in xml format of excel that's why I used OpenXML
|
|
|
|
|
wow...then it looks very easy!
Now I'm curious...I wnat to try.
Russell
|
|
|
|
|
Indeed it is
|
|
|
|
|
Did you want a .NET C++ solution ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Yes, it was my intention to establish that he was probably in the wrong forum
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I don't recommend you use the Office Interop for this, as the end user may not have Office installed on their machine. You can use the OLEDB provider to load the excel spreadsheet into a DataTable . Once it is loaded into the table, create a FileStream and iterate through the datatable. Iterate through the DataTable and use a StringBuilder to add the columns to a string, and sepereate the fields by a comma. Once you get to the end of each row, write them to the file. When creating the file, make it "myFile.csv," and you will be able to load it into Excel, and it will be in a spreatsheet like you wanted. Hope that is what you are looking for. Also, DON'T CROSS-POST!!!!!!!!
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
hello,
I want to called methods from another Form of the principal form
I try this exemple in the URL but a lot of errors
http://dotnet.developpez.com/faq/cppcli/?page=WinForms#crossinclude
error C2653: 'Form1' : is not a class or namespace name 6
error C2065: 'currForm2' : undeclared identifier 8
error C2061: syntax error : identifier 'Form2' 8
error C2653: 'Form1' : is not a class or namespace name 11
error C2227: left of '->Show' must point to class/struct/union/generic type 13
why it does not work ??????????
thanks,
aef
|
|
|
|
|
I don't read French and I can't find where you code is on that page. But, it looks to me like you're using the name of the class instead of the name of a class instance, to try to call an instance method. This obviously does not work, I recommend you do some reading on how object orientated code works. In the meantime, you need a class instance, in order to call methods. You can have more than one instance of the Form1 class, and you need to know which instance you are trying to show, otherwise, you can't do it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello;
its impossible in C++/CLI ?????
can I use a globale variable in all form ??????
Thanks
-- modified at 13:10 Monday 20th August, 2007
aef
|
|
|
|
|
hello and sorry for my bad english!
i have written a windows driver to hide processes per DKOM (direct kernel object manipulation) with the help of the book "rootkits - Subverting the Windows Kernel".
a short description of the concept can be found on
http://www.rohitab.com/discuss/lofiversion/index.php/t23880.html
under xp sp2
------------
in the taskmanager the idle process has the pid 0, but in the kernel object EPROCESS the idle process has the pid 2153092480 and the name "ÿÿÿÿ" which should be a empty string.
output of the driver per DbgPrint
FLINK_OFFSET: 0x88, PID_OFFSET: 0x84, NAME_OFFSET: 0x174
0 - PID: 1832, Name: senddrv.exe
1 - PID: 2153092480, Name: ÿÿÿÿ
2 - PID: 1980, Name: procexp.exe
3 - PID: 984, Name: firefox.exe
4 - PID: 860, Name: regedit.exe
5 - PID: 624, Name: notepad.exe
6 - PID: 1708, Name: cmd.exe
7 - PID: 1496, Name: cmd.exe
8 - PID: 480, Name: notepad++.exe
9 - PID: 1520, Name: notepad++.exe
10 - PID: 1500, Name: taskmgr.exe
in this output many processes are hidden because before i test my driver
under win2000 sp4
-----------------
under win2000 the output is ok!
the idle process has the pid 0 and a empty string! so all ok!
FLINK_OFFSET: 0xA0, PID_OFFSET: 0x9C, NAME_OFFSET: 0x1FC
0 - PID: 1164, Name: senddrv.exe
1 - PID: 0, Name:
2 - PID: 8, Name: System
3 - PID: 180, Name: smss.exe
4 - PID: 208, Name: csrss.exe
5 - PID: 228, Name: winlogon.exe
6 - PID: 256, Name: services.exe
7 - PID: 268, Name: savedump.exe
8 - PID: 276, Name: lsass.exe
9 - PID: 392, Name: ati2evxx.exe
10 - PID: 448, Name: svchost.exe
11 - PID: 488, Name: svchost.exe
12 - PID: 536, Name: SPOOLSV.EXE
13 - PID: 564, Name: acs.exe
14 - PID: 596, Name: btwdins.exe
15 - PID: 620, Name: hidserv.exe
16 - PID: 692, Name: regsvc.exe
17 - PID: 712, Name: mstask.exe
18 - PID: 756, Name: SMAgent.exe
19 - PID: 788, Name: winmgmt.exe
20 - PID: 800, Name: svchost.exe
21 - PID: 980, Name: explorer.exe
22 - PID: 1144, Name: SynTPLpr.exe
23 - PID: 1160, Name: SynTPEnh.exe
24 - PID: 1176, Name: AGRSMMSG.exe
25 - PID: 1180, Name: ACU.exe
26 - PID: 1192, Name: reader_sl.exe
27 - PID: 1200, Name: internat.exe
28 - PID: 1220, Name: RMClock.exe
29 - PID: 1208, Name: BTTray.exe
30 - PID: 1308, Name: BTSTAC~1.EXE
31 - PID: 1236, Name: notepad++.exe
32 - PID: 1300, Name: cmd.exe
33 - PID: 1552, Name: cmd.exe
34 - PID: 628, Name: Dbgview.exe
has anyone experience with this peculiarity?
or is this a security feature from xp sp2?
my programm and driver can be downloaded from
http://lamp2.fh-stpoelten.ac.at/~tm041085/dkom.zip
|
|
|
|
|
Frankly, I do not see any legitimate reason to hide computer processes from view. I do not condone this type of development.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I would like to get some TCL along with the C++ codings for the design of Feedback-based Dynamic Scheduler(based on control theory(
code for my project
|
|
|
|
|
i'm new to game programming so this would be a good knowledge.
i would love to know:
1. how the music files are being handled in a game using c++?
2. how an array are used to encapsulate a sound buffer?
3. how the array is used to create a sound buffer?
4. how a pointer to DirectSound will be obtained?
5. how the class provide method how to load the sound data (*.wav or *.pcm or *.midi files)?
Is there any article regrading this that might answer my question?
pls help!!!
|
|
|
|
|
There is sample code in the DirectX SDK to do all these things.
If you need to ask 1 through 4, I wonder if you've even seen the SDK.
Microsoft DirectX Downloads[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Currently, I'm working on COM Interoperability project. In that client application (in vb 6.0) need to launch my application developed in .net.
Now the problem is the assemblies referenced by my .net application is spread across 2-3 folders and not in the same folder where my .net executable is placed. Also, the client application is also not in the same path where my .net executable is. If I keep everything (i.e. .net executable and client application) in same location everything works fine but if I move my client application to location different than my .net executable path, client application fails to load.
I register the assembly into the registry withoug codebase. Also, I tried setting the private path in probing attribute in app.config file but it didn't work.
Can any one pls help in how I can resolve the assembly reference issue?
Thanks...
|
|
|
|
|
Have you included the paths of the files in the computer's "PATH" environment variable?
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi, I'm using Visual Studio 2005 C++/CLI. I have some text and graphics that I both need to display and print. For the Form1 object I used 'graphics = this->CreateGraphics();' in the Form1 constructor and then used graphics->DrawString('aCharacter', drawFont, blackBrush, x_coord, y_coord) in various functions to output text characters onto the screen so that the information fits perfectly on the screen. What I have been reading about the GDI+ is that it was designed to insulate the programmer from a lot of the printer details by using the printer drivers. When I try to print or use print preview the graphics is scaled too large. Simply using 'e->Graphics->PageScale::set((float)0.85);' will get it to fit on the printed page but things (characters) are squished together. I figured out how to obtain the Font Metrics but they are read only. I have tried changing the printDocument1->DefaultPageSettings->PrinterResolution->X (and Y) with no effect. Tried changing margins too. Spending way too much time (20 hours so far) trying to figure this out. Any information that will point me in the right direction would be helpful.
Thanks,
Buck
|
|
|
|
|
Hi Buck, me again. If you haven't already, you should take a look at my approach
for this in the Sokoban article. It shows a board game that fits on a monitor,
and it fits on one printed page (whatever the print dimensions would be).
It does, however not really have text (except for a title line when printing).
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks Luc,
I must have been really tired or hung over because the first time I looked over the Sokoban code I didn't see what you were doing. At least now I think I can replicate some of this but I am having a problem that may be a C++ vs. C# thing. In the Board.cs file there is a class called PrintableBoard. The first line of the constructor is 'this.board = board;' (this->board = board; in CLI). If I try to do this I get the following compiler error...
error C2582: 'operator =' function is unavailable in 'System::Windows::Forms::Form'
The next line is 'PrintPage += new PrintPageEventHandler(PrintableBoard_PrintPage);' or in CLI use PrintPage^ += gcnew PrintPageEventHandler(PrintableBoard_PrintPage). If I don't use the ^ then the compiler complains that the PrintPageEventHandler needs 2 arguments not just 1. If I do include the ^ then I get 'error C2059: syntax error : +='. Is this a C++ vs. C# issue?
Buck
Buck
|
|
|
|
|
Hi Buck,
the PrintableBoard class has a class member "private Board board;" in C#.
I believe you would need a "private: Board^ board;" in C++.
and then the "this->board=board;" should work AFAIK.
i.e. in C++, the way I understand it, all reference types need a ^ when defined
and good old -> where I gladly use a simple . in C#
Hope this helps.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi Luc,
Actually there is a difference in the structure of the definition of 'PrintPage^ += gcnew PrintPageEventHandler(PrintableMap_PrintPage);' I did a search on the entire Sokoban solution for PrintPage and there was only the 1 occurrance. How and where is PrintPage defined?
Buck
|
|
|
|
|