|
Sounds to me like Comm1 is not defined on your form. What makes you feel it should be ?
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,
how to insert textbox values into datagridview???
pls. reply, ill appreciate it
jing
|
|
|
|
|
Try this:
http://www.thescripts.com/forum/thread247261.html
|
|
|
|
|
|
Hi All,
How to validate or extract values from the following ASP label,
"a href="Browse.aspx?s=cc&v=sc">SavingCreditCard(9) /a" ??
I would like to get that count SavingCreditCard(9) in some variable? i would be glad if nayone could help me out.
-- modified at 20:54 Thursday 10th May, 2007
|
|
|
|
|
u can do that in JS . Say document.getELementByID("ID") then open the watch window and check for options there . innerhtml or childrens or value can give u ur "SavingCreditCard(9)". U have to debug that in JS.
|
|
|
|
|
Dear Subrata,
i got your idea, it really helped me a lot.
My question is, " how to capture the innerhtml values, like [categoryIndex].value"?
|
|
|
|
|
I am trying to use a generic class to provide standard data access methods for DataSetS that were created using the wizards. I can't seem to define the TableAdaptor parameter correctly so that the generic recognizes the TableAdaptor Fill() method.
Calling program:
{
GenericIo genericIo =
new GenericIo<
SomeTableAdaptors.SomeTableAdaptor,
SomeDataSet.SomeDataTable>;
SomeTableAdaptors.SomeTableAdaptor tableAdaptor =
new SomeTableAdaptors.SomeTableAdaptor();
SomeDataSet.SomeDataTable dataTable =
new SomeDataSet.SomeDataTable();
genericIo.GetDataTable(tableAdaptor, dataTable);
}
Generic class:
public class GenericIo<t1, t2="">
where T1 : class, new()
where T2 : DataTable, new()
{
public void GetDataTable(T1 tableAdaptor, T2 dataTable)
{
tableAdaptor.Fill(dataTable);
}
}
Compiler error message:
'T1' does not contain a definition for 'Fill'
I have spent many hours trying different things with interfaces, abstract classes, generic constraints, etc. to tell the generic class that T1 does have a Fill method which works on a DataTable, but with no success.
It's either going to be a "no, it can't be done" or the slap-your forehead "Doh". Any guidance will be appreciated.
Thanks,
FShields
|
|
|
|
|
Again, with code cleaned up. My apologies.
<br />
Calling program:<br />
{<br />
GenericIo genericIo =<br />
new GenericIo<<br />
SomeTableAdaptors.SomeTableAdaptor,<br />
SomeDataSet.SomeDataTable>;<br />
<br />
SomeTableAdaptors.SomeTableAdaptor tableAdaptor =<br />
new SomeTableAdaptors.SomeTableAdaptor();<br />
SomeDataSet.SomeDataTable dataTable =<br />
new SomeDataSet.SomeDataTable();<br />
<br />
genericIo.GetDataTable(tableAdaptor, dataTable);<br />
}<br />
<br />
Generic class:<br />
public class GenericIo<T1, T2><br />
where T1 : class, new()<br />
where T2 : DataTable, new()<br />
{<br />
public void GetDataTable(T1 tableAdaptor, T2 dataTable)<br />
{<br />
tableAdaptor.Fill(dataTable);<br />
}<br />
}<br />
<br />
Compiler error message:<br />
'T1' does not contain a definition for 'Fill'<br />
|
|
|
|
|
This short bit of code works well for getting the VolumeSerialNumber using win32_logicaldisk:
ManagementObject disk=new
ManagementObject("win32_logicaldisk.deviceid='C:\'");
this.textBox2.Text = disk.Properties["VolumeSerialNumber"].Value.ToString();
However, I would like to get the manufacturer serial number. I know this is available in win32_PhysicalMedia, but I can't find anything that tells me precisely what the "serial number" is named.
|
|
|
|
|
A little Google goes a long way. All I did was search for "Win32_PhysicalMedia" and wallah[^]!!
It's called, oddly enough, SerialNumber . The problem you're going to run into is that there is nothing that says a manufacturer has to fill this field in. This field may come back empty for any given drive or media.
|
|
|
|
|
Yup. Did the Google thing. I always do before I bother all you hard working folks. Found the same thing you did, tried it, and my little app crashed -- thought maybe I hadn't found the right name after all.
I suppose, based on what you say, it might mean there is no serial for my harddrive.
Bummer.
|
|
|
|
|
The last time I did this, only 2 out of 6 of my drives filled in the Serial Number field...
|
|
|
|
|
That's too bad. It would sure make my life easier if it was a standard all manufacturers followed.
Thanks for the feedback.
|
|
|
|
|
i have written a c++ application now i want to override virtual event handlers in the c++ app with c#.
also i want to compile the c++ app - or part of it- as a dll that i can reference in c#. but i keep on getting an error saying it's not a com object...
problem
1. what type of project do i need to create for c++ to be accesible in c#
2. how do i override an event handler.
or
how do i call a c# method from c++ (instead of overriding the event handler. i'll call a c# method
in a different dll)
rather have something you don't need, than need something you don't have
|
|
|
|
|
ok i compiled the c++ with /clr now c# adds the reference
rather have something you don't need, than need something you don't have
|
|
|
|
|
got it working with dllimport but cannot get it to call a c++ method
c#code :
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.Runtime.InteropServices;<br />
<br />
<br />
namespace ConsoleApplication2<br />
{<br />
class Program<br />
{<br />
static void Main(string[] args)<br />
{<br />
int mine = tester();<br />
Console.WriteLine(mine);<br />
<br />
}<br />
<br />
[DllImport("touchlib.dll", EntryPoint = "tester",<br />
ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]<br />
static extern int tester();<br />
}<br />
<br />
<br />
}<br />
c++ code
<br />
int Touchable::tester()<br />
{<br />
return 5;<br />
}
rather have something you don't need, than need something you don't have
|
|
|
|
|
Hi,
DllImport is used to call native code such as Win32 functions.
if your C++ dll is .NET code, just call the C++ class as if it were C#.
|
|
|
|
|
should i add a using <dllname.dll> ?
and for functions in a class do i need to call Class::function()?
rather have something you don't need, than need something you don't have
|
|
|
|
|
donsolms wrote: should i add a using ?
yes
donsolms wrote: for functions in a class do i need to call Class::function()?
no
calling any CLR compliant language obeys the rules of the calling language, hence
in C# you need a using statement, and call as class.method(args) or object.method(args).
|
|
|
|
|
i can't get the using to work. i have the c++ dll in a namespace named touchlib and then a class named Touchable.
<br />
using touchlib;<br />
doesn't work, i have added a reference to the dll. a i missing something, maybe in the compiling of the dll? how can i be sure that the dll is managed c++? what type of vc++ project is managed c++?
rather have something you don't need, than need something you don't have
|
|
|
|
|
Hi,
I dont remember the details for C++, but you did build the C++ dll, didnt you ?
so you know it is/isnt managed code.
if you were able to add a reference to it in your C# app, it must be managed code.
now Intellisense should show the available classes (C# and managed C++).
|
|
|
|
|
thanks a lot, it is working 100% now.
i might have referenced an older version of the dll somehow, and after a simple clean solution for the c++ dll and c# project made it work.
thanks again
rather have something you don't need, than need something you don't have
|
|
|
|
|
Hi.
I want the algorithm for solving 3Evaluation-3Passive :
ax+by+cz=d
ex+fy+gz=h
kx+ly+mz=n
I can solve this in math, but I confused of using this way as an algorithm
Best wishes
|
|
|
|
|
So what makes you confused? At what stage? Also there is a special forum for math and algorithms
|
|
|
|