|
You could write a C++ DLL and export the necessary functions.
You can then use P/Invoke to call these functions.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
You need to give more info on what you need to achieve and the structure of the code. If its a client server application, simply use sockets to transfer information back and forth. Else use C# to consume the DLL created with VC++ through P/Invoke, based on whatever your need is. This will enable C# code to call into the functions defined within your C++ code
Does that answer you?
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
Hi,
Im having a strange problem which i can't solve.
this is the code:
XmlWriter writer = null;
DateTime dateNow = DateTime.Now;
DateTime timeNow = DateTime.Now;
string test = "testinggggg";
string tessst = "testtetststs";
// Create an XmlWriterSettings object with the correct options.
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.IndentChars = ("\t");
settings.OmitXmlDeclaration = true;
settings.Encoding = Encoding.Default;
settings.NewLineOnAttributes = true;
settings.ConformanceLevel = ConformanceLevel.Fragment;
//dateNow.ToString("dd-MM-yyyy");
//timeNow.ToString("HH:mm:ss");
Console.WriteLine("The date of today = " + dateNow.ToString("dd-MM-yyyy"));
Console.WriteLine("The time of right now = " + timeNow.ToString("HH:mm:ss"));
try
{
// Create the XmlWriter object and write some content.
writer = XmlWriter.Create("Testing.xml", settings);
writer.WriteStartElement("Information");
writer.WriteElementString("DateOfBuilding", ""+dateNow.ToString());
writer.WriteElementString("TimeOfBuilding", ""+timeNow.ToString());
writer.WriteElementString("Testing", test.ToString());
writer.WriteElementString("Whatever", tessst.ToString());
writer.WriteEndElement();
writer.Flush();
}
finally
{
if (writer != null)
writer.Close();
}
Console.Read();
The problem is the date and time are written in the same tag.
This is how it looks like:
<Information>
<DateOfBuilding>9-9-2006 14:51:42</DateOfBuilding>
<TimeOfBuilding>9-9-2006 14:51:42</TimeOfBuilding>
<Testing>testinggggg</Testing>
<Whatever>testtetststs</Whatever>
</Information>
How can i write the date and time in sperate tags?
Thanks in advance!
|
|
|
|
|
You may want to consider using DateTime.ToShortDateString() and DateTime.ToShortTimeString() .
/ravi
|
|
|
|
|
DateTime dateTimeNow = DateTime.Now;
...
writer.WriteElementString("DateOfBuilding", "" + dateTimeNow.ToShortDateString());
writer.WriteElementString("TimeOfBuilding", "" + dateTimeNow.ToShortTimeString());
Is this okay for you? You don't need two seperate DateTime variables for the same date.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thank you very much guys!
|
|
|
|
|
Hello,
I have a problem on receiving messages from server.
I developed a server in C++ and a client in C#.
It seems that server runs well but when I try to connect,
I get the message "unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an applicaion request."
I'm not sure but when I was writing the client module, I used some eventhandlers to warn when data is read. May be this can cause some thread promblem because I use asynchronous communication.
In addition, the client can send messages to server but is unable to receive any.
Can somebody show me a way?
|
|
|
|
|
What is the socket config you have done? It will depend upon it.
I assume that the socket config is at fault
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
How to create my own .tsk theme file, change details in file?
Can't find any information in MSDN and internet.
Thank you
|
|
|
|
|
Just for reference as probably other people might come across this question like I did when searching how to build a Pocket PC Theme file (*.tsk). A TSK file is a simple CAB file renamed. When the Pocket PC reads this file it simply performs a install of this cab, which usually contains theme configuration info (but in truth could contain anything).
|
|
|
|
|
I want to access the induvidual frames of a video file (avi, mpeg) make some modifications and save the frame. Is this possible using C# ? if not what other languages can do it ?
|
|
|
|
|
Yes it is. Use the DX interop to get the reference to the frame buffer and bingo! its done.
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
Hi everybody
I'm looking for a way to automate telnet.
I looked around on the web for some information, but the closest thing I found is how to create web server, which is not exactly what I want...
Can anyone direct me a bit how can I control and automate a telnet, or at least a console (it would be a starting point).
Thanks alot!
|
|
|
|
|
Hello
If your telnet is a console, I don't know if this would work or not but you may give it a try!! Even consoles in WinXP are considered windows to some extent!! Than means that the window in which the console is displayed on is still a window and still has a handle. Try sending it messages with key strokes using Windows API SendMessage() function.
Regards
|
|
|
|
|
|
What do you mean by automation?
Implementing the Telnet protocol with the server shall do this easily and you can find tons of example on this
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
sorry for the ignorance, but how do I implement telnet protocol ? (or can you at least direct me to an example).
Its the first time I'm trying to implement a protocol
|
|
|
|
|
No Problemo Buddy. I am in India and it 2 AM here. Gotta catch some sleep )
Would it do if i sent you an implementation done earlier? Would that help?
Send me your id and will mail it to you....
YAWN!!! Sleepy I am )
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
hey, it would be a great help if you would just give me an article or something. I will start looking for one again.
Thanks again!
|
|
|
|
|
Hey, I got it myself!
Thanks anyway!!!
|
|
|
|
|
Well I am talking about a full fledged telnet client, that I had to code for one of my projects, to enable citrix console guys to hook in as per the policy defined. Anyways, good that you found soemthing. Many fo the samples out there, but then they have some potential loose ends as far as i have seen.
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
hello,
Can anyone help me in creating an equivalent vb.net argument type property development in c#. I have one code tell me how to implement the same thing in c#
Public ReadOnly Property GetValues(ByVal index As Integer) As DataRow
Get
GetValues = m_RecordTypeDS.Tables(0).Rows(index)
End Get
End Property
|
|
|
|
|
Hello
The property you are talking about -If I got you right!!- is called indexer in C#. You use it like this
MyReturnValue = MyObject.MyProperty[Sometype];
MyObject.MyProperty[Sometype] = SomeValue;
To make an indexer like the property you posted you simply write this syntax
public DataRow this[int Index]
{
get
{
return m_RecordTypeDS.Tables[0].Rows[index];
}
set
{
m_RecordTypeDS.Tables[0].Rows[index] = value;
}
}
Regards
|
|
|
|
|
hi guys, is there any way to move from one line of code to another in C#, something like GOTO in some previous languages ?
Mr.K
|
|
|
|
|
Hello
Sure!! There are still gotos and labels in C#
private void SomeThing()
{
goto MyLabel;
MyLabel:
}
Regards
|
|
|
|