In C# PInvoke, how do I pass a string buffer so that the C DLL fills it and returns? What will be the PInvoke declaration?
The C function declaration is
int GetData(char* data, int buflength);
In C#, I have declared it as
[DllImport(DllName)]
static extern Int32 GetData([MarshalAs(UnmanagedType.LPStr)]StringBuilder receiveddata, In...
I'm creating a new url infrastructure for my sites, and came across this problem:
If I have an extensionless URL like this "/Products/Beverages/Minty-chocolate-drink/Distributors", I can't distinguish parameters from pages...
I can find out which page was called by finding the longest match in my pages and treat the rest as parameters, ...
Is there a way to set up a C# function to accept any number of parameters? For example, could you set up a function such that the following all work -
x = AddUp(2, 3)
x = AddUp(5, 7, 8, 2)
x = AddUp(43, 545, 23, 656, 23, 64, 234, 44)
...
Hello all - it's a New Year but you're still left with a thick Mr Dean!!
Ok, the scenario - I have a textbox, a two radio buttons, a button and a gridview.
<code>
<body>
<form id="form1" name="form1" runat="server">
<asp:TextBox ID="tbxHowMany" runat="server"
style="z-index: 1; left: 245px; top: 105px; position: absolute; hei...
I have an ActionFilterAttribute which I want to accept parameters through but I can't figure out pass them across.
So my action filter looks like this;
public class PreventAction : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
filterContext.Result = new RedirectRe...
What are appropriate values for minimum confidence and minimum support values for the Apriori algorithm? How could you tweak them? Are they fixed values, or do they change during the running of the algorithm? If you have used this algorithm before, what values did you use?
...
In all the languages that I understand this is not possible but someone was telling me it was possible in C++ but I have a hard time believing it. Essentially when you parameterize a class you are creating a unique class in the compilation stage aren't you?
Let me know if I am not being clear with my question.
Here is my attempt at ex...
Good day
I am a student developer and I have built several installers for the company I am working with now. So I am fairly familure with WIX.
We recently decided to have a Build server that auto builds our solution. It builds both debug, and release, aswell as Obfuscated(and non obfuscated) projects.
And you really don't have to unders...
I want to use the correct term to make my API as intuitive as possible, so when a parameter is expected to be a full path and filename (ex "C:\Users\Max\Documents\MyDocument.txt") what is the correct term?
filename - that would just be MyDocument.txt, right?
path - that would just be C:\Users\Max\Documents, right?
What should I use ...
Hi All,
I have main matrix report and I want to navigate my sub report from main report by
Jump To URL:(Using below JavaScript function) method.
="javascript:void(window.open('http://localhost/ReportServer/Pages/ReportViewer.aspx?%2fKonsolidata_Data_Exporting_Project%2fEXPORT_REPORT_TEST&rs:Command=Render&RP_cntry="+Fields!STD...
I need a performance enhanced Activator.CreateInstance() and came across this article by Miron Abramson that uses a factory to create the instance in IL and then cache it. (I've included code below from Miron Abramson's site in case it somehow disappears). I'm new to IL Emit code and anything beyond Activator.CreateInstance() for instant...
Hello Everybody,
The code in the sequence is working fine, but looking to improve the MySQL code to a more efficient format.
The first case is about a function that received a parameter and returns the customerID from MySQL db:
def clean_table(self,customerName):
getCustomerIDMySQL="""SELECT customerID
FROM customer
WHERE ...
I've read many times that
Assemblies generated from F# or any other .NET language are (almost) indistinguishable.
I was then experimenting with F# and C# interop on .NET 4 (beta 2). I created a new solution, and a C# project, with the following class:
public class MyClass {
public static int Add(int a, int b) { return a + b; }...
OpenConnect();
OleDbDataAdapter olda = new OleDbDataAdapter("Select * from RECORD where LIC_PLATE='GE 320'", con);
DataSet dataset = new DataSet();
olda.Fill(dataset);
cr1.SetDataSource(dataset.Tables[0]);
crystalReportViewer1.ReportSource = cr1;
crystalReportViewer1.Refresh();
...
I am trying to build up a string which will link directly to the Google maps print view.
e.g. http://maps.google.co.uk/maps?f=d&source=s_d&saddr=brixton&daddr=bath+to:bournemouth&hl=en&geocode=FUQ7EQMdyDr-_ym5RCh-QQR2SDGm1XOO93zFHA%3BFbQEEAMdMgfc_ykt4T50pnhxSDEJmm3W0CeLEw%3B&mra=ls&sll=51.75764,-1.241455&...
In WPF app I have a ListView which is connected with ObservableCollection ShQuCollection through databinding:
<ListView Name="ShSelList" ItemsSource="{Binding Source={StaticResource myDataSource},Path=ShQuCollection}" SelectionChanged="ShSelList_SelectionChanged">
<ListView.View>
<GridView>
<GridViewColumn Header="Co...
Hi Everybody,
I have a function with a new improved version of the code for automatic table indexing:
def update_tableIndex(self,tableName):
getIndexMySQLQuery = """SELECT numberID
FROM %s;""" % (tableName,)
updateIndexMySQLQuery = """UPDATE %s
SET numberID=%s WHERE numberID=%s;""" % (tableName,)
updateIndex=1
...
I recently read (and unfortunately forgot where), that the best way to write operator= is like this:
foo &operator=(foo other)
{
swap(*this, other);
return *this;
}
instead of this:
foo &operator=(const foo &other)
{
foo copy(other);
swap(*this, copy);
return *this;
}
The idea is that if operator= is called with...
I'm using Fluent NHibernate to create an ASP.NET MVC project, with Submissions and Votes (Up/Down) by Users.
Of course, Users can vote submission Up or Down. To record this, I created a middle table, SubmissionVote, which contain the following fields:
submissionId (int)
userId (int)
score (enum: up/down)
Here are my mappings:
Submis...
Hi,
I've created a method which is accept parameter by reference like following :
void Func1(QList<int> *a){
(*a) << getDataFromAnotherFunction();
//or
(*a).append(getDataFromAnotherFunction());
}
QList<int> getDataFromAnotherFunction(){
//we will do something good over here
return QList<int>
}
but the problme is when I want to us...