|
The best C++/CLI book is the Manning book by our own Nishant Sivakumar. It's called C++/CLI in Action.
He also answers questions here a lot, so if you read his book, you can get direct access to ask him questions.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 am trying to build up a program in C++ in order to read an xml file and create an output text file (output.txt) which does not retain the xml tags and only the text in between the start and end tags.
For example for the following xml file:
*Abstract*
*AbstractText*The amino acid sequence of APP is highly conserved and age-related Ass aggregates have been described in a variety of vertebrate animals, with the notable exception of mice and rats. Three amino acid substitutions distinguish mouse and human Ass that might contribute to their differing properties in vivo. To examine the amyloidogenic potential of mouse Ass, we studied several lines of transgenic mice overexpressing wild-type mouse amyloid precursor protein (moAPP) either alone or in conjunction with mutant PS1 (PS1dE9). Neither overexpression of moAPP alone nor co-expression with PS1dE9 caused mice to develop Alzheimer-type amyloid pathology by 24 months of age. We further tested whether mouse Ass could accelerate the deposition of human Ass by crossing the moAPP transgenic mice to a bigenic line expressing human APPswe with PS1dE9. The triple transgenic animals (moAPP x APPswe/PS1dE9) produced 20% more Ass but formed amyloid deposits no faster and to no greater extent than APPswe/PS1dE9 siblings. Instead, the additional mouse Ass increased the solubility of accumulated amyloid in detergent and exacerbated amyloid deposition in the vasculature. These findings suggest that although mouse Ass does not influence the rate of amyloid formation, the incorporation of Ass peptides with differing sequences alters the solubility and localization of the resulting aggregates.*/AbstractText*
*/Abstract*
How would i used xerces parser to create an output file with only the text in between the tags?
|
|
|
|
|
I see no evidence that this is a C++/CLI question. If it's not, then standard C++ contains no DOM or SAX implimentations, but both are easy to come by on the web ( and, obviously, a DOM is even easier, if you're using Windows, there's a COM object you can use )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
#include <iostream.h>
#include <conio.h>
#include <string.h>
void fun(const char *& y, const char * &b)
{
for (int i=0; i<15; i++)
{
cout<<*(y+i);
}
cout<
|
|
|
|
|
Nandu_77b wrote: 1) It is accepting both "char* x" variable and "const char* y" - is should not accept "char* x" - but it is accepting, why???????????
The const in fun() arguments means fun() won't modify the passed values. It doesn't mean you have
to pass a const.
Nandu_77b wrote: 2) function "fun()" takes ref of const char*, but the problem is - i am able to change the value of both "y" and "b" - which should not happen since it is const char* - why I am able to change????????
3) What should i do if the fun() should not allow the value of "y" and "b" to change.
try making the reference const, not just the char*...
void fun(const char * const & y, const char * const &b)
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Mark Salsbery wrote: Nandu_77b wrote:
1) It is accepting both "char* x" variable and "const char* y" - is should not accept "char* x" - but it is accepting, why???????????
The const in fun() arguments means fun() won't modify the passed values. It doesn't mean you have
to pass a const.
/Nandu/: but i am able to change the values. I cant understand why it is.
Nandu_77b wrote:
2) function "fun()" takes ref of const char*, but the problem is - i am able to change the value of both "y" and "b" - which should not happen since it is const char* - why I am able to change????????
3) What should i do if the fun() should not allow the value of "y" and "b" to change.
try making the reference const, not just the char*...
void fun(const char * const & y, const char * const &b)
/Nandu/: I will try this and let you know.
Mark
Thanks
Mark
|
|
|
|
|
Nandu_77b wrote: /Nandu/: but i am able to change the values. I cant understand why it is.
By the way you've declared the passed variables, you've allowed them to be modified.
A "const char * &" is a "reference to a constant character pointer". The character pointer is
constant, the reference is not. The compiler won't complain if you change the reference.
To make a "constant reference to a constant character pointer" you need a second "const":
"const char * const &"
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hello guys, I just want to ask if you know algorithm on how to fill a sector. Currently I implemented floodfill using recursion and by drawing a line from boundary midpoint to sector points but it has some bugs. I hope you can help me.tnx
dfdf
|
|
|
|
|
AFAIK, floodfill exists in GDI and not GDI+, so I'd assume you're not using C++/CLI and if I'm right, you're in the wrong forum.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
hi all
how can i do something like:
System::Type^ a = int::typeid;
int b = (a^) c;
|
|
|
|
|
What are you wanting to do? I see your pseudo-code but I'm not sure why you think a cast is
necessary.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi,
I'm trying to learn c++ with the goal able to program 2D games like pacman and stuff like mario bros and final fantasy I. Although C++ is new to me, I have done several other object oriented programming languages, like java. However, I never programmed games before.
I read an article about game programming, saying that I need a game engine, it recommended SDL (http://www.libsdl.org/).
When I looked up for some demo's of SDL, I didn't like the program going full screen all the time. Does anyone know if it's possible to make stuff run in a windowed mode with this engine? Also, is this a good game engine to start with and will I need more advanced engine later on?
|
|
|
|
|
I am new to window programming and I need to do a task which is to know whether all the child dialogs have been exited before closing the main dialog. Can you please direct me, how can i do it?
Further explanation is the main dialog should not exit of ESC key unless all the child dialogs are properly closed.
Thanks in advance.
S.S
-- modified at 8:58 Tuesday 12th June, 2007
|
|
|
|
|
Iterate through them and check their Visible property.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
in my project is asp.net with c# project but my vss schedular is asp.net with vb.net.
Every this schedular is running on night 12.00am .
In that schedular i have somany doc files and excel files,.pdf files.
So while schedular running time html paths and actual document paths but some times it automatically stopped then i want do if any document contains problem then schedular ignore's that document and goes to next document.For this i want code. Iam sending some of the classes of the my project.
<pre>
public function get vss connection()
Public Function PopulateProject() As Boolean
Private Function PopulateSubProject(ByVal sParent As String, ByVal ItemIsDeleted As Boolean) As Boolean
Private Function Traverse(ByVal sProjectPath As String, ByVal SWFPath As String)
Private Function PopulateFiles(ByVal sParentID As Long, ByVal sProjectPath As String, ByVal sFolderPath As String) As Boolean
Private Sub InsertMenuRights()
Private Sub InsertDocNames()
Private Sub CreateFolder(ByVal Path As String)
Private Function GetNWExt(ByVal FileName As String) As String
Public Sub Conversion()
Private Function GetHTMLPath(ByVal FilePath As String)
Private Sub DocToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Sub PptToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Sub PDFToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Sub ExcelToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Function GetTPath(ByVal DocPath As String)
Private Function GetTruncPath(ByVal HTMPath As String)
where i will mention code in this classes.Please help me.
</pre>
samrama
|
|
|
|
|
Then why are you asking in the C++/CLI forum ? Don't cross post, pls.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 feel like a bit of a newbie asking this, but I have never had to access elements on the main form from outside it before.
So here it is: I need to access a textbox from a cpp file .... the textbox is on the main form which is initialized in the main function ... with the usual Application::Run.
in the main cpp file:
..........................................
#include "Form1.h"
int main(array ^args)
{
Application::Run(gcnew Form1());
Form1::textBox1->Text = "some text";
}
...........................................
This doesn't work of course, because I am referencing the header class itself, and not the form instance .... but what is the form instance ????
now ... I know I could use ...
Form1^ myForm = gcnew Form1;
myForm->ShowDialog();
except that gcnew objects cannot be declared globally, and I need to access some of the form elements from other parts of the code, not main().
So I'm stuck .... any help would be appreciated.
Thanks
Aaron
|
|
|
|
|
aaron_leese wrote: I have never had to access elements on the main form from outside it before.
Good, you don't want to... check out the Model-View-Controller[^] design pattern.
|
|
|
|
|
yeah I know, but I still want to ... it is not always desirable to have a couple layers of indirection between interface and data.
|
|
|
|
|
It's never desirable to have anything until it is desirable to have it. That is the entire point.... never mind.
aaron_leese wrote: yeah I know, but I still want to
Of course you do... I don't know what got into me.
|
|
|
|
|
aaron_leese wrote: int main(array ^args)
{
Application::Run(gcnew Form1());
Form1::textBox1->Text = "some text";
}
...........................................
This doesn't work of course, because I am referencing the header class itself, and not the form instance .... but what is the form instance ????
Hmm...seems to me this also doesn't work because Run() doesn't return until you exit the app by
closing the form.
Form1^ myForm = gcnew Form1; would work but it makes no sense to access controls in the form
before it's created.
Do you have a better example of what you're trying to do?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
sure .. here is all the grubby details....
I have a multithread program .... one thread monitors the gui events, the other looks for incoming midi messages.
There are certain midi messages that trigger subroutines .... and there are buttons that do the same. The gui appearance need to change to reflect when certain subroutines are running, etc.
most of the subroutines change some global variables, and the gui just polls those variables to determine the state of affairs and appear accordingly.
BUT ... sometimes this is not appropriate, and I need to get some of the subroutines to alter the gui directly. No problem is a button is pushed .... big problem if it's a midi command .... because that thread does not have access to the form elements.
so ... succinctly .... how do I get a thread to access a form which is running on another thread.
I think I can do it if i only knew the correct instance name of the generated form.
any thoughts ?
Aaron
|
|
|
|
|
Hi Frnz,
I need to find the version details of my exe file. My exe code is in C++. Can anybody help me for the same in C++ to find the Version of any exe.
Thnz in advance
poojaaa
|
|
|
|
|
First of all, please post non-managed C++ questions on the Visual C++/MFC board[^].
If your EXE has a VERSION resource, you can get it with the help of these APIs:
GetFileVersionInfoSize()
GetFileVersionInfo()
VerQueryValue()
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
can a reflected methode not return gcnew System::Windows::Forms::TextBox()
but just base types like INT ???
if not mean it can return TextBox
where do i go wrong ?
myType = SampleAssembly->GetType("Memory.What");
myObj = System::Activator::CreateInstance( myType );
myMethod = myType->GetMethod("Name");
myMethod->Invoke( myObj , nullptr ); <<<--- here is the error
i have a MessageBox::Show in Memory.What.Name wich is fiered and also shows TextBox->ToString() corect which shoud by returned
(ToString is for testing in the messagebox dont get confused)
An unhandled exception of type 'System.NullReferenceException' occurred in WhatsUp.exe
Additional information: Object reference not set to an instance of an object.
|
|
|
|