|
Interesting. Both projects reference each other, I've never done that as I've always kept a heirarchy between projects so there aren't any circular references.
Anyway, you need to reference one project in the other and add the appropriate using statements at the top of the code.
However, because there seems to be a circular reference it might not permit you to do that.
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
1) I'm new to C# (lots of VB6 coding) how do I 'reference one project in the other'? I went to the Project for the CPP code and did a 'Add Reference' to the C# project and it still got 'identifier not found'. Could it be associated with the namespace?
2) What I'm trying to do with the 'DO_CALL_BACK' routine would be coded WITH EVENTS in VB6, and pass data back from the 'sub-project'. The C# will be handling the TCP/IP and data/events can originate there and must be passed to the CPP code.
Scott Krusemark
330-966-1231
|
|
|
|
|
How should the C++-Compiler know where to find Enter_CSServer() ?
It's a static member of a class CSServer in a namespace CSServer , so the correct call would be
CSServer::CSServer::Enter_CSServer();
Nevertheless, you'll have to reference the C# project, otherwise the compiler won't find the CSServer namespace/CSServer class.
Regards,
mav
|
|
|
|
|
It seems like such a newbie question. I added the 'reference' to the C# project to the C++ project. And added the CSServer::CSServer::Enter_CSServer() for the call. But I get 'CSServer is not a class or namespace name', as well as the Enter_CSServer is not found.
Is there any way you could put this simple sample with .sln file together so it compiles? Seems like such a simple problem but I don't see it.
Scott Krusemark - scott(at)askent.com
Scott Krusemark
330-966-1231
|
|
|
|
|
Apart from the missing namespace and class name the whole thing won't compile because the callback isn't defined either.
Remove the call to Do_Callback(), then you should be able to compile the C# class library at least.
After this you should add a reference in your C++ project to the C# class library and, by using the fully qualified name including namespace, be able to call the static function.
Regards,
mav
|
|
|
|
|
Already did that. The C# compiles just fine. But then the C++ does not find the namespace.
I tried adding the using namespace CSServer; to the C++ code, it errors out.
I tried adding a #using <testmix.dll> and it finds the .dll but no change on compile.
I tried adding a namespace CSServer; to C++ code and the intelisense finds the _tmain and do_call_back entry points for CSServer::[intelisense here] but not the CSServer class.
I tried making sure everything has the same namespace but looks like C++ does not have a 'default' namespace.
It's probably just some simple setting I'm missing (I suspect on the C# side) but I sure don't see it.
I appreciate your help btw.
Scott Krusemark
330-966-1231
|
|
|
|
|
How to modify the location of a dynamically created control in a asp.net page using c#?
|
|
|
|
|
The ASP.NET forum will help you will ,i think.
|
|
|
|
|
Actually i tried transforming the region of the control to a rotation...
for example,
Region reg = new Region();
Matrix matObj = new Matrix();
matObj.RotateAt(/*some angle*/, /*with respect to some point*/);
reg.Transform(matobj);
myControl.Region = reg;
Iam able to attain the rotation...but supposing the region (reg in this example)is in another shape(than rectangle)...say ellipse, then the shape of the ellipse is not visible completely....reason is that the rectangle coordinates(i.e. the original rectangle size) used to draw the ellipse is smaller than the rotated structure...(after rotation, the location of points are actually out of the bounds of the controls client rectangle...)
So i tried to get the size of the outer rectangle which has completely both the original and the rotated rectangles... by some trignometry...
but nope, im not getting the exact coordinates...
can you help me in this??
Thanks and Regards,
Rajesh
|
|
|
|
|
<Message>
<Questions>
...
</Questions>
<Answers id = 1>
..
</Answers>
<Answers id = 2>
..
</Answers>
</Message>
If , we have to get the node corresponding to the Answers node with id = 1 ,
how can we do that?
Shankar C
|
|
|
|
|
A good idea would be to load the contents of your XML file into a dataSet and do your searching on the dataSet instead. This gives you the advantage of handling XML data as if it was an ordinary Database.
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
private void ImportXML(string path)
{
XmlTextReader reader = null;
try
{
reader = new XmlTextReader(Server.MapPath("../CheckList/"+strFileName));
}
catch
{
Response.Write("File Does'nt exists");
}
XmlDocument doc = new XmlDocument();
doc.Load(reader);
reader.Close();
XmlDocument docNew = new XmlDocument();
docNew.Load(path);
XmlNode oldCd = null;
bool Append = false;
XmlElement root = doc.DocumentElement;
oldCd = root.SelectSingleNode("//answers[@objectid=" + intValue + "]");
if(oldCd == null)
Append = true;
XmlNode CdNew;
XmlElement rootNew = docNew.DocumentElement;
CdNew = rootNew.SelectSingleNode("/answers[@objectid=" + intValue + "]");
XmlNode newBook = doc.ImportNode(CdNew, true);
XmlNode newNode = doc.DocumentElement.ChildNodes[1];
if(Append)
newNode.AppendChild(newBook);
else
newNode.ReplaceChild(newBook,oldCd);
try
{
doc.Save(Server.MapPath("../CheckList/"+strFileName));
}
catch
{
string strPath = Server.MapPath("../CheckList/") + "TempFile.xml";
ImportXML(strPath);
}
}
can u help me in another way to do this?
|
|
|
|
|
Load data from the XML document into a dataSet:
<code>ds</code>= new DataSet();
ds.ReadXml(fileName);
Create a new row based on the table of the dataSet
DataRow <code>drs</code>= ds.Tables["Table1"].NewRow();
drs["Message"] = "Hello World!"
ds.Tables[table].Rows.Add(drs);
Delete an existing row from the table
if (ds.Tables["Table1"].Rows.Count > 0)
{
ds.Tables[table].Rows.RemoveAt(this.dataGrid1.CurrentCell.RowNumber);
}
Search for a value
if (ds.Tables["Table1"].Rows.Count == 1)
if (ds.Tables["Table1"].Rows[0][ds.Tables["Table1"].Columns[0]].ToString() == "Hello World!")
MessageBox.Show("Found");
Save the changes to the XML file
ds.WriteXml(fileName);
Hope this will help you get the picture.
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Thanx polis,
but can u tell about the ImportNodes method in the XML api?
|
|
|
|
|
ImportNodes method? Hmm... I am not aware of this one Shankar, sorry. XML API? What exactly do you mean by this?
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
In the System.XML namespace , we have a class called XMLDocument.
If we create an object for the above said class, we can call the ImportNodes method.
It's working correctly. but i need to know the correct usage for importnodes method.
|
|
|
|
|
Oh right. I just had a quick read on the MSDN[^]about the ImportNode() method. Well, it seems that all it does is to import specified XML nodes from another XML file into the one you are working with.
E.g.
XML File #1 (Current XML file you work with)
Nodes: FirstName, LastName, Age
XML File #2
Nodes: FirstName, LastName, Age, Address
By saying something like "....ImportNode(doc2.DocumentElement.LastChild, true);", it will append the Address node into your XML file #1.
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
|
hi all...
ParameterField paramField = new ParameterField();
ParameterFields paramFields = new ParameterFields();
ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
paramField.ParameterFieldName = "yazi";
paramDiscreteValue.Value = dt.Columns["Yazi"]; ***
paramField.CurrentValues.Add(paramDiscreteValue);
paramFields.Add(paramField);
r.rv.ParameterFieldInfo = paramFields;
r.rv.ReportSource = postaCeki; //this is the report object..
this code doesn't work. it blows on the *** row. i need to load crystal report parameter from datatable or datagrid but i can't how can i do that?? many thanks...
|
|
|
|
|
Hi
PLs tell me how can i use TAPI with C#
In my application I have winform which contains Four Text box and one button
First button-- Tel no of server
Second button-- Server name
Third button --- UID of server
Foruth button-- PWD of Server
When i press the button it should connect with the database server through modem . I want to implement this using C#
Pls every one should share his thoughts for implementing this product,
I need to implemen urgently
waiting for the response with code in c#
regards
sanjeev
|
|
|
|
|
well, there are two basic parts of this product,
first is to connect 2 pcs using tapi via tlephone line,
2nd is to make a messaging protocol which will connect ur aplication to the dtabase server on remote system. there should also a service running on remote system(server) which will recieve messages.
i can help u in 1st part that how can u connect to remote system using TAPI in c#. in few days i'll upload an article on codeproject regarding this. in meanwhile u can mail me n i can help u in this regard
so cheers
|
|
|
|
|
Hi,
I have already implemented Remoting connection of SQL Server Using C#
There are basically three textbox on WinForms and one Button First one is Address and Second one is UID and PWD of Server.
When the user press the submit button it connects with server and fetches all the Databases into Tree View
all the computers are connected on LAN.
I urgently need to Implement same thing Using TAPI in C#.
More one Field needs to Entered for Telephone no and it will detect modem of Computer Automatically after pressing submit button Please help me with the code (Connection with TAPI for dialup using modem in C#)
I have to start this application I am stuck now
Which sdk i should download
my email id is sanju10001000@yahoo.com
sanju10001000 and yahoo and com
Waitingh for your response
regards
sanjeev
|
|
|
|
|
Hi,
I need to Convert XML file into CSV file format
Pls forwad me the code for that in C# or vb,net
Regards,
sanjeev
|
|
|
|
|
I don't know about others, but I can only guide you to the right direction. I don't think that asking for the complete source code is a good idea.
I would:
1. Load the XML file into a table in a dataSet
2. Construct a new file on the disk giving it the extension .CSV
3. Loop through that table and copy each of its records into a new line of a text file by comma separating each column's content.
4. Save the file (close File streams)
5. Destroy dataSet
6. That's it
Hope this helps
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Hi
I need to convert Xml data to Excel file.
Format of Xml is as given below
a.xml
---------
<newdataset>
<emp>
<eno>1
<ename>rajiv
<sal>10000
<emp>
<eno>2
<ename>manoj
<sal>2000
<emp>
<eno>3
<ename>sankar
<sal>4000
<emp>
<eno>4
<ename>Raj
<sal>6000
Waiting for the response with Code
Regards
sanjeev
|
|
|
|