|
Is there a reason you can't refactor the C++ code to .Net/C#?
What is the exact exception message?
Can you show us the interface you're creating (just the method prototypes will be sufficient).
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
I was trying to use PInvoke, as it provides another level of abstraction in a system that really doesn't need any more.
A generated C# code block dynamically loads the C++ dll through an interface loaded dynamically...and so on..
Anyway, I have resolved the issue by wrapping the C++ methods which take the unsigned char argument in methods which can be easily exposed through the interface.
Thanks for your input.
A girl in Engineering AND IT?!...what is this nonsense?
|
|
|
|
|
Did you consider wrapping the code in managed C++? I've done that occasionally in the past and had a lot of success with it.
|
|
|
|
|
Is there a reason you can't pinvoke this method? If you intend to write to the unsigned char [], you can pass a StringBuilder in to the method and use the output from that.
|
|
|
|
|
|
I don't think that was needed. Given her activity on the site to date, I was pretty confident that she wouldn't notice that, and now you've put a spotlight on it.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Maybe the spotlight should not have been put on her to begin with.
A little more class and little less lecherism, please.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Hey, I agree.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
My original indent was to inform her.
If you have a look at timings, i informed her just after few posts and later non-sense chat started.
Had she seen my message here, when it was posted, non-sense would have been limited very much.
I had to delete message myself from being further down voted by people, who down vote a already down voted message without thinking about it.
|
|
|
|
|
I'd prefer to wrap it in another method that would then be exposed. That's how I do P/Invoke.
public byte[] Whatever ( ... )
{
/* Maybe convert the parameters as necessary */
return ( C++Library.MethodName ( ... ) ) ;
}
|
|
|
|
|
Errr, I think this is managed C++, isn't it? In this case you don't need pointers at all. Both libraries are running under the CLR, so you can pass the byte array. Have you considered AssemblyResolve[^] event?
|
|
|
|
|
Hi,
Any one guide me about the datagridview
Advance Thanks,
GJ.Balaji
|
|
|
|
|
See here[^].
You can search on the internet and you will find tons of more information.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
Be warned, you should not edit data in a list control. Pop a dialog with the record information and edit it there, then reload the table/record in the grid after the user has completed editing.
Inline editing generates more problems that it solves.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Agreed - plus it is a lot easier for the user to work out what goes where. 5!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
I got more than 168000 results when I used this keywords "update and delete data in DataGridview in C#" to search on Google. whatever I will suggest you to move there[^] and read the whole thread. and you can also navigate this link[^] to learn how to delete,Insert and Update data with datagridview.
|
|
|
|
|
That's not how this forum works. Somebody posts a vague question that requires some research. It's up to you to go off, read up on the subject, write a lengthy reply detailing exactly how to accomplish the task and the ins and outs of the topic. Expecting somebody to Google a topic first is just crazy talk.
|
|
|
|
|
thanks for your valuable advice.
|
|
|
|
|
I'm not altogether convinced that your irony got through there.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
|
|
|
|
|
Neither am I. I hope that he's being subtle and not taking it to heart.
|
|
|
|
|
Hi friends,
I am developing a Parental Control application. I want that no body could kill this application from Task-Manager. Even administrator should not be allowed to kill this process from Task-Manager.
The only way to close the application should be that user click its CLOSE button, he will be then asked to enter his password, and if he enters correct password, application would get closed.
The behavior should be similar to when user try to kill an anti-virus. For example when I try to kill the anti-virus Kaspersky, I get below error message:
---------------------------
Unable to Terminate Process
---------------------------
The operation could not be completed.
Access is denied.
I also want similar behavior. Please let me know, how to do that.
Thanks in advance
|
|
|
|
|
If a user has full admin rights they can take down/kill any process.
At Karpersky it is a windows service that must be shut down(stoped) before ending the process(es).
[edit to add]
If the computer(s) are on a domain with active directory then it would be really simple to block even the local admins.
All the best,
Dan
modified on Sunday, January 16, 2011 12:55 PM
|
|
|
|
|
By hooking into TerminateProcess or NtTerminateProcess you can achieve what you're looking for. I seriously doubt though that having a .NET C# function as a hook function is a.) advisable and/or b.) a feasable thing.
If you want to invest some time/work to get going in C++ this CP articel might come in handy: Easy way to set up global API hooks[^]
Regards
|
|
|
|
|
This question comes up regularly in one form or another in this forum. While I appreciate that you have a legitimate reason for wanting to do this, you have to appreciate that we are averse to posting information that will let any old script kiddy create a malware application that can't be terminated. Sorry.
|
|
|
|
|
Well said. Exactly what I was thinking, but you reflect it in a much more polite manner.
I wasn't, now I am, then I won't be anymore.
|
|
|
|