|
Read up on Marshalling and unmanaged code. Normally C# can handle unmanaged code pretty well.
Although it might take some fiddling (searching) .
[EDIT]
Take in account that older code still takes ASCII strings or worse (1 byte vs 2 bytes) and even C# integers can be C++ longs, ...
[/EDIT]
|
|
|
|
|
Since you have the .h and .hpp files for your DLL, you might want to give this a shot. I have used it extensively to help me generate pinvoke signatures. The link for the generator is included on the page.
pinvoke signature generator[^]
|
|
|
|
|
I am a newbie to C#, my development environment is:
Visual Studio 2010 Ultimate Edition
Sql Server 2005
Programming Language C# 2010
I've a form with Unbound Datagridview, from which data is save to Sql Server 2005 by looping through For..Each and pass SQL INSERT Statement when user clicks Save button without any problem.
Now what I need is a way that for same Save button, if data is saved in Sql Server then DataGridView will bind to that records so that if user want to Update/Delete/Add data he/she just need to edit the data and again press Save button. All records will share the same unique ID. It's a products database, and when user click save it will generate a transaction Id same for all products user enter when saving. So I think I need to generate a Select statement and retrieve all those records user save through that Unique ID, but then how to bind it to DataGridView datasource and how to Update/Delete through SqlAdapter or other?
Thanks and best regards
Ahmed
|
|
|
|
|
I'm trying to add Microsoft IObjectSafety Interface to my code. I send string "MyParam" from JavaScript and catch it in my C# code like this:
private string myParam = "Empty";
public string MyParam
{
get
{
return myParam;
}
set
{
myParam = value;
}
}
After I add the IObjectSafety interface this doesnt work anymore, I get error interfaces cannot contain fields. How do I get the MyParam without using fields?
This is the code:
public interface IObject
{
[DispId(1)]
string MyParam; <--- error
};
public class WMC.PlayerLoader : IObjectSafetyImpl, IObject
{
#region [IObject implementation]
private string myParam = "Empty";
public string MyParam
{
get
{
return myParam;
}
set
{
myParam = value;
}
}
#endregion
|
|
|
|
|
Are you sure that an interface[^] is the correct mechanism for your problem?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I need to add the IOBjectsafety interface to get rid of the message ActiveX might not be safe message when using it locally, I don't think there is any other way around that except verisign. All the methods on the interface work fine except getting that string.
|
|
|
|
|
Joni_78 wrote: string MyParam; <--- error
Your implementation of MyParam is a property, not a field. You should declare this as string MyParam { get; set; } in the interface definition (which overcomes the interface containing fields error as well).
|
|
|
|
|
I've newer done this like that before. Do I need to change anything in this, or should it work as it was?
public class WMC.PlayerLoader : IObjectSafetyImpl, IObject
{
#region [IObject implementation]
private string myParam = "Empty";
public string MyParam
{
get
{
return myParam;
}
set
{
myParam = value;
}
}
#endregion
|
|
|
|
|
Nm, I got it now. Thank you 
|
|
|
|
|
You're welcome. I'm glad you got it sorted.
|
|
|
|
|
Hi, i am new to asp.net. i need to display complete URL of my website in web browser. if user navigate to some other page the url must include address of that page too. plz do help..
|
|
|
|
|
Varsha R wrote: Hi, i am new to asp.net
Fair enough, but isn't that a great big hint as to which forum you should post this question in instead?
|
|
|
|
|
|
How do you programmatically expand a url link to its true location?
Do you know about tinyurl.com and baidu.com? Baidu.com is a search engine that tries to discourage people from using their web site to make metasearch engines by hiding their links in a way that is a lot like how tinyurl.com works. TinyUrl.com is a web site where, if you want to present someone with a link to something and that link is long, you can use tinyurl to produce a tiny url for presentation purposes.
Anyway, what I want to do is to find a way to programmatically take the link http://www.baidu.com/link?url=mW91GJqjJ4zBBpC8yDF8xDhiqDSn1JZjFWsHhEoSNd85PkV8Xil7qccoOX3rynaE (the first link in a search for Jessica Alba using baidu.com) and have it return the actual link, http://baike.baidu.com/view/270790.htm . That is just one example. What I want to do is not specific to Jessica but for using Baidu.com as part of my group of search engines in my meta search engine project.
Maybe there is a way of using the WebBrowser class but I did not see a member that was the URL.
Maybe there is a way of using WebRequest and WebResponse.
|
|
|
|
|
By requesting the URL shown on Baidu. Then analyse the response. Somewhere there you'll find the redirection information, either in the HTTP header (e.g. a REDIRECT response code plus the correct URL) or a JavaScript in the HTML document, or something similar.
Do not forget that Baidu could find out that you do too many surch requests, and just stop responding to your requests (e.g. block your IP address).
|
|
|
|
|
I am a VB.NET Programmer learning C#. One of my applications I transfered over to C# via an online converion tool. I am receiving an error which I do not see why it's causing an error.
What I have now is:
try {
if (System.IO.File.Exists(srcedest) == false) {
My.Computer.FileSystem.RenameFile((dest), newName) sheet.Cells(row, 1).value;
}
} catch (Exception ex) {
txtLog3.AppendText(sheet.Cells(row, 1).value);
}
With the error of "expecting ;" at the "sheet" in My.Computer.FileSystem.RenameFile((dest), newName) sheet.Cells(row, 1).value;
Why would this cause an error since you don't put a ";" until the end of a statement?
Thanks in advanced.
daveofgv
modified 27-Nov-12 16:52pm.
|
|
|
|
|
Dunno, maybe remove the newName) and stick a ) just before the ; ?
|
|
|
|
|
Apparently, I can only report you. Spam or Abusive.
The new UI must be a huge success, if it's causing the hamsters so much overtime.
|
|
|
|
|
My.Computer.FileSystem.RenameFile((dest), newName) sheet.Cells(row, 1).value; Your second line isn't the same as the first one. The reason is down to the fact that in the VB line, it's attempting to put sheet.Cells(row,1).value into the optional parameter newName. In your version, you don't do that - so the statement ends after the call to RenameFile.
|
|
|
|
|
Using a parameter name followed by a := means that you create that variable on the fly and assign the value to it. Just think of two statements:
string newName = sheet.Cells(row, 14).value + "_" + sheet.Cells(row, 15).value);
My.Computer.FileSystem.RenameFile(dest, newName);
|
|
|
|
|
Try to change to this line
My.Computer.FileSystem.RenameFile((dest), newName = sheet.Cells[row, 14].value + "_" + sheet.Cells[row, 15].value)
|
|
|
|
|
Hi All
How I can integrate a finger print demo inside asp.net with C# application?
Also how I can customize my SDK to search and match the fingerprint by C# connecting to SQL server
Plz provide ur help or guidance as u can
Thank u
|
|
|
|
|
a) don't use bold: it's shouting!
b) what have you already tried for yourself?
c) one question at a time.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
To add to that;
- It's a lousy subject line; doesn't tell us anything about your problem.
- You're not urgent to me. Why would it, just because it's included in the subject?
- Don't use text-speak. We're not sms-ing, and you don't pay by the character.
Asma AlShehhi wrote: How I can integrate a finger print demo inside asp.net with C# application?
Depends. Read the documentation that comes with the SDK. Yes, it's called "research".
Asma AlShehhi wrote: Also how I can customize my SDK to search and match the fingerprint by C# connecting to SQL server
By having each known fingerprint known in a table, and executing a query to verify it's authenticity.
|
|
|
|
|
I miss being able to upvote answers like this...have a virtual 5!
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|