|
Hi!
Is it possible to send a search string using C# to the search field in the Vista start menu?
Thanks!
J-K
|
|
|
|
|
Well i've been making an app in .net 2.0 with sharpdevelop - but ive been making sure to only use things available to .net 1.1
I like the way all the designer code goes in a seperate file, anyways, i go to compile it with .net 1.1 and it doesn't like all of this partial class nonsense. SO rather than ME combining the two files for each form, is there somehting that will do it for me?
|
|
|
|
|
Partial class just tells the compiler to include that source with the rest of it.
If you want to compile in .net 1.1 just combine all the partial classes into one class, in one file.
|
|
|
|
|
So the answer is No, i have to do it myself? Aww, but i'm so lazy...
|
|
|
|
|
Hello,
I have a WinForm app and want to startup a ConsoleApp using a bat file. I have the bat file and once executed my ConsoleApp works fine.
How do I execute (or whatever) that bat file from a WinForms App? Do I use the Application class somehow?
Thanks
|
|
|
|
|
add in:
using System.Diagnostics;
and then try:
Process.Start("path to bat file");
|
|
|
|
|
okay, i'll try it tmw morning. Thanks!
|
|
|
|
|
System.Diagnostic.Process.Start("filename.ext");
sAqIb
|
|
|
|
|
sorry there is a spell mistake
System.Diagnostics.Process.Start("filename.ext");
sAqIb
|
|
|
|
|
Hi everyone!
I'm writing 2 programs, the first one runs on my pc and listens to the local IP and the port 7894, and I set the proxy server of the programs that want to access the internet, the second program runs on my website host and listens for connection from Any IP on port 1101.
The concept is that the program on my pc gets the request sent by the program tring to access the internet, the request and send them to the program on my website, the program on my website send the same request to the URI specified in the request, take the response , and send it to the program on my pc and the program send it to the program requested it.
I have tried the Sockets, TcpClients, TcpListener, WebRequests and WebResponses, but I really don't have enough information about the Sockets, WebRequsets, WebResponses, TcpClient and TcpListeners!
Could anyone guide about how to read and write the data in the Sockets and when to connect and disconnect to and from the website program and the webbroser programs please?
Sojaner!
|
|
|
|
|
HOW DID WE WILL GET A CHECK BOX IN DATAGRID IN WINDOW BASED APPLICATIONS USING C# IN .NET?
VAMSI RAGHAVA RAM
|
|
|
|
|
Vamsi, the first thing you should do is post in small caps. Typing in BIG CAPS LIKE THIS MAKES IT SOUND LIKE YOU'RE YELLING!
To get checkboxes in a System.Windows.Forms.DataGridView control, just add a check box column. You can do this visually through Visual Studio's Windows Forms designer.
|
|
|
|
|
Hi all,
I work with a very basic lang in a ERP solution. Its an internal development lang.
I need to work on a piece of code and realised that C# would be easier than in the internal language. Now I am new to C#. But I create a .dll file and ran regsvr32 on the dll and got the error
"CheckDate was loaded, but the dllregisterserver entry point was not found.
this file cannot be registered"
This is the first time I've tried to create a dll for use externally, and i know I am missing something but not sure what. Any help is greatly appreciated.
Regards
Tony
|
|
|
|
|
First of all, if the dll is to be used by other applications/components, what are those apps/components written in? If they're written in a .NET language, there is no need to run regsvr32 on them.
However, if the other applications/components are COM components, then you need to do at least 2 things to your C# dll: compile with exposure to COM. From the project settings page in Visual Studio, go to the Build tab and check the "register for COM interop" option. This will build your DLL with COM capability and will register the dll on the local system. If you deploy this dll to another machine, you'll of course need to register it with regsvr32. This article[^] elaborates.
|
|
|
|
|
Hi Judah,
Many thanks for that! Damn quick reply.
The other language is no where near C# its an internal language called C/AL which is a bit like pascal\C, and is interperated at the time by the application. But it can handle COM objects
Many thansk again for the swift reply.
Tony
|
|
|
|
|
-- modified at 18:14 Monday 16th October, 2006
(fixed so changed as still have error)
Okay so I managed to make it build succesfully. But it still won't register. I still get the dllregisterserver entry point error.
This is the code, simple I know!
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.Runtime.InteropServices;<br />
<br />
namespace CheckDate<br />
{<br />
[Guid("1AD0462D-4FA2-4072-B63B-8B1D88212389")]<br />
<br />
public class CheckDate<br />
{<br />
<br />
<br />
private int _day;<br />
private int _month;<br />
private int _year;<br />
<br />
public int day<br />
{<br />
set { _day = value; }<br />
<br />
}<br />
<br />
public int month<br />
{<br />
set { _month = value; }<br />
<br />
}<br />
<br />
public int year<br />
{<br />
set { _year = value; }<br />
<br />
}<br />
<br />
public bool checkDate()<br />
{<br />
DateTime newDateTime;<br />
string dateString;<br />
dateString = _day.ToString() + _month.ToString() + _year.ToString();<br />
if (DateTime.TryParse(dateString,out newDateTime))<br />
return true;<br />
else<br />
return false;<br />
}<br />
public void clear()<br />
{<br />
_day = 0;<br />
_month = 0;<br />
_year = 0;<br />
}<br />
<br />
}<br />
}<br />
|
|
|
|
|
I haven't done this in awhile, so my memory is a little foggy. A couple things jump out at me:
I believe you'll need an interface declared that defines the functionality you want available in COM. Something like:
[Guid("03AD5D2D-2AFD-439f-8713-A4EC0705B4D9")]
interface ICheckDate
{
void DoThis();
void DoThat();
}
Then have you class implement that interface. I think you'll need the ClassInterface attribute on your class as well. Your class declaration should look like this:
[ClassInterface(ClassInterfaceType.None), Guid("1AD0462D-4FA2-4072-B63B-8B1D88212389")]
public class CheckDate : ICheckDate
{
...
}
I'm a little fuzzy on this though whole .NET-to-COM interop, so take it with a grain (or generous helping ) of salt.
p.s. next time try <pre> tags around your code snippets.
*edit*
Looking at that article[^] again, it seems you need to call regasm tool to register the .NET assembly. I'd definitely check out that article and see for sure what needs to be done.
|
|
|
|
|
well, I tried that too, but no success. Doh.
<code>
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace CheckDate
{
[Guid("2BE56F71-BC00-4736-8D85-9A3C6438CDA7")]
interface ICheckDate
{
bool checkDate();
void clear();
}
[ClassInterface(ClassInterfaceType.None), Guid("1AD0462D-4FA2-4072-B63B-8B1D88212389")]
public class CheckDate : ICheckDate
{
public int day
{
set { _day = value; }
}
public int month
{
set { _month = value; }
}
public int year
{
set { _year = value; }
}
public bool checkDate()
{
DateTime newDateTime;
string dateString;
dateString = _day.ToString() + _month.ToString() + _year.ToString();
if (DateTime.TryParse(dateString,out newDateTime))
return true;
else
return false;
}
public void clear()
{
_day = 0;
_month = 0;
_year = 0;
}
}
}
</code>
|
|
|
|
|
Did you try running regasm on the assembly instead of regsvr32?
|
|
|
|
|
Hi Judah,
I did, but I need to ship the DLL out to another machine as well, so I am assuming they would need to use regsvr32. hence trying that.
<code>
Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.42
Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.
Types registered successfully
</code>
|
|
|
|
|
You'll need to register it on the target machine with regasm, I believe. .NET needs to be installed on the target machine too, so regasm will be there if .NET is installed.
|
|
|
|
|
I used the REGASM on my local machine, but I still can't see the custom control in my internal DB langauage.
Once registered, they normally show.
Any other way to test if its been implemented?
T
|
|
|
|
|
I have some old .NET-to-COM code along with steps to register it somewhere. I'll see if I can dig that up tomorrow.
p.s. as I understand it, regasm has an optional argument you can pass it to generate a tlb file from the assmebly. If you do that, can you use the resulting tlb file in regsvr32?
|
|
|
|
|
<code>
Checkdate.tlb is not an executable file and no registration helper is registered for this file type.
</code>
Thanks for all the help by the way I appreciate it!
T
|
|
|
|
|
If you use a tool like OleView or some other COM object viewer, your regasm'd dll doesn't show up on the target system? It should! :-p
|
|
|
|