|
Since windows installer seems to behave strangely sometimes you could write your own Installer class to copy the files yourself and then include it as a custom action into your setup project.
Might be worth a try...
|
|
|
|
|
Hi,
I'm looking for a database that will have all provinces, towns for each country
and translated in spanish and english.
Does anyone have such a database ? where can i find this ?
thanks for any help on the subjet
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
That could be a tall order. Not all countries are made up in this manner.
For example, England is made up of 47 boroughs, 36 counties, 29 London boroughs, 12 cities and boroughs, 10 districts, 12 cities, and 3 royal boroughs.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
Hi,
Using Albert Pascual's article as a starting point, I have created a Windows Service. However, I can't get it to run. After building it, I opened the command window and ran the InstallUtil.EXE on it successfully, but it never shows up in the MMC/Services window and it never writes to the event log. What should my next step be to get this thing going?
Thx,
RFickling
|
|
|
|
|
I suggest using the /logFile option to InstallUtil. If you didn't, it still writes logs: see the documentation for InstallUtil.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi!
this is my first post here, so bear with me . I'm currently trying to convert my C++ source to C#. I have now the problem that in my C++ code I'm passing a already existing object (wich is living in another class) in the constructor to yet another class. Ths happens as a pointer. But when I'm trying to do this in C# I'm getting the error CS0236: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cscomp/html/vcerrCompilerErrorCS0236.asp
How would I do this in C#? I've already tried to pass it as reference, but I'm getting the same error then.
Thanks in advance
|
|
|
|
|
Ah I forgot to say I'm using SharpDevelop, just incase this helps
|
|
|
|
|
If you'd post some code, that would help.
You can pass C# objects as regular objects, and not use pointers.
Since in c# you always have to use "new" to construct object and they are always passed by reference. It seems you're looking for a copy constructor construct in C#, which can't be done without cloning the object.
Just give us some small code example.
|
|
|
|
|
Classes are passed by reference. The following works. Please post your code so we can see what the problem is.
using System;
public class test
{
class one
{
public one()
{
Console.WriteLine("one's constructor");
}
}
class two
{
public two()
{
Console.WriteLine("two's constructor");
}
public two(one o)
{
Console.WriteLine("two's constructor");
}
}
public test()
{
one o = new one();
two t = new two(o);
}
[STAThread]
public static void Main()
{
test t = new test();
Console.Read();
}
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Ok then heres the code. At least a part of it.
http://www.nomorepasting.com/paste.php?pasteID=16138
|
|
|
|
|
Hello Pps
I implemented a serial communication on a Pocket Pc. I used code out of a msdn article (http://support.microsoft.com/default.aspx?scid=kb;en-us;823179)
to reach my goal........
The target is to send a special bytecode to a microprocessor, which should look like this:
Code + carrige return + checkbyte
ASCII: z004\r<
Byte: 7A 30 30 34 0D 60
Now the program actually runs. BUT the COM don't send exactlly what
the program is telling it. So the microprocessor always receive an additional line feed and the data look like this:
7A 30 30 34 0D 0A 60
**
I tried many differently DCB attitudes, but it didn't work.
The DCB struct i used look like this:
public struct DCB <br />
{<br />
<br />
public int DCBlength;<br />
public int BaudRate;<br />
public int fBitField;<br />
public Int16 wReserved;<br />
public Int16 XonLim;<br />
public Int16 XoffLim;<br />
public byte ByteSize;<br />
public byte Parity;<br />
public byte StopBits;<br />
public byte XonChar;<br />
public byte XoffChar;<br />
public byte ErrorChar;<br />
public byte EofChar;<br />
public byte EvtChar;<br />
public Int16 wReserved2;<br />
}
And the settings
intResult = GetCommState(intHandle, ref lpDCB);<br />
<br />
lpDCB.BaudRate = 1200;<br />
lpDCB.fBitField = 0x0803;<br />
lpDCB.XonLim = 0;<br />
lpDCB.XoffLim = 0;<br />
lpDCB.ByteSize = 7;<br />
lpDCB.Parity = 2;<br />
lpDCB.StopBits = 0;<br />
lpDCB.XonChar = 48; <br />
<br />
intResult = SetCommState(intHandle, ref lpDCB);
So I don't know how to continue..??????????
Thanks for help and excuse my bad english
Andreas
|
|
|
|
|
The example code you linked to uses an Encoding object to turn a string into an array of byte . I suggest using a byte array directly.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thanx for answering...
So i've already checked the converting part by debugging. But the program writes exact what i want to the "File" (WriteFile WinAPI function).
I think it has something to do with the COM settings. There is a binary mode flag in the
DCB structure, which i set to true, but it had no infuence.
Greets
Andreas
|
|
|
|
|
After much research i finally managed to find how to change to wave out volume, however i am still unable to find a way to mute/change the volume of the line in line. I believe that it has to do with MIXERLINE_COMPONENTTYPE_SRC_LINE. If anyone knows how to achieve this it would be greatly appreciated.
|
|
|
|
|
hi
i dont how to write visual c# code for login users
please help me
thank u
|
|
|
|
|
lolo82 wrote:
i dont how to write visual c# code for login users
Your question is a little vague.
Login user to what? A database? Windows?
Michael
CP Blog [^]
|
|
|
|
|
|
lolo82 wrote:
to database
Again it depends on the database and what security methods it uses.
I personally prefer writing my database connection strings to the App.Config file when Windows authentication is being used.
Or are you trying to lookup a user in a database?
Michael
CP Blog [^]
|
|
|
|
|
Ive been battling with this prob for a LONG time now..
Using Threads and remote retrieval: i get a rpc error or COm exception sometimes? Like it's retrieving the values, and then it says rpc server unavailable and then if u carry on it will retrieve the next value.. happens with different values..
maybe deadlock occurs?
Basically- i use: private ManagementObjectSearcher m_MOSearcher;
private ManagementScope m_ManScope;
private ConnectionOptions m_ConnectOptions;
m_ConnectOptions = new ConnectionOptions ();
m_ConnectOptions.Username = "user";
m_ConnectOptions.Password = "pass";
m_ConnectOptions.Authentication = AuthenticationLevel.Call;
m_ConnectOptions.Impersonation = ImpersonationLevel.Impersonate;
m_ConnectOptions.EnablePrivileges = true;
m_ConnectOptions.Locale = "MS_409";
m_ConnectOptions.Timeout = new TimeSpan (0,0,0,0,5);
string strConnection = "\\\\"+ "192.168.0.88" + "\\root\\cimv2";
m_ManScope = new ManagementScope(strConnection, m_ConnectOptions);
ObjectQuery Temp = new ObjectQuery("SELECT " + "Size" + " FROM Win32_" + "DiskDrive");
m_MOSearcher = new ManagementObjectSearcher (m_ManScope, Temp);
foreach(ManagementObject mo in m_MOSearcher.Get())
{
Console.WriteLine("Size: " +mo["Size"].ToString ());
}
Temp = new ObjectQuery("SELECT " + "Model" + " FROM Win32_" + "DiskDrive");
m_MOSearcher = new ManagementObjectSearcher (m_ManScope, Temp);
foreach(ManagementObject mo in m_MOSearcher.Get())
{
Console.WriteLine("Model: " +mo["Model"].ToString ());
}
And thread it with:
for (int i=0; i< 250; i++)
{
Thread a = new Thread(new ThreadStart(Function));
a.Start();
}
|
|
|
|
|
(Type your message here)
richTextBox rtb = new richTextBox();<br />
StringBuilder stb = new StringBuilder();<br />
stb.Append(rtb.Text);
In a foreach(char ch in stb.ToString()) statement I want to know if we have find end of line.
Any fast way to do this?
Could this be done without converting .ToString() by someway?
|
|
|
|
|
Does it have to be a StringBuilder and then running through all characters separately?
I guess using IndexOf() on rtb.Text might be faster...
mav
|
|
|
|
|
It's important for me to read the characters separately and insert or remove a specific number of continous spaces(not all) at the start of any line, rapidly.
|
|
|
|
|
Ok, in that case I'd second the String.Split/String.Merge suggestion, because if you insert characters in your string, the system has to move the rest of the string. So creating an array of lines, modifying each line separately and then combining them again should perform much better.
|
|
|
|
|
|
A newline is not just one character for windows, it's string representation = "\r\n", which can be found in System.Environment.NewLine.
You could try comparing the current Char ch to: Char newline = '\n';, but I'm not sure that'll work. Or make a variable that holds the last char compared like so:
<br />
Char last = '';<br />
<br />
foreach(char ch in stb.ToString())<br />
{<br />
if(ch == '\n' && last == '\r')<br />
{<br />
}<br />
last = ch;<br />
}<br />
|
|
|
|