|
Hi all,
I have a .h file that includes simple constant declarations.
I need those constants in a C# project, so I figured I can wrap those in a C++ .NET project and reference to it.
The problem is I can't do the simplest things.
Here is a sample:
public __gc class SmDefines
{
public String* getObjData() {return NFMDEFS_XML_VAL_DATA_OBJ;}
...
}
I tried everything: String, String*, but I alwyas get the error:
C2144: Syntax error: 'System::String' should be preceded with ':'
Does anybody know what is the matter? or if there's another way to do what I wanted.
Thanks!
|
|
|
|
|
Has anybody tried implementing GLOBAL cbt hooks in c#?
I keep getting a .net framework runtime error as soon as the hook is activated...however it works fine LOCALY...
I just keep getting the command prompt screen with a "Runtime" error message i hate it!
|
|
|
|
|
I just want to design a web control.
My object is,In the top of my control there is a ‘+’ sign with a title [ + Title Name].When the user click on the ‘+’ sign there is a drop down menu with a image box and the ‘+’ sign change to the ‘ – ‘.when the user click on ‘-‘ the image frame should go to up side and hide.
|
|
|
|
|
hi i don't know any thing to help you except the control name and you can search it is name is nodeList or Node
|
|
|
|
|
Hi,
How do I check whether the user has M$ Word installed, and how do I check which version of Word that the user has installed?
thanks
|
|
|
|
|
What I do is call Registry.LocalMachine.OpenSubKey to read the registry at:
"Software\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe" and use regKey.GetValue to get the value of the key "Path"
If it returns null then word is not installed.
Otherwise it gives you the path to winword.exe and then you can call FileVersionInfo.GetVersionInfo to get the version number.
|
|
|
|
|
How do i plot 2D LineGraph using GDI+ on Windows Form?
Chris
|
|
|
|
|
You could search CodeProject for controls made by others. Some of those look really cool.
If you want to make it yourself:
Override the OnPaint method in your Control or Form class, get the Graphics object from the event arguments and play around with the DrawLine method.
|
|
|
|
|
how do i change just the selected date in dateTimePicker to a different color based on a certain condition?
Chris
|
|
|
|
|
Hi all,
I read some books that manipulating the window form components using a thread other than a main thread can cause bugs that are not repeatable. Is there any example code of how to get around this ?
And next, the documentation in MSDN often have the following statement. Its confusing for me. So when is a member public static and when is it an instance member?
Thread Safety
Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe
|
|
|
|
|
You can use the Invoke method of the Control class to safely call a piece of code that does a UI task.
There's a lot of other things to learn about thread safety. Have fun
|
|
|
|
|
A member is public static when it is declared public static and therefor can be accessed without an instance of the class. An instance member on the other side can only be accessed by using an object of the class. A short example:
public class Test
{
public static int StaticMember;
public int InstanceMember;
}
Test.StaticMember = 5;
Test obj = new Test;
obj.InstanceMember = 5;
www.troschuetz.de
|
|
|
|
|
As title
If yes, when is the data type in mfc dll?
Thanks
|
|
|
|
|
I'm trying to find a subclasses Textbox with transparent background or a replacement for the textbox that supports transparent bg. I don't know win api well enough so I'm looking for some clean code.
I've searched and keep running into an article on CP on AlphaBlendTextBox. BUT, that article is P.O.S. I've tried using it and it doesn't work properly. The author made a hell of a messy implementation. He tried to give the user the ability to set background images for the textbox. I do not want to have a mess implementation that requires a PictureBox docked inside the TextBox control. I just need to have a transparent bg.
|
|
|
|
|
i have documents scaned as bitmaps and they are scaned as legal documents but not all of them are legal is there a way i can read the bottom of the bitmap and see if the last 3 in are white cut off the last 3 in and print on letter papper instead of legal
thanks
chad
|
|
|
|
|
I have a legacy windows application that needs to automated. I have no access to the source code.
I would like to write a seperate (new) C# application to interact with the legacy app.
Basically the legacy app presents graphical data to the user and the user classifies the data. Classifaction is done by clicking one of a couple of buttons.
When the legacy app was written there was, apparently, no widely known/good method to classify this data, though humans (once trained) are able to do it quickly.
I've come up with and algorithm that should make the job easier, as it can classify maybe 70% of all cases automatically. The other 30% still require human intervention, but that's still a big improvement.
The goal then, is to have both apps running, both minimized and out-of-sight _unless_ the algorithm is unable to correctly classify the data (in which case it can just um-minimize the legacy app and make the user deal with it)
Basically, there are a two things I need help getting started with:
1. Getting graphical data from a minimized window 2. Programatically clicking buttons on a minimized window
Could anyone provide pointers to APIs or techniques I might look in to? I'm not asking for a solution (though I'd take them if you've got them ), but more along general pointers.
Thanks
|
|
|
|
|
Poor you. I really hate the way you're going be using automation, but I guess ur kinda stuck. The ultimate solution is to rewrite the program but that obviously is not feasible.
You're going to have to do some stuff with win32 api. Look into MSDN... you need to know how to
- get a handle to a window (this is used to "identify" what you are sending a message to)
- use SendMessage() - this is used to send a message to the windows/control u want to send a message to
- know what messages to send - there are a lot of messages you can play around with
A good tool to use for messing around is Micorosft Spy++. Also, google is your friend. You can search for "programatically click button" and u will find it in a snap.
|
|
|
|
|
I recently just started working with C# and really haven't quite figured out how to put a "handle" on a process to update a progress bar.
I would really appreciate it if someone can show me how to show the progress of a query being run on a database... on a progressbar.
Thanks in advance.
Lash
|
|
|
|
|
You mentioned query being run on a database...
You can't really get a "handle" for that. What you can do is if you have a batch of queries that you are executing and you know how many you can obviously keep track of how far you got.
|
|
|
|
|
Unless the database your using can provide you with some kind of progress "heart beat" while executing a single query, like a SELECT query, there is no way to do this. No RDBMS I know of will do this simply because it's impossible for the engine to predict how many records are going to be affected by the query that its executing. If you don't know where your destination is, it's impossible to track your progess to it, isn't it?
As mentioned in the other post, the closest your going to get is if you are executing multiple requests. You can execute those requests one at a time and update the ProgressBar between requests.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks guys for your response, Is there a "work around" to at least show the user some type of progress while executing....say... a single select statement ?
|
|
|
|
|
You can't show actual "progress" because there isn't any until the SELECT statement returns. But you can show a activity bar resembling the one the you see when installing Windows XP.
Building a Progress Bar that Doesn't Progress[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi All,
I am getting this error "NO Such interface supported" when from my C# application I am trying to export rows to Excel.
This is a problem only on certain user machines and they are running same vesion of Excel (i.e. 2000)
In refernce to Microsoft article http://support.microsoft.com/default.aspx?scid=kb;EN-US;316653[^]
I did ILDASM on Interop.Excel.dll in my program files and found that classes with suffix _SinkHelper are all Public. But on that users machine it is private. I am wondering why such inconsistency with the same setup project.
Any help and pointers are appreciated.
Thanks
Ruchi
|
|
|
|
|
I am working on a Visual Studio C# data acquisition application. I need to log acquired data to an Access data base.
I have the acquired data stored in my application in a DataTable. I want to append all columns of the DataTable to an Access table.
Since my application will be acquiring data over long periods of time, I don't want to keep all the rows of acquired data in a DataSet - once I write them to the database, I don't want to keep them an every growing DataTable in my application.
The only way I've been able to get this working is to use ExcuteNonQuery with
DbCmd.CommandText="INSERT INTO " + DestTableName + " (" + fields + ") VALUES (" + values + ")";
That's OK, except that I have to build up the INSERT INTO field names and values by iterating thru the table's columns and creating field text from the column names and value text from the column values.
Is there a way to simplify this by using * or some other means to select all the columns of the data row for insertion ito the data base table, so I don't have to build up the field and value strings every time I write to the database? (I suppose I could just build the fields text once since it won't be dynamic.)
Here's my code to insert one row of data into the Access database:
public static int RecordData(DataRow SourceRow, string DestTableName)
{
int NumRecordsAdded = 0;
string fields = "";
string values = "";
foreach (DataColumn col in SourceRow.Table.Columns)
{
//Don't record Key - it creates an SQL syntax error, must be a reserved word
if ( col.ColumnName.ToUpper() != "KEY")
{
if (SourceRow[col.ColumnName] == DBNull.Value)
{
//TODO Flag something if data column not filled
string ErrorMsg = "Data Recording Error - Data Column: " + col.ColumnName + "has no data";
SourceRow[col.ColumnName] = 0;
}
if (fields != "")
fields = fields + ", ";
fields = fields + col.ColumnName;
if (values != "")
values = values + ", ";
System.TypeCode ColTypeCode = System.Type.GetTypeCode(col.DataType);
switch (ColTypeCode)
{
//TODO Handle other data types?
case System.TypeCode.Int32:
values = values + ((Int32)SourceRow[col.ToString()]).ToString();
break;
case System.TypeCode.Double:
values = values + ((double)SourceRow[col.ToString()]).ToString();
break;
case System.TypeCode.String:
values = values + "'" + (string)SourceRow[col.ToString()] + "'";
break;
default:
values = values + "'" + SourceRow[col.ToString()].ToString() + "'";
break;
}
}
}
try
{
LogDB_Connection.Open();
OleDbCommand DbCmd= new OleDbCommand();
DbCmd.Connection = LogDB_Connection;
DbCmd.CommandText="INSERT INTO " + DestTableName + " (" + fields + ") VALUES (" + values + ")";
//MessageBox.Show(DbCmd.CommandText);
NumRecordsAdded = DbCmd.ExecuteNonQuery();
}
catch(Exception e)
{
MessageBox.Show("DB Command Exception '" + e.ToString() + "'");
}
LogDB_Connection.Close();
return NumRecordsAdded;
}
Hans
|
|
|
|
|
Hi,
I need to print text using a printer which is not capable of printing graphics, hterefore Graphics.DrawString fails.
Is there any alternative way to print avoiding DrawString method?
Thanks
Sirwan
|
|
|
|