|
Hi.
I'm writing my own filter in C++ and C#.
How i can change audio format ac-3 to lpcm , during playing video/audio ?
How i can do dinamic format change?
Can anybody help me ?
Thanks.
We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
Hi all,
I have used many time C++ DLL which export functions in C#.net project by using DLLimport. Now i have a C++ DLL which exports classes, so can any body suggest me how can i use C++ DLL classes in my C# project.
Thanks
Bankey
|
|
|
|
|
|
Hi, thanks for your response,
is it possible to use c++ classes from C++ DLL in C# without making wrappers.
i also read this article and other many article, all the article tells i need to make a wrapper for everry class and its members to use in C# project.
if wrapper is only solution than i want which approach will be best like managed C++ wrapper and unmanaged C++ wrapper
Thanks
Bankey
|
|
|
|
|
If possible you can also rewrite your C++ code to managed C++. This can even allow you to use the same source for unmanaged applications and for managed ones. At work we have such a kind of library that uses a lot of compiler switches to determine if the code is to be used with .NET or not.
|
|
|
|
|
bankey1010 wrote: is it possible to use c++ classes from C++ DLL in C# without making wrappers.
No, since the C++ classes are not managed code. Your either need to write a wrapper around it or rewrite the C++ code in C++/CLI (Managed C++). Which you chose is entirely up to you.
|
|
|
|
|
So I am trying to give the user an option of removing registry keys when uninstalling my application (the installer is the windows installer with visual studio).
The problem is it appears the message box appears behind the uninstaller (sometimes). Here is what I am doing:
public CustomInstaller() : base()
{
InitializeComponent();
base.AfterUninstall += new InstallEventHandler(CustomInstaller_AfterUninstall);
}
public override void Uninstall(IDictionary savedState)
{
base.Uninstall(savedState);
}
void CustomInstaller_AfterUninstall(object sender, InstallEventArgs e)
{
DialogResult result = MessageBox.Show("Do you want to remove all settings? (This is not reversible)", "Remove Settings",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
try
{
Registry.LocalMachine.DeleteSubKeyTree(@"Software\JD Development");
}
catch (Exception ex)
{
MessageBox.Show("Unable to remove registry settings: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
Process.Start("sc", "delete JDAgent");
}
|
|
|
|
|
I googled (you can do this too) and found some solutions:
1.:
MessageBox.Show(new Form(){TopMost = true},"I'm still on top, YEAH");
2.:
TopMost MessageBox[^]
3.:
[DllImport("user32.dll")]
public static extern int MessageBox(int hWnd, String text, String caption, uint type);
Then just call MessageBox with MB_TOPMOST
|
|
|
|
|
Yeah I was working on this late night and didn't find anything. Just had my wording screwed up in my search parameters instead of just top most messagebox. I dunno. Thanks for the reply.
|
|
|
|
|
I create my own csv file via Microsoft Excel 2003, then I need to read it with my c# application.
It's impossible to read it correctly because the fields are separated by a comma and I have some fields that include commas which are not supposed to be separators.
I have heard that csv separators could be also TAB chars.
Is it possible to save the CSV file with tabs instead of commas as separators?
Is there any other way I can solve the problem?
Thanks from advance,
benams
|
|
|
|
|
I would suggest using a third party library, like this one[^] to parse the CSV. The code you're using doesn't take into account that string fields in a CSV should be enclosed in quotes if the field contains the seperator character. If you wrote this code, you're not tracking the use of quotation marks properly, if at all.
|
|
|
|
|
What Dave said.
And then there are some CodeProject articles that could help out, here is one: Rive[^]
|
|
|
|
|
|
|
I suggest using the Jet Engine and ADO.net to access the XLS file directly rather than using CSV.
|
|
|
|
|
I believe Jet is not supported on 64 bit windows.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
It is for 32 bit programs.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi,
How can I save the StackTrace into mySQL? is't too long for varchar? should I use TEXT?
Thanks.
|
|
|
|
|
type text is very good for holding text.
|
|
|
|
|
The stack trace can be huge, I've had problems with it truncating in the past. You might want a squizz at this[^] if you are using SQL 2005.
|
|
|
|
|
Are you planning on running the application that you're getting the stack trace from as a release build without the pdb files? If you are, you aren't going to get a useful stack trace I'm afraid.
|
|
|
|
|
A stack trace without line numbers is still a valuable information when analyzing errors reported by "real users".
|
|
|
|
|
I have lot of parameters in my paramTable in my SQL server and I need to read those parameters when the user login and keep it there then delete it when logout or just leave it and replace it when use login again on the same machine..
which way is best to do it? saving in in HashTable? or save in the App.config?
|
|
|
|
|
Hello Jrahma,
in my opinion the best way to go is to create a class where all the parameters are stored.
Using any ORM tool like NHibernate you can store it and retrieve it from a DB.
If you choose to store it elsewhere like in a file you can serialize / deserialize it with
say an XmlSerializer.
Cheers
Manfred
|
|
|
|
|
this is what I am currently doing... what do you think?
public void get_system_properties()
{
try
{
_system_parameters_hash = new Hashtable();
_system_parameters_hash.Add("SQL_SERVER_CONNECTION", null);
_system_parameters_hash.Add("SQL_SERVER_DATABASE", "Cure");
_system_parameters_hash.Add("EVENT_LOG_DESCRIPTION", null);
_system_parameters_hash.Add("SYSTEM_LOG_FOLDER", null);
_system_parameters_hash["SYSTEM_LOG_FOLDER"] = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\" + Application.ProductName + @"\";
_system_parameters_hash["SQL_SERVER_CONNECTION"] = "Data Source=";
_system_parameters_hash["SQL_SERVER_CONNECTION"] += cure_registry_current_user.GetValue("SQLServer").ToString();
_system_parameters_hash["SQL_SERVER_CONNECTION"] += ";initial catalog=";
_system_parameters_hash["SQL_SERVER_CONNECTION"] += cure_registry_current_user.GetValue("SQLDatabase").ToString();
_system_parameters_hash["SQL_SERVER_CONNECTION"] += ";User Id=";
_system_parameters_hash["SQL_SERVER_CONNECTION"] += cure_registry_current_user.GetValue("SQLUser").ToString();
_system_parameters_hash["SQL_SERVER_CONNECTION"] += ";Password=";
_system_parameters_hash["SQL_SERVER_CONNECTION"] += cure_registry_current_user.GetValue("SQLPassword").ToString();
_system_parameters_hash["SQL_SERVER_CONNECTION"] += ";Connection Timeout=";
_system_parameters_hash["SQL_SERVER_CONNECTION"] += cure_registry_current_user.GetValue("SQLTimeout").ToString();
sql_connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["SQLdb"].ConnectionString);
sql_connection.Open();
sql_command = new MySqlCommand("sp_get_system_parameters", sql_connection);
sql_command.CommandType = CommandType.StoredProcedure;
sql_reader = sql_command.ExecuteReader();
while (sql_reader.Read())
{
if (_system_parameters_hash.ContainsKey(sql_reader["system_param_name"])) return;
if (sql_reader["system_param_value"] == DBNull.Value)
{
_system_parameters_hash.Add(sql_reader["system_param_name"].ToString(), null);
}
else
{
if ((string)sql_reader["system_param_type"] == "bit") _system_parameters_hash.Add((string)sql_reader["system_param_name"], Convert.ToBoolean(sql_reader["system_param_value"]));
else if ((string)sql_reader["system_param_type"] == "string") _system_parameters_hash.Add((string)sql_reader["system_param_name"], (string)sql_reader["system_param_value"]);
else if ((string)sql_reader["system_param_type"] == "int") _system_parameters_hash.Add((string)sql_reader["system_param_name"], Convert.ToInt32(sql_reader["system_param_value"]));
else if ((string)sql_reader["system_param_type"] == "int64") _system_parameters_hash.Add((string)sql_reader["system_param_name"], Convert.ToInt64(sql_reader["system_param_value"]));
else if ((string)sql_reader["system_param_type"] == "short") _system_parameters_hash.Add((string)sql_reader["system_param_name"], Convert.ToInt16(sql_reader["system_param_value"]));
}
}
}
catch (Exception exp)
{
write_log("System", null, null, "Error populating system properties!!", exp);
MessageBox.Show("Error populating system properties!!" + Environment.NewLine + "Please contact your system administrator.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.Exit();
}
finally
{
if (sql_reader != null) sql_reader.Close();
if (sql_connection != null)
{
if (sql_connection.State == ConnectionState.Open)
sql_connection.Close();
}
}
|
|
|
|