|
I'd like to use some of the .NET features (in particular WPF) from within the app. It seems to be some compatibility issue with one of the libraries used in the project: any chances that someone has encountered a similar problem before?
|
|
|
|
|
Not sure but you could try posting a follow up question in the WPF forum, explaining in more detail what you are trying to do.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
|
I tried to recompile the project removing any reference to .NET assemblies and the few lines of WPF code that I added, basically the project is now the original C++/MFC, just compiled with /clr flag active: I get the same error as soon as the app starts, so I guess it's some sort of compatibility issue with one of the libraries I'm using. I'll try to figure out which one is.
|
|
|
|
|
It's perfectly possible and acceptable to use the .NET framework with MFC...I did it for quite a while before migrating all my apps to full WPF/Silverlight.
Mixing WPF with MFC may present some challenges. Both are entire GUI systems handling handling native Window handles and associated messaging etc. To have them run simultaneously in the same process? I don't know...
Mark Salsbery
|
|
|
|
|
Well I tried to add WPF controls in other MFC projects with apparently no problems, anyway it seems not to be a WPF issue cause the problem rises just activating the /clr compilation on the original C++ project.
|
|
|
|
|
We're successfully doing this now (Migrated existing MFC app to WPF and still using MFC in places). We did not switch /clr on everywhere -- for one it would generate IL for ALL our C++ code which would slow down a lot of things. So, we only add /clr on files which have C++/CLI code.
John
|
|
|
|
|
Hello, many thanks for the tip, I already noticed the #pragma managed/unmanaged directive, but I had to abandone the project for a while, as soon as possible I'll try that and make an update here.
|
|
|
|
|
Hello people I wanna know if there is anyway you could freeze or program hold it's execution or control it, like a firewall for instance it freezes the program and tells the user "This program is unsafe.". Do any of you'll AV freaks know anything on how to do such a thing.
Edit: Like pausing the program if you were programming it or compiling it.
Regards,
Brandon T. H.
CodeProject Member
|
|
|
|
|
The only way that anti-virus programs recognise this is by scanning the executable file and looking for patterns that match known viruses. Once the program is running then there is little you can do to recognise when it performs some dangerous or questionable action.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I believe that AV programs suspend the process. This is the same advice Mark Russinovich gives when you see a suspicious process -- use task mgr, right-click and pick Suspend.
So, I see the SuspendThread() API which maywork but you'd really want to suspend all threads simultaneously instead of walking all threads and suspending individually.
This article may help: Win32 process suspend/resume tool[^]
John
|
|
|
|
|
Yes I would like to know how to suspend a specific process by name or one at a time. I would also like to know if there could be anyway you could skip specific processes as well like "explorer" or "winlogin" although these a Microsoft Windows made programs, If a virus was smart it would disguise it's name like that, so how would you be able to contrast the two from a virus and the real program, maybe heuristics (to search for suspicious behavior or overuse of system resources like RAM, processor, internet bandwidth, etc.) or by it's color depth, ever notice when two processes of the same name on Microsoft Windows taskmgr the second or first process has a (*) star next to it followed by a 2, 4, 8, 16, 32 or 64 (color depths), but these are the two ways of my knowledge how to contrast the two but how to use these on programming, but I'm really hardcore on this subject and find every possible way to the best of my knowledge to predict how malicious software could use stealth.
I did read that article you recommended for me I'm still studying and trying to identify things in the code that would be useful.
And for that taskmgr thing you said
John Schroedl wrote: I believe that AV programs suspend the process. This is the same advice Mark Russinovich gives when you see a suspicious process -- use task mgr, right-click and pick Suspend.
I did find that type of "taskmgr" so did you mean't Process Explorer? It does have the suspend process on it and was made by Microsoft. The default task manager installed on windows does not have such feature on it
see image (in URL): http://harristech.webs.com/temp/taskmanagerss1.png
so yeah I do understand what are you trying to explain, we are on the same page right?
|
|
|
|
|
There is no "freeze". It is a block.
A application start without AV would look something like this.
1. User requests app start
2. Windows itself calls a low level method called X
3. X returns after doing something
4. Other stuff happens in windows
5. App starts
With AV in place the above process becomes the following instead.
1. User requests app start
2. Windows itself calls a low level method called X
a. Call to AV is made
b. AV does stuf
c. AV displays dialog
d. (other stuff.)
3. X returns after doing something
4. Other stuff happens in windows
5. App starts
In the above c blocks waiting on the user. Since it blocks 2 blocks. Since 2 blocks the entire process blocks.
The AV accomplishes this by hooking into windows low level functionality. AV apps probably use quite a few different low level API hooks but in terms of this question only the specific one is called "File System Filter Drivers".
See the following.
http://msdn.microsoft.com/en-us/windows/hardware/gg462968.aspx[^]
|
|
|
|
|
Hi,
I think that you need to handle the instruction pointer.
You can edit eip using jmp, call or ret. You just can't directly read from or write to eip using normal operations.
Best regards!
|
|
|
|
|
Hi,
I'm using VC ++ , Visual studio 2010 express edition.
And trying to create simple form application, and a thread and some control classes in my application.
1) But whenever I try to crate a thread class which is derived from "CbaseThread" class, I always get an error .. " Unmanaged class can't derive from a managed Class "
2) If I try to make my thread class as managed, then I can't derived from "CbaseThread", since the class becomes sealed .
3) In one of the control class I need a reference to "FORM1", which is created inside Application.Run (gcnew Form1()).. Even getting this reference is also not possible.
Can anyone please help me..
I can completely manage with "Unmanaged Code.."
How can I have just unmanaged code throughout my application.
If having only unmanaged code is not at all possible, how can i solve above mentioned problem. ie working with both managed and unmanaged code together.
Thanks in advance.
Regards,
Vijay.
|
|
|
|
|
What is CBaseThread?
Vijay Sringeri wrote: In one of the control class I need a reference to "FORM1", which is created inside Application.Run (gcnew Form1())..
Move the definition from the Run method to a place where you have access to it.
Vijay Sringeri wrote: How can I have just unmanaged code throughout my application.
Don't use Windows Forms and make your project an unmanaged c++ project. Windows Forms is part of the .Net framework so has to use managed code.
Mark Salsbery
|
|
|
|
|
hi all i hope u help me im an it student they want us project about graghices using physical equasion like simulating car ,any game can u help any cod>my email sicko.scorpion@gmail.com than you ver
|
|
|
|
|
I think you would be much better to use Google to research your issue; and try spelling your keywords in full.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Here are all the reasons I gave a 1 to your question :
1. You didn't set a meaningful title
2. You didn't take time to make proper sentences (spelling mistakes, textspeak, almost no punctuation) ; how do you expect us to help you if being understood isn't your concern at the first place ?
3. We are not here to do your homework
4. Never put your email address on a public forum, unless being spammed to death isn't a problem for you
|
|
|
|
|
phil.o wrote: Never put your email address ...
I have stopped warning people about this as chances are they are doing it all over the internet.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I didn't, yet
|
|
|
|
|
How to get callback in managed C++/CLI from unmanaged code, my managed code class has implemented unmanaged COM interface ,how shall i do that
|
|
|
|
|
i think this will help
<a href="http://blogs.microsoft.co.il/blogs/alon/archive/2007/05/29/Native-Callback.aspx">http://blogs.microsoft.co.il/blogs/alon/archive/2007/05/29/Native-Callback.aspx</a>[<a href="http://blogs.microsoft.co.il/blogs/alon/archive/2007/05/29/Native-Callback.aspx" target="_blank" title="New Window">^</a>]
Величие не Бога может быть недооценена.
-- modified 3-Jan-12 4:58am.
|
|
|
|
|
Your link is not clickable.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Just pull out the useful part from the link.
http://blogs.microsoft.c.il/blogs/alon/archive/2007/05/29/Native-Callback.aspx
I genrally use method #4 because many of my callbacks are in the form of interface classes (e.g. "ICallback"). I create a "bridge" class (unmanaged class built in a managed dll) with an implementation of the unmanaged callback that marshals any parameters to the managed world, then calls a similar method on a gcroot'ed handle to a managed interface.
Bob Ciora
|
|
|
|