|
|
Hi...
I want to develop a C File using C#3.0 which will create the header file with structures, enums, macros..and all other features of the C..
I want to develop a tool in which i have a GUI and i have to select the options from GUI and accordingly i have to create a C file for the same
So is it possible in C#3.0?
|
|
|
|
|
Sounds like an IDE. A C-sourcefile is usually in ASCII, meaning that it's plain text. You can compile this source off course, even using an external compiler.
Should I imagine a code-generator, or more of a forms-generator?
I are Troll
|
|
|
|
|
thanks for ur reply..
Basically I am doing a project in which i will be designing a GUI and from there by taking the input I want to generate the C code in a file with ".C" extension. I will be using a different compiler to compile that C File.
So is it possible?
|
|
|
|
|
Yup. There's some articles on CodeProject that deal with creating User-Interfaces, in a similar way that Visual Studio works.
This[^] site shows how to create Windows and buttons from C.
You'd have to generate source-code similar to that on the website. Most compilers can be run from the command-line, so that shouldn't be any problem.
I are Troll
|
|
|
|
|
It sounds IDE kind of stuff you are looking for.
According to my knowledge currently there is no
any existing project or tool available which can
assist you.
However, it sounds R&D kind of project.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Niungareamit wrote: So is it possible in C#3.0?
My last team leader used to say "everything is possible with software", and I would agree. The question you really need to ask is whether you are able to translate user input selections into a valid C program.
It's time for a new signature.
|
|
|
|
|
I would recommend using an XML file to represent your C file. If you manipulate a .c file directly when you add or remove something like and include you have to do a whole lot more to find the correct line and insert or remove the text you want.
If you use an XML file you could have an includes node, and in C# you just add and remove nodes to the tree as you please. You can also have class nodes which in turn have method nodes and so on. Then you use XSLT to turn the XML into a .c file.
|
|
|
|
|
I don't know why you were downvoted.
Of course it is possible and maybe even useful.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Agreed
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Hi,
How to disable selection in datagridview?
I used datagridview1.ClearSelection();
it cleared the selection. But, I would like to restrict the user not to select the data. Please let me know how to achieve this. Thanks in advance.
|
|
|
|
|
You have two choices for the same.
1. If you want to allow selection for certain rows and disable selection
for other rows then try following.
If SelectionMode is FullRowSelect, then you'll need to override SetSelectedRowCore for that DataGridView, and not call the base SetSelectedRowCore for rows you don't want selected.
If SelectionMode is not FullRowSelect, you'll want to additionally override SetSelectedCellCore (and not call the base SetSelectedCellCore for rows you don't want selected), as SetSelectedRowCore will only kick in if you click the row header and not an individual cell.
2. Try following.
private void dataGridView1_SelectionChanged(object sender, EventArgs e)
{
if (this.dataGridView1.SelectedCells.Count > 0)
{
this.dataGridView1.SelectedCells[0].Selected = false;
}
}
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Thank alot.. I tried second one, its working
|
|
|
|
|
Hi,
I have a lot of URLS / web programs. I need to create a default page which consist of
two columns. Left column which has link button will call the url and display the existing url to
the right column of my default page. It can be done using html.
Is there a way to do it in .NET version? using web.
Thanks
Dabsukol
|
|
|
|
|
You can use frame to load the url.
Just try following code on click of left column url...
<FRAME src="[url that has been clicked from left column]">
You do not need to think it in .net context. You can do it simply
using frame as shown above.
You can do it dynamically using javascript.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Create a left page say "left.aspx" and set target attribute for anchor element with the name of right frame
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="left.aspx.cs" Inherits="left" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<a href="http://www.google.com" target="right">Google</a>
<a href="http://www.w3schools.com" target="right">W3Schools</a>
</div>
</form>
</body>
</html>
create default page with frame and give a name for right frame
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<frameset cols="10%,*">
<frame name="left" src="left.aspx" />
<frame name="right" src="about:blank" />
</frameset>
</html>
|
|
|
|
|
Thanks it works in .NET
Dabsukol
|
|
|
|
|
using JavaScript i want to change color of cell of asp.net grid view
i want once cell click by user it should became red
and if user click same cell again it should became white
how is that possible plz guide me
Regards
|
|
|
|
|
Add OnRowDataBound Event in your gridview
OnRowDataBound="grvDriverList_RowDataBound"
Define RowDataBound event in cs page
protected void grvDriverList_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Attributes.Add("onclick","toggleBGColor(this);");
}
}
Add javascript event
function toggleBGColor(obj) {
if (obj.style.backgroundColor == "red") {
obj.style.backgroundColor = "white";
}
else {
obj.style.backgroundColor = "red";
}
}
|
|
|
|
|
Hi guys,
I'm playing with some kind of SMS service which should be automated, and I have already developed an application, which can send AT codes to a device through the Serial port COMx.
Now I want to expand that application a bit, so I from a desktop can send commands to the serial device on the server.
So PC1 can access Server1 (with serial device connected to com1) provided they are connected in same network.
Is it possible to make some C# code in a desktop application, which connect to a serialport on another machine? In this case the remote server. And how?
|
|
|
|
|
grmihel2 wrote: Is it possible to make some C# code in a desktop application, which connect to a serialport on another machine? In this case the remote server.
I don't think it is possible to connect directly to another PC's serial port via a lan connection. You will probably need some program on the server that takes commands from your client PC and forwards them to the COM port.
It's time for a new signature.
|
|
|
|
|
I'm affraid that you are right about that. I ended up with using a web service hosted on the com hosted server, and then call the get HTTP request needed in URL form to send message. Using webBrowser object in my desktop application (without opening it visually ofc), and it seems to work this way. Then there is just a request about keep the webhosting service running on the server.
|
|
|
|
|
The other question is does it work with multiple clients at the same time??
|
|
|
|
|
I doubt that the webpage request from the server is thread safe. Since its an sms service, it will overflow the GSM modem with AT commands, if there isn't a short sleep timer. But in my case it doesn't matter, since there is no concurrency problem in this case, which means there is only one person at time sending commands by using this service.
|
|
|
|
|
No, it's not. That's the point of the question. If you had more than one person hitting the service at the same time, one instance would get access to the serial port and the other would throw an exception that the port is busy. The question is how does your service code handle that little problem.
|
|
|
|