|
Lol. Not usually a fan of the smart ass responses, but this one is good .
|
|
|
|
|
I try to hold off such responses until there's at least one serious response.
|
|
|
|
|
Not normally a fan of getting wise ass responses but good 1.
Chona1171
Web Developer (C#), Silverlight
|
|
|
|
|
In general no. There isn't any reasonable way to identify protocol, type, etc generically. Nor much point since you must already know something about it to use it.
However you can write a UDP protocol service that does the following.
1. Each host starts a UDP port
2. Requests to the port are responded to with enough information that identifies what kind of host is available.
3. On start up a client sends a UDP request and processes response(s).
You could also do a ldap registration I suppose.
|
|
|
|
|
Finally a useful response.
You see you still have to configure the endpoint address the client has to look for, and as I have a pretty general piece of software here, i want end users to be able to install it on their business network without having to answer millions of support calls.
thx for the advice!
Chona1171
Web Developer (C#), Silverlight
|
|
|
|
|
Chona1171 wrote: You see you still have to configure the endpoint address the client has to look
for, and as I have a pretty general piece of software here, i want end users to
be able to install it on their business network without having to answer
millions of support calls.
Presumably by "configure" you are referring to things like 'closeTimeou', etc.
There are two possibilities
1. You are creating a library
2. You are creating an application.
For 2 most configuration values should not be configurable per install because most of them are related specifically to the business functionality. There might be some values, like 'listenBacklog' that you might hypothetically consider relevant how the solution for that is easy. Provide a default and provide a way to override it if it should come up. Via that methodology then the UDP server posts the modifications.
There is of course nothing that says the UDP can't post the entire config although there is two problems with that.
1. An application that presumes that all values are configurable is probably just ignoring what the application does.
2. The client config isn't the same as the server config anyways.
If a library then the the target customers are not business users, instead it is developers.
|
|
|
|
|
Hi,
I have an ActivX chart control with a method AddPoints(). The IDL looks like this...
[id(40)] VARIANT_BOOL AddPoints(BSTR strPlotName, ULONG nVals, DOUBLE* pdXVals, DOUBLE* pdYVals);
In the C# wrapper generated by DevStudio it looks like this...
public virtual bool AddPoints(string strPlotName, uint nVals, ref double pdXVals, ref double pdYVals);
Question is; how do I pass the double arrays to this method from C#?
Thanks.
“If I had asked people what they wanted, they would have said faster horses.”
― Henry Ford
|
|
|
|
|
Oh this old chestnut. I did a certain amount of searching around this issue and I couldn't find a way to make the auto generated wrapper convert X* to X[] instead of ref X. You might have to manually tweak the wrapper.
|
|
|
|
|
I Suspect BobJanova is correct, but I just did some messing around with unsafe code and there is a possability that even though the wrapper is taking a double ref, it may be treating it as a pointer. Check this code out
static void Main(string[] args)
{
double[] testArr = new double[] { 1.0, 2.0, 3.0 };
for (int i = 0; i < 3; i++)
Console.WriteLine(testArr[i]);
test(ref testArr[0]);
for (int i = 0; i < 3; i++)
Console.WriteLine(testArr[i]);
}
public static unsafe void test(ref double x)
{
fixed (double* ptr = &x)
{
ptr[1] = 2.5;
}
}
this produces the following instead of an error.
1
2
3
1
2.5
3
so there is a chance that simply passing a reference to the 0th index in the array might get what you want done. I don't have the wrapper setup to test it out myself.
|
|
|
|
|
I had the same thought but I'm sure I tried passing a reference to the first element and it wouldn't compile. I wonder what I was doing wrong.
|
|
|
|
|
Thanks for the replies,
Passing a ref to the first element compiles ok but i seem to be getting garbage values at the other end (in the ActiveX control). But i have not given up yet.
“If I had asked people what they wanted, they would have said faster horses.”
― Henry Ford
|
|
|
|
|
I've found sometimes the only way to reliably do stuff like this is to use System.Runtime.InteropServices.GCHandle s.
double[] pdXVals = new double[] { 1, 2, 3 };
double[] pdYVals = new double[] { 4, 5, 6 };
GCHandle handleX = GCHandle.Alloc(pdXVals, GCHandleType.Pinned);
GCHandle handleY = GCHandle.Alloc(pdYVals, GCHandleType.Pinned);
handleX.Free();
handleY.Free();
I'm assuming there is a fixed size for the arrays? If not, as there is no size parameter there is no way for the function to know when to stop reading memory and you will get garbage data and/or exceptions.
|
|
|
|
|
You might already have seen this[^], which may help you to resolve your problem.
Henry Minute
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
Cogito ergo thumb - Sucking my thumb helps me to think.
|
|
|
|
|
i have four radiobutton and a button.first i m selecting item through radiobutton and adding items into textbox on button click_event.now i want that item which are shown in textbox can be edited and reflect back into database.
here main problem is i hav four txtbox which is populated by different database table and table is selected on radio_click event.but i m unable to made the changes into database when user deleted textbox data.
|
|
|
|
|
Member 8233601 wrote: but i m unable to made the changes into database when user deleted textbox data.
I really don't think that anyone here will be able to guess what you are doing wrong in this instance. Please show the code that is failing and explain what results you do expect.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Member 8233601 wrote: now i want that item which are shown in textbox can be edited and reflect back into database.
Then write the code to do so; open a connection to the database, and update the record.
Steps are described here[^].
Bastard Programmer from Hell
|
|
|
|
|
i m all done with is problem.Thanks all 4 der precious suggestion.
|
|
|
|
|
I have a x86 c# program which uses Process.StartInfo and Process.Start to run a batch file (ToInstallSql.bat) to install Sql Server 2008 R2 silently which contains:
SQLEXPR_x64_exe /ConfigurationFile=MySqlConfiguration.ini
I have to install 64-bit Sql Server because there are other existing installation of Sql Server products and instances of 64-bit.
The c# program (MyCustAction.exe) contains the following:
Process proc=new Process();
proc.StartInfo.FileName = "ToInstallSql.bat";
proc.StartInfo.RedirectStandardInput = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.CreateNoWindow = true;
proc.Start();
proc.WaitForExit();
proc.Close();
If I directly run the program MyCustAction.exe as administrator, Sql server is installed successfully. But if I add MyCustAction.exe as an InstallShield custom action After File Transfer in an InstallShield project, Sql Server installation failed even if the installation process took longer time than normal with no error message. The Releases/Setup Launcher/Required Execution Level in InstallShield project is set to Administrator. The MyCustAction.exe is embedded with a manifest to run as administrator. I run the InstallShield 2012 Express created Setup.exe as administrator. I checked the error log of SQL Server. It says it could not write to windows registry.
The InstallShield install is an x86 application. But the Sql Server is x64 which is to be installed by MyCustAction which is in turn to be run by InstallShield custom action
The c# program,MyCustAction.exe, and batch file are transferred by InstallShield setup.exe to a subfolder under the installation folder.
My question is how to make windows registry writable for 64-bit. InstallShield disable x64 registry when installing my application of 32-bit.
I tried many different scenarios, still unsuccessful. Please help me.
Sheng
|
|
|
|
|
Check this out:
Registry Redirection[^]
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Thank you for your answer! I appreciate it.
Sheng
|
|
|
|
|
Hi,
Ever tried to copy into/replace a file inside System32??
I keep getting invalid path error message when it works just fine elsewhere.
Please advise.
|
|
|
|
|
I assume you're using Vista or higher. Basically, your application doesn't have permissions to do anything inside protected directories. This is a good thing, and has been implemented like this for a reason.
|
|
|
|
|
reason for my vote 5 is: I also think that it is the administrative rights problem...
Happy Coding...
|
|
|
|
|
make sure that you have administrative rights on the system..
Happy Coding...
|
|
|
|
|
Even if you have admin-rights, this is typically not done, unless you're trying to hide something from the user. The folder contains system-files for Windows, application-level sh*t should be kept apart.
Bastard Programmer from Hell
|
|
|
|