|
Interestingly the following line returns "7" (There are indeed 7 Function Groups available)
label1.Text = Convert.ToString(myPulse.Project.FunctionOrganiser.FunctionGroups.Count);
When i compare the Object myPulse in VB2010 and C#2010 i saw that in VB2010 i can unfold it to Project to FunctionOrganiser to Function Groups and also a few properties like "Name" are shown. In C#2010 i can't unfold it and there are also no properties shown.
So could it been that i have to initialize or define the object myPulse in a different way?
Thanks!
|
|
|
|
|
As a trick, you could run your VB.NET code through a C# converter and see what it comes up with. When I ran it through, I got the following:
private void Button1_Click(System.Object sender, System.EventArgs e)
{
myPulse = Interaction.CreateObject("Pulse.LabShop.Application");
myPulse.Visible = true;
this.Text = "ControlPULSE " + myPulse.Name;
Label1.Text = myPulse.Project.FunctionOrganiser.FunctionGroups(1).Name;
} Now, that would require using the Microsoft.VisualBasic dlls in your app, but fortunately you can translate the offending line as in the following:
Type type = Type.GetTypeFromProjID(("Pulse.LabShop.Application");
object pulseType = Activator.CreateInstance(type);
if (pulseType != null)
myPulse = (Pulse.LabShop.Application)type; That's if you can't just directly call new on Pulse.LabShop.Application (that would be worth trying).
|
|
|
|
|
It is possible to create the object by
PulseLabShop.Application myPulse = new PulseLabShop.Application("PulseLabShop.Application");
...However, i get still the same error.
The type conversion didn't work because of an error to cast the object-type to myPulse.
Hmm seems like i've to think about writing a dll to access the programm in Visual Basic and to incluede in my C# project - What do you think?
|
|
|
|
|
...so with a dll written in VB2010 and included in my C#2010 code it works fine...now only the question is if this will influence the performance in a significant way or not...
|
|
|
|
|
Do you have JustDecompile[^]? If not, you really should consider installing it - with it, you could decompile your VB version, and then view the resulting source as C# to see what's happening.
|
|
|
|
|
I am getting into final year of my CS and i want to build an application as a FYP that stores the history of all programs that have been executed on windows.
please anyone of you can guide me in this regard
|
|
|
|
|
Certainly.
I give you my full permission to start work on it.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
If you want someone to do the design and/or development of your project then you are out of luck. This forum exist to help with specific technical problems within the work that you have done. If this project is beyond your skills then switch to something that you are able to do.
|
|
|
|
|
Certainly. As you are going to be working with Windows APIs, you should think long and hard about whether C# is your best choice. Also, you need to consider what a program is - for instance, what if I open something from the Control Panel?
|
|
|
|
|
You're also going to need to come up with a method to track this information. Windows doesn't track what applications were launched when, so you'll have to do this yourself.
I would suggest an API redirection on the various versions of the Win32 CreateProcess function. Look into a library called Detours, found here[^]. The Express edition is free but only works on 32-bit processors. The Pro version works on both 32 and 64-bit processors, but'll cost you $10,000 (US).
Warning! This is an extremely advanced topic dealing with Windows internals. If you don't know how Windows works, change your project right now.
Have fun!
|
|
|
|
|
Dave Kreskowiak wrote: but'll cost you $10,000 (US).
Liar, MS shop says it's only $9,999.95
Great info though, have a 5!
Cheers!
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
plus applicable taxes, duties and fees!
|
|
|
|
|
There is never a need for more than two significant digits in a price.
|
|
|
|
|
sonohamid wrote: can guide me in this regard
That is the job of your CS faculty at whatever school you are pursuing your CS degree from. Your tuition fees pay for those people to help you, make them help you.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi Everyone,
I am trying to make a program in Visual Studio using C# that would look and function like OSX's Automator, or the Java program Action(s) (http://app.jbbres.com/actions/). I am running into a bit of trouble, however, when trying to design the piece of the program where when I drop the selected action onto the box on the right half of the screen, it shows additional parameters to enter to tailor the action to the users' specific needs. I am thinking about using custom controls for my additional parameters, but I am unsure of which type of control would allow me to add custom controls within itself in such a way that they can be rearranged, and you can scroll through them if the controls extend beyond the edges of the window. Does anyone have any suggestions on what I should do?
Thanks,
Bobby
|
|
|
|
|
You may want to use a TableLayoutPanel or a FlowLayoutPanel .
/ravi
|
|
|
|
|
I made a class for Complex Numbers. I don't know what to write in the body of my override function.
public ComplexNumber(int real, int imagine)
{
Real = real;
Imagine = imagine;
}
public static ComplexNumber operator =(ComplexNumber a, ComplexNumber b)
{
return new ;
}
|
|
|
|
|
You cannot overload the = operation, since that's an assignment.
You CAN overload the == operation, which checks for equality and returns a True/False value (which you didn't specify the return type as boolean, BTW.)
Also, if you overload ==, you MCUH also overload !=.
|
|
|
|
|
I don't get it, still. Would you please give me an example by coding? Or can you complete my function as what you think it is right?
|
|
|
|
|
THe problem is I don't know what you're trying to do.
You CAN NOT overload the = operator since that's an assignment.
You CAN overload the == operator because it's a comparison operation.
BUT! Your code says you want to overload the assignment, which you CAN NOT do, and frankly there's no reason to!
So which is it???
|
|
|
|
|
Now I've got it. I thought there is a possibility to do so and now I can see there isn't. Thanks Dave
|
|
|
|
|
Are you trying to assign a to b here?
|
|
|
|
|
Yes, I want to do that but I've got that there is not such a possibility for the "=" operator, according to what Dave was trying to tell me.
|
|
|
|
|
I can't see much sense in trying to assign a ComplexNumber from two others like this. Do you really mean it to be the summation of the two complex numbers to form the new one? If so, you would override the + instead. Have a look here[^] for details.
|
|
|
|
|
No as I said before, I somehow misunderstood the whole thing. By the way thanks for your attention and guidance
|
|
|
|