|
I think the problem is with the string type. Have you tried using a byte[] array?
Also, you may want to write a wrapper function using MC++ and use the pin on the byte[] array to make sure the garbage collector doesn't move that memory since it's being used by a native sub-routine that can't be notified of pointer re-locations. Just a thought
----
www.muzikstor.com
|
|
|
|
|
I've never tried using a #define with P/Invoke, but if I were to guess, I'd say that may your problem. I suggest you try having your C# calling the ieee488_send method instead of the define'd send:
public extern static int ieee488_send(int address,[MarshalAs(UnmanagedType.LPStr)]string param2, uint param3, out int status);
|
|
|
|
|
I'm no C# expert, but if the ieee488_send method is expecting a pointer for the second and last arguments, then I think you need to declare them BOTH using "ref" (as you did the last one).
<br />
[DllImport("IIEEE_32M")]<br />
public extern static int send(int address,ref string strCommand,int xx, ref int status);<br />
send(inGpibAddress, Command, 0, inStatus);<br />
Also, does the method expect 3 or 4 arguments? In your VC++ example you have 4 arguments in the header file definition for ieee488_send. In C# you are only defining it as having 3 arguments...
----------
There go my people. I must find out where they are going so I can lead them.
- Alexander Ledru-Rollin
|
|
|
|
|
I would like to bind a single cell of a DataGridView control to a numeric variable (e.g.: System.Int16), either
by directly binding to the variable (better)
or
having the numeric variable as a public property of a class.
Is there any way to do it?
Thank you.
|
|
|
|
|
as far as i know, if you set an instance of a class as the data source for that datagrid, the public properties will be used as fields for the datagrid. for example:
Class MyClass
{
public string PublicProperty
{
return "string";
}
}
//after that..
MyDataGrid.DataSource = MyClassInstance;
will let you have the datagrid display just a column titled "PublicProperty".
I hope this will help.
~~~ From Milano to The Hague, easy as it goes ~~~
|
|
|
|
|
My problem is different:
I need to bind a single cell to a given public property of an instance of a given class, another single cell to the same (or a different) public property of another instance of the same (or a different) class, and so on...
I'm not trying to define a global datasource for the grid.
|
|
|
|
|
sorry, i misunderstood. that's an interesting problem, i'll work on it.
~~~ From Milano to The Hague, easy as it goes ~~~
|
|
|
|
|
Can anyone tell me how to insert a clob into oracle. I need to upload a document and insert it into a clob column
Thanks
|
|
|
|
|
hi all!
please tell me how to create a spalsh screen. i have put a timer and after it elapses i am able to open a new form. but the splash screen refuses to close.
I recently migrated to C# used to work on VB.NET before. in VB i had created an application context and managed to close the opening screen and transfer the mainform property.
this does not seem to work in C#. please help
regards
Vineet
|
|
|
|
|
in visual studio from the Project menu select [nameOfYourProject] Properties. in the "application" tab (usually the first to appear) look for the "splash screen" combo in the "windows application framework properties". here you can select the splash screen you previously added to the project (you added one, didn't you? ). then you should be done...
~~~ From Milano to The Hague, easy as it goes ~~~
|
|
|
|
|
Hi All!!
I have an ecommerce website, and is hosted in America.
When a user registers, how do I get the time that he registered by, meaning.. His/her time. The user can be in Australia, but for my DateAdded field I want it to be the local time of the user, and not the time on the server.
I hope this makes sense.
Regards.
ma se
|
|
|
|
|
You have to pick up the local time using Javascript, and send that to the server.
I recommend that you save both the user time and the server time. The user time is convenient for the user, but a user can change the computer clock, so for you to safely know the real time of the transaction you need the server time as that can not be altered by the user.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for that!!
But how is it possible to send the time on the local machine using JavaScript to the server?
Thanks
|
|
|
|
|
Make a hidden input on your form and then write it's value with JavaScript. When the user will submit the form you will get the value of that input...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hello I have a issue to discuss that recently I have a made a C# program for Rental Car Management, although its very easy cause all it contained was SQL statements manipulating the data form database. The issues starts when I gather all the elements or functions and display them to be accessed by one Main window where I can access all the different elements of the programs. I am showing you the code for this part, My teacher says its bit complicated and he would have done it simpler and differently.
I will appreciate any help comments to improve this.
namespace CMS1 // The Main NameSpace which is used for referencing rest of the program.
{
class CMS
{
// Structure of the Form mad with Views FileSystem.
Views.Form entry;
string formSpec = @"
<vertical>
<horizontal>
<vertical>
<horizontal>
<vertical>
<horizontal>
<horizontal>
<space width="130">
";
// a Method wich calls all other Programs from one single main.
public void ActionPerformed( string c )
{
switch (c)
{
case "ManageCustomer":
ManageCustomer m1= new ManageCustomer();
m1.Go();
break;
case "ManageContract":
ManageContract m2 = new ManageContract();
m2.Go();
break;
case "ManageEmployee":
ManageEmployee m3 = new ManageEmployee();
m3.Go();
break;
case "ManagePayment":
ManagePayment m4 = new ManagePayment();
m4.Go();
break;
case "ManageCar":
ManageCar m5 = new ManageCar();
m5.Go();
break;
case"ManageCarCatagories":
ManageCarCatagories m6 = new ManageCarCatagories();
m6.Go();
break;
case "Exit":
entry.CloseGUI();
break;
default:
return;
}
}
//every thing OK up til here, no problems, but all the problems start after this.
public void Go()
{
entry = new Views.Form(formSpec);
for( ; ; ) // he thinks this is not right!!!
{
string c = entry.GetControl();
if (c==null) break;
ActionPerformed(c);
}
entry.CloseGUI();
}
static void Main(string[] args)
{
CMS cms=new CMS();
cms.Go();
}
kind regards
JG
|
|
|
|
|
You could always do something like this:
string c;<br />
while (c = entry.GetControl() != null)<br />
{<br />
ActionPerformed(c);<br />
entry.CloseGUI();<br />
}
But I don't see why this should be inside a for loop or any loop at all...
|
|
|
|
|
The point I am trying to make or what is the main issue in this is that, there is a Main window with six option buttons, lets say I want to open manage cars. I want the Main window with the six options to stay open and waiting for me until I am finished manageing cars and after that closed or shut the manageing cars window.
Then I can choose lets say the manage Customer option to open that window and so on, the conflicted 'infinit for loop ' {; ;} right now allows me to do that.
But the teacher thinks thats not too smart, I of course am looking or asking assistence if someone has a better idea or someother solution which my teacher has and he dont want to share it with me uptil now.
kind regards
ruler
-- modified at 2:11 Friday 10th March, 2006
|
|
|
|
|
How to transfer textfile using C# webservice
Pushpa Sengathiron
|
|
|
|
|
You could probably use something from this article:
http://www.codeproject.com/useritems/FILE_DOWNLOAD.asp
But really you could just create a method that returns a string.
Or what do you mean exactly?
|
|
|
|
|
thanks we have decided to use webclient method which is by default available in c#.
Pushpa Sengathiron
|
|
|
|
|
Hi All,
I'm having trouble putting my question into words, so if it sounds funny, i'm sorry. But here goes...
I've created a View in SQL that contains all the info i need from the different tables i have. The view contains Example:
TransactionDate, StaffID, StaffName, BrandID, BrandName, TotalCash, TotalQty
2006/03/01, 1, Jan, 2, Loreal, 250, 10
2006/03/01, 1, Jan, 3, Kerastase, 200, 8
2006/03/01, 2, Koos, 1, Revlon, 200, 11
2006/03/01, 2, Koos, 2, Loreal, 290, 12
2006/03/02, 1, Jan, 1, Revlon, 500, 25
2006/03/02, 1, Jan, 3, Kerastase, 345, 15
2006/03/03, 1, Jan, 3, Kerastase, 100, 6
2006/03/04, 2, Koos, 1, Revlon, 120, 3
With this examle jou see that i've calculated the totals on the TransactionDate for each Staffmember for each Brand.
I want to know if it is possible to write a procedure in SQL and send from C# a DateValue and BrandID to SQL to let the procedure know that it should only do the calculation between a specified Date and on every Brand. I need One total for each brand between the specified date: example 2006/03/01 - 2006/03/03.
I can do the calculation in C# but i need to speed up the processing time by using the database to do the calculation and not the application we wrote. Would Using a procedure in SQL actually speed up the Process or Would our application still run more or less the same time because it has to send a value to the database and wait for the calculation to complete and get the Value back from the Database?
I need to know rather urgantly Please. Thank you in advance.
|
|
|
|
|
Hi
You can do it by passing two parameters(both dates start and end date) to the procedure and in procedure use group by brand clause . I think yours problem will be solved.
|
|
|
|
|
Thanks, but would this method actually speed up things?
|
|
|
|
|
Generally, yes.
There already is functionality to do grouping in the database, but if you do the work in C# you would have to build it more or less from scratch. Less code is less risk for bugs, and also testing a query is easier than testing a lot of C# code.
If you run into performance problems you might want to try to do the grouping on the original data instead of the view, and add indices on the fields you are grouping on and comparing.
---
b { font-weight: normal; }
|
|
|
|
|
Hello,
I used a number of Textboxes in Web Application using C#, now i want to access all these but i don't want to write name of each textbox i just want to use an ARRAY to assign values (Or Access these textboxes), I saw this somewhere in Visual Basic 6.0 but i don't know how can i do that in Visual Studio 2003 please tell me some solution for this to avoid write the names of all these ???????????????
Waiting to hear something soon from anyone
Regards,
AbuBakar
|
|
|
|
|