|
Hi,
This is my scenario. I have a Win32 console application and I would like to call functions in this project by a C# widows application. I have tried p/invoke but I seem to get an error saying that the entry point was not found. Added the C++ project to the C# solution but couldn't get it working. Any suggestions on how to get it working ?
Thanks in advance,
indikat
|
|
|
|
|
indikat wrote: I have tried p/invoke but I seem to get an error saying that the entry point was not found.
yeah - a console app doesnt expose 'entry points' (well, I guess you could call 'main' an entry point, but that doesnt help you )
it sounds like what you really need is to put the functions (assuming you have the source) from the console app into a dll. If you cant do that, then you need to do something like run the console app as a process and capture stdout etc to get the results back ..
'g'
|
|
|
|
|
I'll try and add the necessary functions into a dll. Is there any way that I can add the C++ project to the solution and use the C++ functions from C# project ?
indikat
|
|
|
|
|
not really, if you want to keep them in c or c++ - you must export them from a dll - or you could simply re-write them in c#
|
|
|
|
|
Thanks for the info. I have managed to create a dll and export the needed function.
Might need to rewrite the code in C# later on.
indikat
|
|
|
|
|
|
|
hi..i am doing a project named as news mangement system.it is mainly aimed at the content manipulation of a web news paper on the internet.the technology used are asp.net with c# using ajax,web services,sql server 2000.i am beginner and i need ur help to complete my project.i hope u will give me the suitable suggestions and helps to me.
|
|
|
|
|
You will find all the help you need here[^].
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Hello,
I need to add datagridviewcolumns in a loop. For example:
string[] default_columns { "VlFile", "EquipName", "JobName", "NickName", "Operator", "EquipmentStartTime", "JobComment", "EquipTypeDesc" };
foreach (string s in default_columns)
{
}
The columns need to be bounded. I have the bound source and all this but the problem is adding the columns.
It will loop me through the array (default_columns) and will add this columns.
How can i do it?
I mean there is a problem because i need to declare a variable
|
|
|
|
|
I would create a datatable and point the datagridview to it
DataTable DT = new DataTable();
foreach (string s in default_columns)
{
DataColumn NewCol = new DataColumn(s);
DT.Columns.Add(NewCol);
}
DataGridView.DataSource = DT;
Regards
Mick Curley
|
|
|
|
|
OK but i load data to the datagridview from a database. And i need the columns to be bound to the database.
I declared the database (datatable) as a bindingsource to the datagridview.
But i need to add columns in the program (the user will choose which columns he wants to see)
|
|
|
|
|
I dont understand what your trying to do.
If you load the data from your Database table into a DataTable
haven't you got a reference to the columns within that DataTable?
Regards
Mick Curley
|
|
|
|
|
I have an empty datagridview (without columns declared- in the wizard of the datagridview).
The user choses which columns he wants to see from the database (using a listbox that i save the items in an array).
I want to add columns to the datagridview from this array (that was created from the listbox). The problem is that i need them to be bound to that datatable.
So i do in the foreach loop
datagridview.Columns.Add(s, s);
it creates me the columns right but they are not filled with data from the database.
If i do:
datagridviewcolumn col=new datagridviewtextboxcolumn();
col.headertext="abc";
col.datapropertyname="abc";
col.name="abc";
It does creates me the column and filles it with data.
But i need to do it in a loop that will go through all the items in the array (from the listbox) and add this columns
But i can use the same name to the datagridviewcolumn (datagridviewcolumn col=new datagridviewtextboxcolumn();), Because if i do it it says i already have this column (even if i change it's name in the loop)
|
|
|
|
|
I think i managed the problem. I had to declare the datagridviewcolumn
(datagridviewcolumn col=new datagridviewtextboxcolumn();)
inside the foreach loop (i declared it outside) and in this way it declares a ned datagridviewcolumn for each item in the loop.
|
|
|
|
|
Good to hear..
Regards
Mick Curley
|
|
|
|
|
okay i read the input from the text box as a char array.. then i've put if conditions that check for whitespaces, comments, strings, digits,
but it always skips which means that the comments then lie in the strings bit and so on...
please tell me where i went wrong here .
thankyou
#region Scanner
for (int i = 0; i < readInput.Length; i++)
{
char x = readInput[i];
#region Whitespace
if (char.IsWhiteSpace(x))
{
continue;
}
#endregion
#region stringliteral
else if (x == '"')
{
i++;
StringBuilder adder = new StringBuilder();
do
{x = readInput[i];
MessageBox.Show(x.ToString() + "testing");
adder.Append(x);
i++;
if (i == readInput.Length)
{
MessageBox.Show("WRONG");
break;
}
} while (x != '"' && i < readInput.Length);
whole.Add(adder);
}
#endregion
#region syntax
else if (char.IsLetter(x) || x == '_' && x!='"')
{
StringBuilder adder = new StringBuilder();
do
{
x = readInput[i];
MessageBox.Show(x.ToString() + "Letter Only");
adder.Append(x);
i++;
if (i == readInput.Length)
{
break;
}
} while ((char.IsLetter(x) || x == '_' && x!='"') && i < readInput.Length);
whole.Add(adder);
}
#endregion
#region digitliteral
else if (char.IsDigit(x))
{
StringBuilder adder = new StringBuilder();
do
{x = readInput[i];
MessageBox.Show(x.ToString() + "Is Digit");
adder.Append(x);
i++;
if (i == readInput.Length)
{
break;
}
}
while (char.IsDigit(x) && i < readInput.Length);
whole.Add(adder);
}
#endregion
#region comments
else if (x == '$')
{
i++;
x = readInput[i];
do
{
MessageBox.Show(x.ToString() + "testing comments");
i++;
if (i == readInput.Length)
{
MessageBox.Show("WRONG");
break;
}
x = readInput[i];
} while (x != '\n' && i < readInput.Length);
}
#endregion
}
#endregion
|
|
|
|
|
canatan wrote: else if (char.IsLetter(x) || x == '_' && x!='"')
I'm not sure this is correct. I mean, if x = ", then it can't equal _ or a letter, right ? I suspect you at least want to add some brackets. Then I'd step through it to work out what's going wrong.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
its
else if((char.IsLetter(x)||x=='_')&&(x!='"'))
okay so i think i fixed the digit bit but it causes problems elsewhere
<pre> #region digitliteral
else if (char.IsDigit(x)) // checking for digits
{
StringBuilder adder = new StringBuilder();
while (char.IsDigit(x) && i < readInput.Length)
{
MessageBox.Show(x.ToString() + "Is Digit");
adder.Append(x);
i++;
if (i == readInput.Length)
{
break;
}
x = readInput[i];
}
whole.Add(adder);
i--;
MessageBox.Show(adder.ToString()+readInput[i]);
}
#endregion
now all the digits come out right .. but the " is still ignored for some strange reason.. and i cant figure out the problem in that.. instead of the " being picked up.. it picks up the letter after the " and uses that instead...
i-- sets i to the last digit and then the loop shud run again which would mean that i should iterate to the next which is a " and hence this should be detected ..
|
|
|
|
|
Have you set a breakpoint and stepped through the code to see where things go wrong ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
thanks i got it
wrote it all out and worked it out
|
|
|
|
|
hi all
i am having a problim to save data in a binary file
binary file i mean if i edit it in notepad i will get
P—|S->\|’>(%x4ˆ}ֹµ%!רצIO׃ֱ1»ֹ4x(™”ףy_A×Gֳז˜‘ LO׀S Bb<<Skק¥"D$¥פƒג8H”ׂlt;ל3’”|w„´IK”ה~*2uOהRRyJ}ׂN¾z$×d8Mּ₪˜#ֱ%2JS&4ך’©‘ו#פ|׃J~tIJ$Bnב)’™נ„”¿ק¥ֲa:₪{‘ק$¥ּ%א`GtrJTר¥:„¾t’R¾=“י Mּ₪JH\B~׃DAR׳lq )sֿqפP5NֹגRRַ@~$צ=<RRַ’˜iֺGRS™I+¦׀'&
i need a function in c# to save the string "http://www.quickapp.co.il/" in binary way
thankX
hamzi
|
|
|
|
|
I think you are very confused. Your string IS being saved in a binary way. I assume you mean that you want to encrypt the string. Use the Cryptography namespace for this.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Hello!
I’m trying to build an app, which should have Flash Video Play control, which plays FLV from server (certain URL). For Flash Player ActiveX you have to save the movie to a temporary location to load it and play, isn’t it? You'll have to create a corresponding link that you can pass to the Flash Player ActiveX and then delete the movie after it is played. Of course you can’t guarantee high security level , but I think it’s good, if at least no temporary files are created. So the question is how to make Flash Player ActiveX be able to load flash movies directly from any source without usage of temp files?
Thank you!
|
|
|
|
|
If the ActiveX control doesn't have a method that takes a URL for the file to play, or if you're using that method, and it creates a local file, then I suspect you have your answer.
Just to add - if your Flash player plays a file from the server, then your machine must have access to that file on the server. So, how does it matter if a copy is made locally, or not ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|